34
34
35
35
import deployer_utils
36
36
from plugins .base_creator import Creator
37
- from exceptiondef import FailedCreation
37
+ from exceptiondef import FailedCreation , FailedValidation
38
38
39
39
class OozieCreator (Creator ):
40
40
@@ -48,6 +48,17 @@ def validate_component(self, component):
48
48
def get_component_type (self ):
49
49
return 'oozie'
50
50
51
+ def assert_application_properties (self , override_properties , default_properties ):
52
+ # Assert application properties before creating the application
53
+ for component in default_properties :
54
+ properties = default_properties [component ].copy ()
55
+ properties .update (override_properties .get (component , {}))
56
+ if 'spark_version' in properties and properties ['spark_version' ] != self ._config ['oozie_spark_version' ]:
57
+ information = "Mismatch between cluster's oozie spark version (version = %s) and \
58
+ requested spark version" % self ._config ['oozie_spark_version' ]
59
+ raise FailedValidation (json .dumps ({"information" : information }))
60
+ properties = None
61
+
51
62
def destroy_component (self , application_name , create_data ):
52
63
logging .debug (
53
64
"destroy_component: %s %s" ,
@@ -98,7 +109,7 @@ def create_component(self, staged_component_path, application_name, user_name, c
98
109
# platform shared libs e.g. hbase
99
110
properties ['oozie.libpath' ] = '/pnda/deployment/platform'
100
111
# For spark2 add a special setting to select spark2
101
- if 'component_spark_version' in properties and properties [ 'component_spark_version ' ] == '2' :
112
+ if self . _config [ 'oozie_spark_version ' ] == '2' :
102
113
properties ['oozie.action.sharelib.for.spark' ] = 'spark2'
103
114
104
115
# insert default queue selection
0 commit comments