hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From naganarasimha...@apache.org
Subject [25/50] [abbrv] hadoop git commit: YARN-8076. Support to specify application tags in distributed shell. Contributed by Weiwei Yang.
Date Mon, 02 Apr 2018 07:18:41 GMT
YARN-8076. Support to specify application tags in distributed shell. Contributed by Weiwei
Yang.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/431076f6
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/431076f6
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/431076f6

Branch: refs/heads/YARN-3409
Commit: 431076f63751f855ab6036ff85825a8552257b93
Parents: 3d185d6
Author: Sunil G <sunilg@apache.org>
Authored: Thu Mar 29 15:55:39 2018 +0530
Committer: Sunil G <sunilg@apache.org>
Committed: Thu Mar 29 15:55:39 2018 +0530

----------------------------------------------------------------------
 .../yarn/applications/distributedshell/Client.java   | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/431076f6/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/Client.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/Client.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/Client.java
index d6a753a..61879d0 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/Client.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/Client.java
@@ -230,6 +230,9 @@ public class Client {
   // Docker client configuration
   private String dockerClientConfig = null;
 
+  // Application tags
+  private Set<String> applicationTags = new HashSet<>();
+
   // Command line options
   private Options opts;
 
@@ -384,6 +387,7 @@ public class Client {
         "Placement specification. Please note, if this option is specified,"
             + " The \"num_containers\" option will be ignored. All requested"
             + " containers will be of type GUARANTEED" );
+    opts.addOption("application_tags", true, "Application tags.");
   }
 
   /**
@@ -604,6 +608,14 @@ public class Client {
     if (cliParser.hasOption("docker_client_config")) {
       dockerClientConfig = cliParser.getOptionValue("docker_client_config");
     }
+
+    if (cliParser.hasOption("application_tags")) {
+      String applicationTagsStr = cliParser.getOptionValue("application_tags");
+      String[] appTags = applicationTagsStr.split(",");
+      for (String appTag : appTags) {
+        this.applicationTags.add(appTag.trim());
+      }
+    }
     return true;
   }
 
@@ -729,6 +741,9 @@ public class Client {
     }
 
     Set<String> tags = new HashSet<String>();
+    if (applicationTags != null) {
+      tags.addAll(applicationTags);
+    }
     if (flowName != null) {
       tags.add(TimelineUtils.generateFlowNameTag(flowName));
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message