Disable autotune configs for scaling old clusters

Implemented option for disabling scaling for old clusters.
After autoconfiguration we will put 'auto-configured' flag into
cluster.extra field. That will allow us to disable autotune configs
for old created clusters.

Partial-Implements blueprint: recommend-configuration

Change-Id: I7d09ef20da51a170e9c021032c8bf13c34ae8d85
This commit is contained in:
Vitaly Gridnev
2015-07-21 15:33:55 +03:00
parent 936da00f78
commit d8c78390aa
6 changed files with 12 additions and 12 deletions

View File

@@ -88,6 +88,6 @@ class CDHPluginProvider(p.ProvisioningPluginBase):
return self._get_version_handler(
node_group.cluster.hadoop_version).get_open_ports(node_group)
def recommend_configs(self, cluster):
def recommend_configs(self, cluster, scaling=False):
return self._get_version_handler(
cluster.hadoop_version).recommend_configs(cluster)
cluster.hadoop_version).recommend_configs(cluster, scaling)

View File

@@ -374,7 +374,7 @@ class AbstractPluginUtils(object):
_("Unable to find config: {applicable_target: %(target)s, name: "
"%(name)s").format(target=service, name=name))
def recommend_configs(self, cluster, plugin_configs):
def recommend_configs(self, cluster, plugin_configs, scaling):
provider = CDHPluginAutoConfigsProvider(
AUTO_CONFIGURATION_SCHEMA, plugin_configs, cluster)
AUTO_CONFIGURATION_SCHEMA, plugin_configs, cluster, scaling)
provider.apply_recommended_configs()

View File

@@ -114,5 +114,5 @@ class VersionHandler(avm.AbstractVersionHandler):
def get_open_ports(self, node_group):
return dp.get_open_ports(node_group)
def recommend_configs(self, cluster):
PU.recommend_configs(cluster, self.get_plugin_configs())
def recommend_configs(self, cluster, scaling):
PU.recommend_configs(cluster, self.get_plugin_configs(), scaling)

View File

@@ -126,5 +126,5 @@ class VersionHandler(avm.AbstractVersionHandler):
def get_open_ports(self, node_group):
return dp.get_open_ports(node_group)
def recommend_configs(self, cluster):
PU.recommend_configs(cluster, self.get_plugin_configs())
def recommend_configs(self, cluster, scaling):
PU.recommend_configs(cluster, self.get_plugin_configs(), scaling)

View File

@@ -129,5 +129,5 @@ class VersionHandler(avm.AbstractVersionHandler):
def get_open_ports(self, node_group):
return dp.get_open_ports(node_group)
def recommend_configs(self, cluster):
PU.recommend_configs(cluster, self.get_plugin_configs())
def recommend_configs(self, cluster, scaling):
PU.recommend_configs(cluster, self.get_plugin_configs(), scaling)

View File

@@ -55,8 +55,8 @@ class TestPluginUtils(b.SaharaTestCase):
plug_utils = pu.AbstractPluginUtils()
fake_plugin_utils = mock.Mock()
fake_cluster = mock.Mock()
plug_utils.recommend_configs(fake_cluster, fake_plugin_utils)
plug_utils.recommend_configs(fake_cluster, fake_plugin_utils, False)
self.assertEqual([
mock.call(CONFIGURATION_SCHEMA,
fake_plugin_utils, fake_cluster)
fake_plugin_utils, fake_cluster, False)
], provider.call_args_list)