Browse Source

AMBARI-20866.Distcp should take a single command rather than list of arguments to make it easier ot use.(padmapriyanitt)

padmapriyanitt 8 years ago
parent
commit
0ca0442de5

+ 14 - 1
contrib/views/wfmanager/src/main/resources/ui/app/components/distcp-action.js

@@ -32,6 +32,19 @@ export default Ember.Component.extend({
       this.set("actionModel.configuration.property", Ember.A([]));
     }
   }.on('init'),
+  distcpCommand : Ember.computed('actionModel.args', {
+    get(key){
+      return this.get('actionModel.args').mapBy('value').join(" ");
+    },
+    set(key, value){
+      this.get('actionModel.args').clear();
+      value.split(" ").forEach(arg => {
+        this.get('actionModel.args').pushObject({value:arg});
+      });
+      return this.get(key);
+    }
+  }),
+
   initialize : function(){
     this.on('fileSelected',function(fileName){
       this.set(this.get('filePathModel'), fileName);
@@ -53,7 +66,7 @@ export default Ember.Component.extend({
     },
     register (name, context){
       this.sendAction('register',name , context);
-    },
+    }
 
   }
 });

+ 6 - 1
contrib/views/wfmanager/src/main/resources/ui/app/templates/components/distcp-action.hbs

@@ -18,7 +18,12 @@
 <div class="panel panel-default">
   <div class="panel-heading">General</div>
   <div class="panel-body">
-    {{#arg-config args=actionModel.args register="register" title="arg"}}{{/arg-config}}
+    <div class="form-group">
+      <label for="distcp-command" class="control-label col-xs-2">Distcp Arguments</label>
+      <div class="col-xs-7">
+        {{textarea class="form-control query-text-area" value=distcpCommand name="distcp-command" placeholder="Example: -update hdfs://nn1:9820/source/first hdfs://nn1:9820/source/second hdfs://nn2:9820/target"}}
+      </div>
+    </div>
     <div class="form-group">
       <label for="inputPassword" class="control-label col-xs-2">Java opts</label>
       <div class="col-xs-7">