瀏覽代碼

[spark] Support adding files on batch jar

Romain Rigaux 10 年之前
父節點
當前提交
4cebad9

+ 1 - 1
desktop/libs/notebook/src/notebook/connectors/spark_batch.py

@@ -39,7 +39,7 @@ class SparkBatchApi(Api):
         'className': snippet['properties'].get('class'),
         'args': snippet['properties'].get('arguments'),
         'pyFiles': snippet['properties'].get('py_file'),
-        # files
+        'files': snippet['properties'].get('files'),
         # driverMemory
         # driverCores
         # executorMemory

+ 1 - 0
desktop/libs/notebook/src/notebook/static/notebook/js/notebook.ko.js

@@ -114,6 +114,7 @@
       properties['numExecutors'] = '';
       properties['queue'] = '';
       properties['archives'] = [];
+      properties['files'] = [];
     }
 
     if (snippetType == 'jar') {

+ 3 - 3
desktop/libs/notebook/src/notebook/templates/editor_components.mako

@@ -471,9 +471,9 @@ ${ require.config() }
         <!-- ko template: { if: typeof properties().executorCores != 'undefined', name: 'property', data: { type: 'number', label: '${ _('Executor Cores') }', value: properties().executorCores, title: '${ _('Number of cores per executor (Default: 1)') }' }} --><!-- /ko -->
         <!-- ko template: { if: typeof properties().numExecutors != 'undefined', name: 'property', data: { type: 'number', label: '${ _('Executors') }', value: properties().numExecutors, title: '${ _('Number of executors to launch (Default: 2)') }' }} --><!-- /ko -->
         <!-- ko template: { if: typeof properties().queue != 'undefined', name: 'property', data: { type: 'string', label: '${ _('Queue') }', value: properties().queue, title: '${ _('The YARN queue to submit to (Default: default)') }' }} --><!-- /ko -->
-        <!-- ko template: { if: typeof properties().archives != 'undefined', name: 'property', data: { type: 'csv-hdfs-files', label: '${ _('Archives') }', value: properties().archives, title: '${ _('The YARN queue to submit to (Default: default)') }', placeholder: '${ _('e.g. archive.dat') }'}} --><!-- /ko -->
-        <!-- ko template: { if: typeof properties().files != 'undefined', name: 'property', data: { type: 'csv-hdfs-files', label: '${ _('Files') }', value: properties().files, title: '${ _('The YARN queue to submit to (Default: default)') }', placeholder: '${ _('e.g. file.dat') }'}} --><!-- /ko -->
-        <!-- ko template: { if: typeof properties().settings != 'undefined', name: 'property', data: { type: 'csv', label: '${ _('Settings') }', value: properties().settings, title: '${ _('The YARN queue to submit to (Default: default)') }', placeholder: '${ _('e.g. foo') }'}} --><!-- /ko -->
+        <!-- ko template: { if: typeof properties().archives != 'undefined', name: 'property', data: { type: 'csv-hdfs-files', label: '${ _('Archives') }', value: properties().archives, title: '${ _('Archives to be extracted into the working directory of each executor (YARN only)') }', placeholder: '${ _('e.g. file.zip') }'}} --><!-- /ko -->
+        <!-- ko template: { if: typeof properties().files != 'undefined', name: 'property', data: { type: 'csv-hdfs-files', label: '${ _('Files') }', value: properties().files, title: '${ _('Files to be placed in the working directory of each executor.') }', placeholder: '${ _('e.g. file.data') }'}} --><!-- /ko -->
+        <!-- ko template: { if: typeof properties().settings != 'undefined', name: 'property', data: { type: 'csv', label: '${ _('Settings') }', value: properties().settings, title: '${ _('Spark properties') }', placeholder: '${ _('e.g. foo=value') }'}} --><!-- /ko -->
 
         <!-- ko template: { if: typeof properties().parameters != 'undefined', name: 'property', data: { type: 'csv', label: '${ _('Parameters') }', value: properties().parameters, title: '${ _('Names and values of Pig parameters and options') }', placeholder: '${ _('e.g. input /user/data, -param input=/user/data, -optimizer_off SplitFilter, -verbose') }'}} --><!-- /ko -->
         <!-- ko template: { if: typeof properties().hadoopProperties != 'undefined', name: 'property', data: { type: 'csv', label: '${ _('Hadoop properties') }', value: properties().hadoopProperties, title: '${ _('Name and values of Hadoop properties') }', placeholder: '${ _('e.g. mapred.job.queue.name=production, mapred.map.tasks.speculative.execution=false') }'}} --><!-- /ko -->