tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jeag...@apache.org
Subject git commit: TEZ-1490. dagid reported is incorrect in TezClient.java (jeagles)
Date Tue, 26 Aug 2014 04:18:35 GMT
Repository: tez
Updated Branches:
  refs/heads/master 5ae13686b -> f7151e194


TEZ-1490. dagid reported is incorrect in TezClient.java (jeagles)


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

Branch: refs/heads/master
Commit: f7151e1946908ad037069332f2e78e111e17ef64
Parents: 5ae1368
Author: Jonathan Eagles <jeagles@gmail.com>
Authored: Mon Aug 25 23:18:25 2014 -0500
Committer: Jonathan Eagles <jeagles@gmail.com>
Committed: Mon Aug 25 23:18:25 2014 -0500

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../java/org/apache/tez/client/TezClient.java   | 29 +++++++++++++-------
 2 files changed, 20 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/f7151e19/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 786a21e..2a21995 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -91,6 +91,7 @@ INCOMPATIBLE CHANGES
   TEZ-1472. Separate method calls for creating InputDataInformationEvent with
   serialized/unserialized payloads
   TEZ-1485. Disable node blacklisting and ATS in AM for local mode
+  TEZ-1490. dagid reported is incorrect in TezClient.java
 
 Release 0.4.0-incubating: 2014-04-05
 

http://git-wip-us.apache.org/repos/asf/tez/blob/f7151e19/tez-api/src/main/java/org/apache/tez/client/TezClient.java
----------------------------------------------------------------------
diff --git a/tez-api/src/main/java/org/apache/tez/client/TezClient.java b/tez-api/src/main/java/org/apache/tez/client/TezClient.java
index 4b1f221..cd753eb 100644
--- a/tez-api/src/main/java/org/apache/tez/client/TezClient.java
+++ b/tez-api/src/main/java/org/apache/tez/client/TezClient.java
@@ -717,25 +717,34 @@ public class TezClient {
 
   // DO NOT CHANGE THIS. This code is replicated from TezDAGID.java
   private static final char SEPARATOR = '_';
-  private static final String DAG = "dag";
-  private static final ThreadLocal<NumberFormat> idFormat = new ThreadLocal<NumberFormat>()
{
+  public static final String DAG = "dag";
+  static final ThreadLocal<NumberFormat> tezAppIdFormat = new ThreadLocal<NumberFormat>()
{
     @Override
     public NumberFormat initialValue() {
       NumberFormat fmt = NumberFormat.getInstance();
       fmt.setGroupingUsed(false);
-      fmt.setMinimumIntegerDigits(6);
+      fmt.setMinimumIntegerDigits(4);
+      return fmt;
+    }
+  };
+
+  static final ThreadLocal<NumberFormat> tezDagIdFormat = new ThreadLocal<NumberFormat>()
{
+    @Override
+    public NumberFormat initialValue() {
+      NumberFormat fmt = NumberFormat.getInstance();
+      fmt.setGroupingUsed(false);
+      fmt.setMinimumIntegerDigits(1);
       return fmt;
     }
   };
 
   // Used only for MapReduce compatibility code
-  private static String getDefaultTezDAGID(ApplicationId appId) {
+  private static String getDefaultTezDAGID(ApplicationId applicationId) {
      return (new StringBuilder(DAG)).append(SEPARATOR).
-                   append(appId.getClusterTimestamp()).
-                   append(SEPARATOR).
-                   append(appId.getId()).
-                   append(SEPARATOR).
-                   append(idFormat.get().format(1)).toString();
+         append(applicationId.getClusterTimestamp()).
+         append(SEPARATOR).
+         append(tezAppIdFormat.get().format(applicationId.getId())).
+         append(SEPARATOR).
+         append(tezDagIdFormat.get().format(1)).toString();
   }
-
 }


Mime
View raw message