tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ss...@apache.org
Subject git commit: TEZ-513. Allow only [A-Za-z0.9_] charactesr in the Tez*Context unique identifiers. (sseth)
Date Fri, 27 Sep 2013 04:19:49 GMT
Updated Branches:
  refs/heads/master 06c7e1da3 -> fcbf0ddaf


TEZ-513. Allow only [A-Za-z0.9_] charactesr in the Tez*Context unique
identifiers. (sseth)


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

Branch: refs/heads/master
Commit: fcbf0ddaffde8379135bf00fd1c165a51b367297
Parents: 06c7e1d
Author: Siddharth Seth <sseth@apache.org>
Authored: Thu Sep 26 21:19:16 2013 -0700
Committer: Siddharth Seth <sseth@apache.org>
Committed: Thu Sep 26 21:19:16 2013 -0700

----------------------------------------------------------------------
 .../apache/tez/runtime/api/impl/TezInputContextImpl.java |  3 ---
 .../tez/runtime/api/impl/TezOutputContextImpl.java       |  3 ---
 .../tez/runtime/api/impl/TezProcessorContextImpl.java    |  3 ---
 .../apache/tez/runtime/api/impl/TezTaskContextImpl.java  | 11 ++++++++++-
 4 files changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/fcbf0dda/tez-runtime-internals/src/main/java/org/apache/tez/runtime/api/impl/TezInputContextImpl.java
----------------------------------------------------------------------
diff --git a/tez-runtime-internals/src/main/java/org/apache/tez/runtime/api/impl/TezInputContextImpl.java
b/tez-runtime-internals/src/main/java/org/apache/tez/runtime/api/impl/TezInputContextImpl.java
index f9d1b1a..69d1ade 100644
--- a/tez-runtime-internals/src/main/java/org/apache/tez/runtime/api/impl/TezInputContextImpl.java
+++ b/tez-runtime-internals/src/main/java/org/apache/tez/runtime/api/impl/TezInputContextImpl.java
@@ -54,9 +54,6 @@ public class TezInputContextImpl extends TezTaskContextImpl
     this.sourceInfo = new EventMetaData(
         EventProducerConsumerType.INPUT, taskVertexName, sourceVertexName,
         taskAttemptID);
-    this.uniqueIdentifier = String.format("%s_%s_%06d_%02d_%s", taskAttemptID
-        .getTaskID().getVertexID().getDAGId().toString(), taskVertexName,
-        getTaskIndex(), getTaskAttemptNumber(), sourceVertexName);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/fcbf0dda/tez-runtime-internals/src/main/java/org/apache/tez/runtime/api/impl/TezOutputContextImpl.java
----------------------------------------------------------------------
diff --git a/tez-runtime-internals/src/main/java/org/apache/tez/runtime/api/impl/TezOutputContextImpl.java
b/tez-runtime-internals/src/main/java/org/apache/tez/runtime/api/impl/TezOutputContextImpl.java
index e97f1db..86014df 100644
--- a/tez-runtime-internals/src/main/java/org/apache/tez/runtime/api/impl/TezOutputContextImpl.java
+++ b/tez-runtime-internals/src/main/java/org/apache/tez/runtime/api/impl/TezOutputContextImpl.java
@@ -54,9 +54,6 @@ public class TezOutputContextImpl extends TezTaskContextImpl
     this.destinationVertexName = destinationVertexName;
     this.sourceInfo = new EventMetaData(EventProducerConsumerType.OUTPUT,
         taskVertexName, destinationVertexName, taskAttemptID);
-    this.uniqueIdentifier = String.format("%s_%s_%06d_%02d_%s", taskAttemptID
-        .getTaskID().getVertexID().getDAGId().toString(), taskVertexName,
-        getTaskIndex(), getTaskAttemptNumber(), destinationVertexName);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/fcbf0dda/tez-runtime-internals/src/main/java/org/apache/tez/runtime/api/impl/TezProcessorContextImpl.java
----------------------------------------------------------------------
diff --git a/tez-runtime-internals/src/main/java/org/apache/tez/runtime/api/impl/TezProcessorContextImpl.java
b/tez-runtime-internals/src/main/java/org/apache/tez/runtime/api/impl/TezProcessorContextImpl.java
index 752376f..e307b33 100644
--- a/tez-runtime-internals/src/main/java/org/apache/tez/runtime/api/impl/TezProcessorContextImpl.java
+++ b/tez-runtime-internals/src/main/java/org/apache/tez/runtime/api/impl/TezProcessorContextImpl.java
@@ -50,9 +50,6 @@ public class TezProcessorContextImpl extends TezTaskContextImpl
     this.userPayload = userPayload;
     this.sourceInfo = new EventMetaData(EventProducerConsumerType.PROCESSOR,
         taskVertexName, "", taskAttemptID);
-    this.uniqueIdentifier = String.format("%s_%s_%06d_%02d", taskAttemptID
-        .getTaskID().getVertexID().getDAGId().toString(), taskVertexName,
-        getTaskIndex(), getTaskAttemptNumber());
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/fcbf0dda/tez-runtime-internals/src/main/java/org/apache/tez/runtime/api/impl/TezTaskContextImpl.java
----------------------------------------------------------------------
diff --git a/tez-runtime-internals/src/main/java/org/apache/tez/runtime/api/impl/TezTaskContextImpl.java
b/tez-runtime-internals/src/main/java/org/apache/tez/runtime/api/impl/TezTaskContextImpl.java
index b3dae4e..03eb895 100644
--- a/tez-runtime-internals/src/main/java/org/apache/tez/runtime/api/impl/TezTaskContextImpl.java
+++ b/tez-runtime-internals/src/main/java/org/apache/tez/runtime/api/impl/TezTaskContextImpl.java
@@ -21,6 +21,7 @@ package org.apache.tez.runtime.api.impl;
 import java.nio.ByteBuffer;
 import java.util.Arrays;
 import java.util.Map;
+import java.util.concurrent.atomic.AtomicInteger;
 
 import org.apache.hadoop.classification.InterfaceAudience.Private;
 import org.apache.hadoop.conf.Configuration;
@@ -35,12 +36,14 @@ import org.apache.tez.runtime.api.TezTaskContext;
 
 public abstract class TezTaskContextImpl implements TezTaskContext {
 
+  private static final AtomicInteger ID_GEN = new AtomicInteger(10000);
+  
   private final Configuration conf;
   protected final String taskVertexName;
   protected final TezTaskAttemptID taskAttemptID;
   private final TezCounters counters;
   private String[] workDirs;
-  protected String uniqueIdentifier;
+  private String uniqueIdentifier;
   protected final RuntimeTask runtimeTask;
   protected final TezUmbilical tezUmbilical;
   private final Map<String, ByteBuffer> serviceConsumerMetadata;
@@ -66,6 +69,8 @@ public abstract class TezTaskContextImpl implements TezTaskContext {
     // TODO NEWTEZ at some point dag attempt should not map to app attempt
     this.appAttemptNumber = appAttemptNumber;
     this.auxServiceEnv = auxServiceEnv;
+    this.uniqueIdentifier = String.format("%s_%05d", taskAttemptID.toString(),
+        generateId());
   }
 
   @Override
@@ -145,4 +150,8 @@ public abstract class TezTaskContextImpl implements TezTaskContext {
     }
     tezUmbilical.signalFatalError(taskAttemptID, diagnostics, sourceInfo);
   }
+  
+  private int generateId() {
+    return ID_GEN.incrementAndGet();
+  }
 }


Mime
View raw message