diff --git a/sahara/plugins/cdh/abstractversionhandler.py b/sahara/plugins/cdh/abstractversionhandler.py index 02697234..5ba3cb36 100644 --- a/sahara/plugins/cdh/abstractversionhandler.py +++ b/sahara/plugins/cdh/abstractversionhandler.py @@ -57,6 +57,14 @@ class AbstractVersionHandler(object): def get_edp_engine(self, cluster, job_type): return + @abc.abstractmethod + def get_edp_job_types(self): + return [] + + @abc.abstractmethod + def get_edp_config_hints(self, job_type): + return {} + @abc.abstractmethod def get_open_ports(self, node_group): return diff --git a/sahara/plugins/cdh/plugin.py b/sahara/plugins/cdh/plugin.py index d1ee6ee7..f406e65f 100644 --- a/sahara/plugins/cdh/plugin.py +++ b/sahara/plugins/cdh/plugin.py @@ -71,6 +71,19 @@ class CDHPluginProvider(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/cdh/v5/versionhandler.py b/sahara/plugins/cdh/v5/versionhandler.py index 6f4bfedb..e2e1d421 100644 --- a/sahara/plugins/cdh/v5/versionhandler.py +++ b/sahara/plugins/cdh/v5/versionhandler.py @@ -100,5 +100,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 dp.get_open_ports(node_group) diff --git a/sahara/plugins/cdh/v5_3_0/versionhandler.py b/sahara/plugins/cdh/v5_3_0/versionhandler.py index 666f1a41..8111c60f 100644 --- a/sahara/plugins/cdh/v5_3_0/versionhandler.py +++ b/sahara/plugins/cdh/v5_3_0/versionhandler.py @@ -109,5 +109,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 dp.get_open_ports(node_group)