Merge "Adding validation check for Spark plugin"

This commit is contained in:
Jenkins 2015-02-13 10:55:46 +00:00 committed by Gerrit Code Review
commit 39276bd606
2 changed files with 10 additions and 2 deletions

View File

@ -75,6 +75,15 @@ class SparkProvider(p.ProvisioningPluginBase):
raise ex.InvalidComponentCountException("datanode", _("1 or more"),
nn_count)
rep_factor = c_helper.get_config_value('HDFS', "dfs.replication",
cluster)
if dn_count < rep_factor:
raise ex.InvalidComponentCountException(
'datanode', _('%s or more') % rep_factor, dn_count,
_('Number of %(dn)s instances should not be less '
'than %(replication)s')
% {'dn': 'datanode', 'replication': 'dfs.replication'})
# validate Spark Master Node and Spark Slaves
sm_count = sum([ng.count for ng
in utils.get_node_groups(cluster, "master")])

View File

@ -76,8 +76,7 @@ class SparkGatingTest(swift.SwiftTest, scaling.ScalingTest,
'name': 'test-cluster-template-spark',
'plugin_config': self.plugin_config,
'description': 'test cluster template for Spark plugin',
'cluster_configs': {
},
'cluster_configs': {'HDFS': {'dfs.replication': 1}},
'node_groups': [
{
'name': 'master-node',