deb-sahara/sahara/plugins/storm/edp_engine.py
Telles Nobrega 252b311dfc Storm EDP implementation
Implementation of Storm EDP. This will allow users to submit Storm Jobs
via UI.
This patch implements the EDP engine, Storm Job Type.

Implements: bp storm-edp

Change-Id: I7d5937f26df715ef66826396a6387ab512af1f47
2015-04-29 17:14:58 -03:00

36 lines
1.2 KiB
Python

# Copyright (c) 2015 Telles Nobrega.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from sahara import exceptions as ex
from sahara.i18n import _
from sahara.service.edp.storm import engine as edp_engine
class EdpEngine(edp_engine.StormJobEngine):
edp_base_version = "0.9.2"
@staticmethod
def edp_supported(version):
return version >= EdpEngine.edp_base_version
def validate_job_execution(self, cluster, job, data):
if not self.edp_supported(cluster.hadoop_version):
raise ex.InvalidDataException(
_('Storm {base} required to run {type} jobs').format(
base=EdpEngine.edp_base_version, type=job.type))
super(EdpEngine, self).validate_job_execution(cluster, job, data)