diff --git a/sahara/plugins/vanilla/abstractversionhandler.py b/sahara/plugins/vanilla/abstractversionhandler.py index 02697234..8bc2f168 100644 --- a/sahara/plugins/vanilla/abstractversionhandler.py +++ b/sahara/plugins/vanilla/abstractversionhandler.py @@ -57,6 +57,12 @@ class AbstractVersionHandler(object): def get_edp_engine(self, cluster, job_type): return + def get_edp_job_types(self): + return [] + + def get_edp_config_hints(self, job_type): + return {} + @abc.abstractmethod def get_open_ports(self, node_group): return diff --git a/sahara/plugins/vanilla/plugin.py b/sahara/plugins/vanilla/plugin.py index 57624617..431605fb 100644 --- a/sahara/plugins/vanilla/plugin.py +++ b/sahara/plugins/vanilla/plugin.py @@ -72,6 +72,19 @@ class VanillaProvider(p.ProvisioningPluginBase): return self._get_version_handler( cluster.hadoop_version).get_edp_engine(cluster, job_type) + def get_edp_job_types(self, versions=[]): + res = {} + for vers in self.version_factory.get_versions(): + if not versions or vers in versions: + vh = self.version_factory.get_version_handler(vers) + res[vers] = vh.get_edp_job_types() + return res + + def get_edp_config_hints(self, job_type, version): + version_handler = ( + self.version_factory.get_version_handler(version)) + return version_handler.get_edp_config_hints(job_type) + def get_open_ports(self, node_group): return self._get_version_handler( node_group.cluster.hadoop_version).get_open_ports(node_group) diff --git a/sahara/plugins/vanilla/v1_2_1/versionhandler.py b/sahara/plugins/vanilla/v1_2_1/versionhandler.py index 22441750..63f85f31 100644 --- a/sahara/plugins/vanilla/v1_2_1/versionhandler.py +++ b/sahara/plugins/vanilla/v1_2_1/versionhandler.py @@ -549,6 +549,12 @@ class VersionHandler(avm.AbstractVersionHandler): return edp_engine.EdpOozieEngine(cluster) return None + def get_edp_job_types(self): + return edp_engine.EdpOozieEngine.get_supported_job_types() + + def get_edp_config_hints(self, job_type): + return edp_engine.EdpOozieEngine.get_possible_job_config(job_type) + def get_open_ports(self, node_group): cluster = node_group.cluster diff --git a/sahara/plugins/vanilla/v2_6_0/versionhandler.py b/sahara/plugins/vanilla/v2_6_0/versionhandler.py index a0c16a5c..2eb340cd 100644 --- a/sahara/plugins/vanilla/v2_6_0/versionhandler.py +++ b/sahara/plugins/vanilla/v2_6_0/versionhandler.py @@ -182,5 +182,11 @@ class VersionHandler(avm.AbstractVersionHandler): return edp_engine.EdpOozieEngine(cluster) return None + def get_edp_job_types(self): + return edp_engine.EdpOozieEngine.get_supported_job_types() + + def get_edp_config_hints(self, job_type): + return edp_engine.EdpOozieEngine.get_possible_job_config(job_type) + def get_open_ports(self, node_group): return c.get_open_ports(node_group)