Răsfoiți Sursa

HUE-7755 [oozie] Adding Distcp arguments and properties

jdesjean 8 ani în urmă
părinte
comite
cde027861f

+ 2 - 0
apps/oozie/src/oozie/models2.py

@@ -3954,6 +3954,7 @@ class WorkflowBuilder():
     node = self._get_distcp_node(document.uuid, is_document_node=True)
 
     node['properties']['uuid'] = document.uuid
+    node['properties']['distcp_parameters'] = document.data_dict['snippets'][0]['properties'].get('distcp_parameters', [])
 
     return node
 
@@ -3974,6 +3975,7 @@ class WorkflowBuilder():
               "retry_interval": [],
               "job_properties": [],
               "prepares": [],
+              "distcp_parameters": [],
               "credentials": credentials,
               "sla": [{"value":False, "key":"enabled"}, {"value":"${nominal_time}", "key":"nominal-time"}, {"value":"", "key":"should-start"}, {"value":"${30 * MINUTES}", "key":"should-end"}, {"value":"", "key":"max-duration"}, {"value":"", "key":"alert-events"}, {"value":"", "key":"alert-contact"}, {"value":"", "key":"notification-msg"}, {"value":"", "key":"upstream-apps"}],
               "archives": []

+ 3 - 1
apps/oozie/src/oozie/templates/editor2/gen/workflow-distcp-document.xml.mako

@@ -32,7 +32,9 @@
             % if node['properties']['java_opts']:
               <java-opts>${ node['properties']['java_opts'] }</java-opts>
             % endif
-
+            % for argument in node['properties']['distcp_parameters']:
+              <arg>${ argument }</arg>
+            % endfor
             <arg>${ smart_path(node['properties']['source_path']) }</arg>
             <arg>${ smart_path(node['properties']['destination_path']) }</arg>
         </distcp>

+ 6 - 0
desktop/libs/notebook/src/notebook/templates/editor_components.mako

@@ -1535,6 +1535,12 @@ ${ sqlSyntaxDropdown.sqlSyntaxDropdown() }
           <input type="text" class="input-xxlarge filechooser-input" data-bind="value: properties().destination_path, valueUpdate: 'afterkeydown', filechooser: properties().destination_path, filechooserOptions: { linkMarkup: true, skipInitialPathIfEmpty: true, openOnFocus: true }" placeholder="${ _('Destination path, e.g. ${nameNode2}/path/to/output.txt') }"/>
         </div>
       </div>
+      <div class="control-group">
+        <label class="control-label">${_('Variables')}</label>
+        <div class="controls">
+          <!-- ko template: { if: typeof properties().distcp_parameters != 'undefined', name: 'property', data: { type: 'csv-hdfs-files', label: '${ _ko("Arguments") }', value: properties().distcp_parameters, title: '${ _ko("Arguments for the script") }', placeholder: '${ _ko("e.g. MAX=10, PATH=$PATH:/user/path") }' } } --><!-- /ko -->
+        </div>
+      </div>
       <!-- /ko -->
       <!-- ko if: type() == 'shell' -->
       <div class="control-group">