Skip to content

Commit ab5f709

Browse files
committed
Support Spark 2 for Oozie jobs
PNDA-4398
1 parent d6d9cb2 commit ab5f709

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -525,11 +525,17 @@ environment_zookeeper_port 2181
525525
environment_zookeeper_quorum cluster-cdh-mgr1
526526
````
527527

528-
## Spark Streamining Specific Variables ##
528+
## Spark Version Selection for Oozie and Spark Streaming ##
529+
Both Spark streaming and Oozie components can be configured to use either Spark1 or Spark2. This may be set by including `spark_version` in properties.json and setting it to `1` or `2`. It defaults to Spark1 if `spark_version` is not included.
530+
531+
````
532+
component_spark_version major version of spark to use. Set to '1' or '2'. Only applicable to HDP clusters
533+
````
534+
535+
## Spark Streaming Specific Variables ##
529536
The following varibles are only injected for Spark streaming components. They may be overridden in properties.json, for example to override `component_spark_version`, include `spark_version` in properties.json.
530537

531538
````
532-
component_spark_version major version of spark to use. Only applicable to HDP clusters, when using CDH PNDA does not support side-by-side Spark frameworks and whatever version is run by the spark-submit command will be used.
533539
component_spark_submit_args additional arguments to spark-submit
534540
(java only) component_main_jar the jar containing the job code
535541
(python only) component_main_py the python file containing the job code

api/src/main/resources/plugins/oozie.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ def create_component(self, staged_component_path, application_name, user_name, c
9797
properties['oozie.use.system.libpath'] = 'true'
9898
# platform shared libs e.g. hbase
9999
properties['oozie.libpath'] = '/pnda/deployment/platform'
100+
# For spark2 add a special setting to select spark2
101+
if 'component_spark_version' in properties and properties['component_spark_version'] == '2':
102+
properties['oozie.action.sharelib.for.spark'] = 'spark2'
100103

101104
# insert default queue selection
102105
ret, res = commands.getstatusoutput('sudo -u %s %s' % (properties['application_user'], self._environment['queue_policy']))

0 commit comments

Comments
 (0)