tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ss...@apache.org
Subject git commit: TEZ-1427. Change remaining classes that are using byte[] to UserPayload. (sseth)
Date Fri, 15 Aug 2014 20:59:40 GMT
Repository: tez
Updated Branches:
  refs/heads/master cbc385de2 -> f2b155dbb


TEZ-1427. Change remaining classes that are using byte[] to UserPayload.
(sseth)


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

Branch: refs/heads/master
Commit: f2b155dbbf638d83e3b79a865fde40e6dba18aa1
Parents: cbc385d
Author: Siddharth Seth <sseth@apache.org>
Authored: Fri Aug 15 13:59:25 2014 -0700
Committer: Siddharth Seth <sseth@apache.org>
Committed: Fri Aug 15 13:59:25 2014 -0700

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../tez/dag/api/EdgeManagerPluginContext.java   |  4 +--
 .../org/apache/tez/dag/app/dag/impl/Edge.java   |  4 +--
 .../org/apache/tez/client/TestLocalMode.java    |  3 +-
 .../tez/dag/app/dag/impl/TestVertexImpl.java    |  4 +--
 .../org/apache/tez/test/EdgeManagerForTest.java |  5 +--
 .../vertexmanager/ShuffleVertexManager.java     | 18 +++++-----
 .../conf/OnFileSortedOutputConfigurer.java      | 12 +++----
 .../conf/OnFileUnorderedKVOutputConfigurer.java | 12 +++----
 ...eUnorderedPartitionedKVOutputConfigurer.java | 12 +++----
 .../OrderedPartitionedKVEdgeConfigurer.java     |  4 +--
 .../conf/ShuffledMergedInputConfigurer.java     | 13 ++++----
 .../ShuffledUnorderedKVInputConfigurer.java     | 13 ++++----
 .../UnorderedPartitionedKVEdgeConfigurer.java   |  4 +--
 .../UnorderedUnpartitionedKVEdgeConfigurer.java |  4 +--
 .../library/processor/SleepProcessor.java       |  6 ++--
 .../vertexmanager/TestShuffleVertexManager.java |  4 +--
 .../conf/TestOnFileSortedOutputConfigurer.java  | 13 +++-----
 .../TestOnFileUnorderedKVOutputConfigurer.java  |  7 ++--
 ...eUnorderedPartitionedKVOutputConfigurer.java | 10 ++----
 .../TestOrderedPartitionedKVEdgeConfigurer.java | 35 ++++++--------------
 .../conf/TestShuffledMergedInputConfigurer.java |  9 ++---
 .../TestShuffledUnorderedKVInputConfigurer.java |  7 ++--
 ...estUnorderedPartitionedKVEdgeConfigurer.java | 21 ++++--------
 ...tUnorderedUnpartitionedKVEdgeConfigurer.java | 20 ++++-------
 .../apache/tez/mapreduce/TestMRRJobsDAGApi.java |  8 ++---
 26 files changed, 103 insertions(+), 150 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/f2b155db/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 59e6e2c..38f5696 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -62,6 +62,7 @@ INCOMPATIBLE CHANGES
   TEZ-1388. mvn site is slow and generates errors
   TEZ-1432. Rename property to cancel delegation tokens on app completion (tez.am.am.complete.cancel.delegation.tokens)
   TEZ-1320. Remove getApplicationId from DAGClient
+  TEZ-1427. Change remaining classes that are using byte[] to UserPayload
 
 Release 0.4.0-incubating: 2014-04-05
 

http://git-wip-us.apache.org/repos/asf/tez/blob/f2b155db/tez-api/src/main/java/org/apache/tez/dag/api/EdgeManagerPluginContext.java
----------------------------------------------------------------------
diff --git a/tez-api/src/main/java/org/apache/tez/dag/api/EdgeManagerPluginContext.java b/tez-api/src/main/java/org/apache/tez/dag/api/EdgeManagerPluginContext.java
index fbeebba..79f685d 100644
--- a/tez-api/src/main/java/org/apache/tez/dag/api/EdgeManagerPluginContext.java
+++ b/tez-api/src/main/java/org/apache/tez/dag/api/EdgeManagerPluginContext.java
@@ -32,9 +32,9 @@ public interface EdgeManagerPluginContext {
   
   /**
    * Returns the payload specified by the user for the edge.
-   * @return the payload specified by the user
+   * @return the {@link org.apache.tez.dag.api.UserPayload} specified by the user
    */
-  public byte[] getUserPayload();
+  public UserPayload getUserPayload();
   
   /**
    * Returns the source vertex name 

http://git-wip-us.apache.org/repos/asf/tez/blob/f2b155db/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/Edge.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/Edge.java b/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/Edge.java
index 451a938..0d26958 100644
--- a/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/Edge.java
+++ b/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/Edge.java
@@ -63,8 +63,8 @@ public class Edge {
     }
 
     @Override
-    public byte[] getUserPayload() {
-      return userPayload.getPayload();
+    public UserPayload getUserPayload() {
+      return userPayload;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/tez/blob/f2b155db/tez-dag/src/test/java/org/apache/tez/client/TestLocalMode.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/test/java/org/apache/tez/client/TestLocalMode.java b/tez-dag/src/test/java/org/apache/tez/client/TestLocalMode.java
index f0d84e6..6e6fa01 100644
--- a/tez-dag/src/test/java/org/apache/tez/client/TestLocalMode.java
+++ b/tez-dag/src/test/java/org/apache/tez/client/TestLocalMode.java
@@ -30,7 +30,6 @@ import org.apache.tez.dag.api.ProcessorDescriptor;
 import org.apache.tez.dag.api.TezConfiguration;
 import org.apache.tez.dag.api.TezConstants;
 import org.apache.tez.dag.api.TezException;
-import org.apache.tez.dag.api.UserPayload;
 import org.apache.tez.dag.api.Vertex;
 import org.apache.tez.dag.api.client.DAGClient;
 import org.apache.tez.dag.api.client.DAGStatus;
@@ -185,7 +184,7 @@ public class TestLocalMode {
   private DAG createSimpleDAG(String dagName, String processorName) {
     DAG dag = new DAG(dagName).addVertex(new Vertex("Sleep", new ProcessorDescriptor(
         processorName).setUserPayload(
-        new UserPayload(new SleepProcessor.SleepProcessorConfig(1).toUserPayload())), 1));
+        new SleepProcessor.SleepProcessorConfig(1).toUserPayload()), 1));
     return dag;
 
   }

http://git-wip-us.apache.org/repos/asf/tez/blob/f2b155db/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestVertexImpl.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestVertexImpl.java b/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestVertexImpl.java
index ebefe91..8fee66b 100644
--- a/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestVertexImpl.java
+++ b/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestVertexImpl.java
@@ -1922,7 +1922,7 @@ public class TestVertexImpl {
     EdgeManagerPlugin em = edge.getEdgeManager();
     EdgeManagerForTest originalEm = (EdgeManagerForTest) em;
     Assert.assertTrue(Arrays.equals(edgePayload, originalEm.getEdgeManagerContext()
-        .getUserPayload()));
+        .getUserPayload().getPayload()));
 
     UserPayload userPayload = new UserPayload(new String("foo").getBytes());
     EdgeManagerPluginDescriptor edgeManagerDescriptor =
@@ -1947,7 +1947,7 @@ public class TestVertexImpl {
 
     // Ensure initialize() is called with the correct payload
     Assert.assertTrue(Arrays.equals(userPayload.getPayload(),
-        ((EdgeManagerForTest) modifiedEdgeManager).getUserPayload()));
+        ((EdgeManagerForTest) modifiedEdgeManager).getUserPayload().getPayload()));
   }
 
   @SuppressWarnings("unchecked")

http://git-wip-us.apache.org/repos/asf/tez/blob/f2b155db/tez-dag/src/test/java/org/apache/tez/test/EdgeManagerForTest.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/test/java/org/apache/tez/test/EdgeManagerForTest.java b/tez-dag/src/test/java/org/apache/tez/test/EdgeManagerForTest.java
index ab227a8..09f9a20 100644
--- a/tez-dag/src/test/java/org/apache/tez/test/EdgeManagerForTest.java
+++ b/tez-dag/src/test/java/org/apache/tez/test/EdgeManagerForTest.java
@@ -23,12 +23,13 @@ import java.util.Map;
 
 import org.apache.tez.dag.api.EdgeManagerPlugin;
 import org.apache.tez.dag.api.EdgeManagerPluginContext;
+import org.apache.tez.dag.api.UserPayload;
 import org.apache.tez.runtime.api.events.DataMovementEvent;
 import org.apache.tez.runtime.api.events.InputReadErrorEvent;
 
 public class EdgeManagerForTest extends EdgeManagerPlugin {
 
-  private byte[] userPayload;
+  private UserPayload userPayload;
 
   public EdgeManagerForTest(EdgeManagerPluginContext context) {
     super(context);
@@ -38,7 +39,7 @@ public class EdgeManagerForTest extends EdgeManagerPlugin {
     return getContext();
   }
 
-  public byte[] getUserPayload() {
+  public UserPayload getUserPayload() {
     return userPayload;
   }
 

http://git-wip-us.apache.org/repos/asf/tez/blob/f2b155db/tez-runtime-library/src/main/java/org/apache/tez/dag/library/vertexmanager/ShuffleVertexManager.java
----------------------------------------------------------------------
diff --git a/tez-runtime-library/src/main/java/org/apache/tez/dag/library/vertexmanager/ShuffleVertexManager.java b/tez-runtime-library/src/main/java/org/apache/tez/dag/library/vertexmanager/ShuffleVertexManager.java
index 33b93b2..ed6ae5c 100644
--- a/tez-runtime-library/src/main/java/org/apache/tez/dag/library/vertexmanager/ShuffleVertexManager.java
+++ b/tez-runtime-library/src/main/java/org/apache/tez/dag/library/vertexmanager/ShuffleVertexManager.java
@@ -144,9 +144,9 @@ public class ShuffleVertexManager extends VertexManagerPlugin {
     @Override
     public void initialize() {
       // Nothing to do. This class isn't currently designed to be used at the DAG API level.
-      byte[] userPayload = getContext().getUserPayload();
-      if (userPayload == null
-        || userPayload.length == 0) {
+      UserPayload userPayload = getContext().getUserPayload();
+      if (userPayload == null || userPayload.getPayload() == null ||
+          userPayload.getPayload().length == 0) {
         throw new RuntimeException("Could not initialize CustomShuffleEdgeManager"
             + " from provided user payload");
       }
@@ -275,20 +275,20 @@ public class ShuffleVertexManager extends VertexManagerPlugin {
       this.numSourceTasks = numSourceTasks;
     }
 
-    public byte[] toUserPayload() {
-      return ShuffleEdgeManagerConfigPayloadProto.newBuilder()
+    public UserPayload toUserPayload() {
+      return new UserPayload(ShuffleEdgeManagerConfigPayloadProto.newBuilder()
           .setNumSourceTaskOutputs(numSourceTaskOutputs)
           .setNumDestinationTasks(numDestinationTasks)
           .setBasePartitionRange(basePartitionRange)
           .setRemainderRangeForLastShuffler(remainderRangeForLastShuffler)
           .setNumSourceTasks(numSourceTasks)
-          .build().toByteArray();
+          .build().toByteArray());
     }
 
     public static CustomShuffleEdgeManagerConfig fromUserPayload(
-        byte[] userPayload) throws InvalidProtocolBufferException {
+        UserPayload payload) throws InvalidProtocolBufferException {
       ShuffleEdgeManagerConfigPayloadProto proto =
-          ShuffleEdgeManagerConfigPayloadProto.parseFrom(userPayload);
+          ShuffleEdgeManagerConfigPayloadProto.parseFrom(payload.getPayload());
       return new CustomShuffleEdgeManagerConfig(
           proto.getNumSourceTaskOutputs(),
           proto.getNumDestinationTasks(),
@@ -437,7 +437,7 @@ public class ShuffleVertexManager extends VertexManagerPlugin {
                     remainderRangeForLastShuffler : basePartitionRange));
         EdgeManagerPluginDescriptor edgeManagerDescriptor =
             new EdgeManagerPluginDescriptor(CustomShuffleEdgeManager.class.getName());
-        edgeManagerDescriptor.setUserPayload(new UserPayload(edgeManagerConfig.toUserPayload()));
+        edgeManagerDescriptor.setUserPayload(edgeManagerConfig.toUserPayload());
         edgeManagers.put(vertex, edgeManagerDescriptor);
       }
       

http://git-wip-us.apache.org/repos/asf/tez/blob/f2b155db/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/OnFileSortedOutputConfigurer.java
----------------------------------------------------------------------
diff --git a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/OnFileSortedOutputConfigurer.java b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/OnFileSortedOutputConfigurer.java
index 09ffffb..94de0b1 100644
--- a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/OnFileSortedOutputConfigurer.java
+++ b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/OnFileSortedOutputConfigurer.java
@@ -169,21 +169,21 @@ public class OnFileSortedOutputConfigurer {
   }
 
   /**
-   * Get a byte array representation of the configuration
-   * @return a byte array which can be used as the payload
+   * Get a UserPayload representation of the Configuration
+   * @return a {@link org.apache.tez.dag.api.UserPayload} instance
    */
-  public byte[] toByteArray() {
+  public UserPayload toUserPayload() {
     try {
-      return TezUtils.createUserPayloadFromConf(conf).getPayload();
+      return TezUtils.createUserPayloadFromConf(conf);
     } catch (IOException e) {
       throw new RuntimeException(e);
     }
   }
 
   @InterfaceAudience.Private
-  public void fromByteArray(byte[] payload) {
+  public void fromUserPayload(UserPayload payload) {
     try {
-      this.conf = TezUtils.createConfFromUserPayload(new UserPayload(payload));
+      this.conf = TezUtils.createConfFromUserPayload(payload);
     } catch (IOException e) {
       throw new RuntimeException(e);
     }

http://git-wip-us.apache.org/repos/asf/tez/blob/f2b155db/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/OnFileUnorderedKVOutputConfigurer.java
----------------------------------------------------------------------
diff --git a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/OnFileUnorderedKVOutputConfigurer.java b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/OnFileUnorderedKVOutputConfigurer.java
index 0b2ce15..7bfc0cc 100644
--- a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/OnFileUnorderedKVOutputConfigurer.java
+++ b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/OnFileUnorderedKVOutputConfigurer.java
@@ -105,21 +105,21 @@ public class OnFileUnorderedKVOutputConfigurer {
   }
 
   /**
-   * Get a byte array representation of the configuration
-   * @return a byte array which can be used as the payload
+   * Get a UserPayload representation of the Configuration
+   * @return a {@link org.apache.tez.dag.api.UserPayload} instance
    */
-  public byte[] toByteArray() {
+  public UserPayload toUserPayload() {
     try {
-      return TezUtils.createUserPayloadFromConf(conf).getPayload();
+      return TezUtils.createUserPayloadFromConf(conf);
     } catch (IOException e) {
       throw new RuntimeException(e);
     }
   }
 
   @InterfaceAudience.Private
-  public void fromByteArray(byte[] payload) {
+  public void fromUserPayload(UserPayload payload) {
     try {
-      this.conf = TezUtils.createConfFromUserPayload(new UserPayload(payload));
+      this.conf = TezUtils.createConfFromUserPayload(payload);
     } catch (IOException e) {
       throw new RuntimeException(e);
     }

http://git-wip-us.apache.org/repos/asf/tez/blob/f2b155db/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/OnFileUnorderedPartitionedKVOutputConfigurer.java
----------------------------------------------------------------------
diff --git a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/OnFileUnorderedPartitionedKVOutputConfigurer.java b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/OnFileUnorderedPartitionedKVOutputConfigurer.java
index d86c76b..664f346 100644
--- a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/OnFileUnorderedPartitionedKVOutputConfigurer.java
+++ b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/OnFileUnorderedPartitionedKVOutputConfigurer.java
@@ -119,21 +119,21 @@ public class OnFileUnorderedPartitionedKVOutputConfigurer {
   }
 
   /**
-   * Get a byte array representation of the configuration
-   * @return a byte array which can be used as the payload
+   * Get a UserPayload representation of the Configuration
+   * @return a {@link org.apache.tez.dag.api.UserPayload} instance
    */
-  public byte[] toByteArray() {
+  public UserPayload toUserPayload() {
     try {
-      return TezUtils.createUserPayloadFromConf(conf).getPayload();
+      return TezUtils.createUserPayloadFromConf(conf);
     } catch (IOException e) {
       throw new RuntimeException(e);
     }
   }
 
   @InterfaceAudience.Private
-  public void fromByteArray(byte[] payload) {
+  public void fromUserPayload(UserPayload payload) {
     try {
-      this.conf = TezUtils.createConfFromUserPayload(new UserPayload(payload));
+      this.conf = TezUtils.createConfFromUserPayload(payload);
     } catch (IOException e) {
       throw new RuntimeException(e);
     }

http://git-wip-us.apache.org/repos/asf/tez/blob/f2b155db/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/OrderedPartitionedKVEdgeConfigurer.java
----------------------------------------------------------------------
diff --git a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/OrderedPartitionedKVEdgeConfigurer.java b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/OrderedPartitionedKVEdgeConfigurer.java
index f0d06af..e3a58b9 100644
--- a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/OrderedPartitionedKVEdgeConfigurer.java
+++ b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/OrderedPartitionedKVEdgeConfigurer.java
@@ -89,7 +89,7 @@ public class OrderedPartitionedKVEdgeConfigurer extends HadoopKeyValuesBasedBase
 
   @Override
   public UserPayload getOutputPayload() {
-    return new UserPayload(outputConf.toByteArray());
+    return outputConf.toUserPayload();
   }
 
   @Override
@@ -99,7 +99,7 @@ public class OrderedPartitionedKVEdgeConfigurer extends HadoopKeyValuesBasedBase
 
   @Override
   public UserPayload getInputPayload() {
-    return new UserPayload(inputConf.toByteArray());
+    return inputConf.toUserPayload();
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/tez/blob/f2b155db/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/ShuffledMergedInputConfigurer.java
----------------------------------------------------------------------
diff --git a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/ShuffledMergedInputConfigurer.java b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/ShuffledMergedInputConfigurer.java
index 3320c87..4a1a8af 100644
--- a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/ShuffledMergedInputConfigurer.java
+++ b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/ShuffledMergedInputConfigurer.java
@@ -239,20 +239,21 @@ public class ShuffledMergedInputConfigurer {
   }
 
   /**
-   * Get a byte array representation of the configuration
-   * @return a byte array which can be used as the payload
+   * Get a UserPayload representation of the Configuration
+   * @return a {@link org.apache.tez.dag.api.UserPayload} instance
    */
-  public byte[] toByteArray() {
+  public UserPayload toUserPayload() {
     try {
-      return TezUtils.createUserPayloadFromConf(conf).getPayload();
+      return TezUtils.createUserPayloadFromConf(conf);
     } catch (IOException e) {
       throw new RuntimeException(e);
     }
   }
 
-  public void fromByteArray(byte[] payload) {
+  @InterfaceAudience.Private
+  public void fromUserPayload(UserPayload payload) {
     try {
-      this.conf = TezUtils.createConfFromUserPayload(new UserPayload(payload));
+      this.conf = TezUtils.createConfFromUserPayload(payload);
     } catch (IOException e) {
       throw new RuntimeException(e);
     }

http://git-wip-us.apache.org/repos/asf/tez/blob/f2b155db/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/ShuffledUnorderedKVInputConfigurer.java
----------------------------------------------------------------------
diff --git a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/ShuffledUnorderedKVInputConfigurer.java b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/ShuffledUnorderedKVInputConfigurer.java
index 8b99c17..ad57ed2 100644
--- a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/ShuffledUnorderedKVInputConfigurer.java
+++ b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/ShuffledUnorderedKVInputConfigurer.java
@@ -159,20 +159,21 @@ public class ShuffledUnorderedKVInputConfigurer {
   }
 
   /**
-   * Get a byte array representation of the configuration
-   * @return a byte array which can be used as the payload
+   * Get a UserPayload representation of the Configuration
+   * @return a {@link org.apache.tez.dag.api.UserPayload} instance
    */
-  public byte[] toByteArray() {
+  public UserPayload toUserPayload() {
     try {
-      return TezUtils.createUserPayloadFromConf(conf).getPayload();
+      return TezUtils.createUserPayloadFromConf(conf);
     } catch (IOException e) {
       throw new RuntimeException(e);
     }
   }
 
-  public void fromByteArray(byte[] payload) {
+  @InterfaceAudience.Private
+  public void fromUserPayload(UserPayload payload) {
     try {
-      this.conf = TezUtils.createConfFromUserPayload(new UserPayload(payload));
+      this.conf = TezUtils.createConfFromUserPayload(payload);
     } catch (IOException e) {
       throw new RuntimeException(e);
     }

http://git-wip-us.apache.org/repos/asf/tez/blob/f2b155db/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/UnorderedPartitionedKVEdgeConfigurer.java
----------------------------------------------------------------------
diff --git a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/UnorderedPartitionedKVEdgeConfigurer.java b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/UnorderedPartitionedKVEdgeConfigurer.java
index 356f082..ef93d9e 100644
--- a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/UnorderedPartitionedKVEdgeConfigurer.java
+++ b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/UnorderedPartitionedKVEdgeConfigurer.java
@@ -93,7 +93,7 @@ public class UnorderedPartitionedKVEdgeConfigurer extends HadoopKeyValuesBasedBa
 
   @Override
   public UserPayload getOutputPayload() {
-    return new UserPayload(outputConf.toByteArray());
+    return outputConf.toUserPayload();
   }
 
   @Override
@@ -103,7 +103,7 @@ public class UnorderedPartitionedKVEdgeConfigurer extends HadoopKeyValuesBasedBa
 
   @Override
   public UserPayload getInputPayload() {
-    return new UserPayload(inputConf.toByteArray());
+    return inputConf.toUserPayload();
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/tez/blob/f2b155db/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/UnorderedUnpartitionedKVEdgeConfigurer.java
----------------------------------------------------------------------
diff --git a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/UnorderedUnpartitionedKVEdgeConfigurer.java b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/UnorderedUnpartitionedKVEdgeConfigurer.java
index 182b9f7..c10e57a 100644
--- a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/UnorderedUnpartitionedKVEdgeConfigurer.java
+++ b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/conf/UnorderedUnpartitionedKVEdgeConfigurer.java
@@ -69,7 +69,7 @@ public class UnorderedUnpartitionedKVEdgeConfigurer extends HadoopKeyValuesBased
 
   @Override
   public UserPayload getOutputPayload() {
-    return new UserPayload(outputConf.toByteArray());
+    return outputConf.toUserPayload();
   }
 
   @Override
@@ -79,7 +79,7 @@ public class UnorderedUnpartitionedKVEdgeConfigurer extends HadoopKeyValuesBased
 
   @Override
   public UserPayload getInputPayload() {
-    return new UserPayload(inputConf.toByteArray());
+    return inputConf.toUserPayload();
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/tez/blob/f2b155db/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/processor/SleepProcessor.java
----------------------------------------------------------------------
diff --git a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/processor/SleepProcessor.java b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/processor/SleepProcessor.java
index 6d58a12..e14342b 100644
--- a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/processor/SleepProcessor.java
+++ b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/processor/SleepProcessor.java
@@ -110,8 +110,8 @@ public class SleepProcessor extends AbstractLogicalIOProcessor {
       this.timeToSleepMS = timeToSleepMS;
     }
 
-    public byte[] toUserPayload() {
-      return Integer.toString(timeToSleepMS).getBytes();
+    public UserPayload toUserPayload() {
+      return new UserPayload(Integer.toString(timeToSleepMS).getBytes());
     }
 
     public void fromUserPayload(UserPayload userPayload) {
@@ -123,4 +123,4 @@ public class SleepProcessor extends AbstractLogicalIOProcessor {
     }
   }
 
-}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tez/blob/f2b155db/tez-runtime-library/src/test/java/org/apache/tez/dag/library/vertexmanager/TestShuffleVertexManager.java
----------------------------------------------------------------------
diff --git a/tez-runtime-library/src/test/java/org/apache/tez/dag/library/vertexmanager/TestShuffleVertexManager.java b/tez-runtime-library/src/test/java/org/apache/tez/dag/library/vertexmanager/TestShuffleVertexManager.java
index 01e0fa9..315f729 100644
--- a/tez-runtime-library/src/test/java/org/apache/tez/dag/library/vertexmanager/TestShuffleVertexManager.java
+++ b/tez-runtime-library/src/test/java/org/apache/tez/dag/library/vertexmanager/TestShuffleVertexManager.java
@@ -131,8 +131,8 @@ public class TestShuffleVertexManager {
             final UserPayload userPayload = entry.getValue().getUserPayload();
             EdgeManagerPluginContext emContext = new EdgeManagerPluginContext() {
               @Override
-              public byte[] getUserPayload() {
-                return userPayload == null ? null : userPayload.getPayload();
+              public UserPayload getUserPayload() {
+                return userPayload == null ? null : userPayload;
               }
 
               @Override

http://git-wip-us.apache.org/repos/asf/tez/blob/f2b155db/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/conf/TestOnFileSortedOutputConfigurer.java
----------------------------------------------------------------------
diff --git a/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/conf/TestOnFileSortedOutputConfigurer.java b/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/conf/TestOnFileSortedOutputConfigurer.java
index a2a0462..bc20195 100644
--- a/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/conf/TestOnFileSortedOutputConfigurer.java
+++ b/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/conf/TestOnFileSortedOutputConfigurer.java
@@ -86,10 +86,8 @@ public class TestOnFileSortedOutputConfigurer {
 
     OnFileSortedOutputConfigurer configuration = builder.build();
 
-
-    byte[] confBytes = configuration.toByteArray();
     OnFileSortedOutputConfigurer rebuilt = new OnFileSortedOutputConfigurer();
-    rebuilt.fromByteArray(confBytes);
+    rebuilt.fromUserPayload(configuration.toUserPayload());
 
     Configuration conf = rebuilt.conf;
 
@@ -125,9 +123,8 @@ public class TestOnFileSortedOutputConfigurer {
         OnFileSortedOutputConfigurer.newBuilder("KEY", "VALUE", "PARTITIONER", null);
     OnFileSortedOutputConfigurer configuration = builder.build();
 
-    byte[] confBytes = configuration.toByteArray();
     OnFileSortedOutputConfigurer rebuilt = new OnFileSortedOutputConfigurer();
-    rebuilt.fromByteArray(confBytes);
+    rebuilt.fromUserPayload(configuration.toUserPayload());
 
     Configuration conf = rebuilt.conf;
 
@@ -155,9 +152,8 @@ public class TestOnFileSortedOutputConfigurer {
 
     OnFileSortedOutputConfigurer configuration = builder.build();
 
-    byte[] confBytes = configuration.toByteArray();
     OnFileSortedOutputConfigurer rebuilt = new OnFileSortedOutputConfigurer();
-    rebuilt.fromByteArray(confBytes);
+    rebuilt.fromUserPayload(configuration.toUserPayload());
 
     Configuration conf = rebuilt.conf;
 
@@ -180,9 +176,8 @@ public class TestOnFileSortedOutputConfigurer {
 
     OnFileSortedOutputConfigurer configuration = builder.build();
 
-    byte[] confBytes = configuration.toByteArray();
     OnFileSortedOutputConfigurer rebuilt = new OnFileSortedOutputConfigurer();
-    rebuilt.fromByteArray(confBytes);
+    rebuilt.fromUserPayload(configuration.toUserPayload());
 
     Configuration conf = rebuilt.conf;
 

http://git-wip-us.apache.org/repos/asf/tez/blob/f2b155db/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/conf/TestOnFileUnorderedKVOutputConfigurer.java
----------------------------------------------------------------------
diff --git a/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/conf/TestOnFileUnorderedKVOutputConfigurer.java b/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/conf/TestOnFileUnorderedKVOutputConfigurer.java
index 2cb0c62..b26aafb 100644
--- a/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/conf/TestOnFileUnorderedKVOutputConfigurer.java
+++ b/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/conf/TestOnFileUnorderedKVOutputConfigurer.java
@@ -75,11 +75,9 @@ public class TestOnFileUnorderedKVOutputConfigurer {
 
     OnFileUnorderedKVOutputConfigurer configuration = builder.build();
 
-
-    byte[] confBytes = configuration.toByteArray();
     OnFileUnorderedKVOutputConfigurer rebuilt =
         new OnFileUnorderedKVOutputConfigurer();
-    rebuilt.fromByteArray(confBytes);
+    rebuilt.fromUserPayload(configuration.toUserPayload());
 
     Configuration conf = rebuilt.conf;
 
@@ -111,10 +109,9 @@ public class TestOnFileUnorderedKVOutputConfigurer {
             .newBuilder("KEY", "VALUE");
     OnFileUnorderedKVOutputConfigurer configuration = builder.build();
 
-    byte[] confBytes = configuration.toByteArray();
     OnFileUnorderedKVOutputConfigurer rebuilt =
         new OnFileUnorderedKVOutputConfigurer();
-    rebuilt.fromByteArray(confBytes);
+    rebuilt.fromUserPayload(configuration.toUserPayload());
 
     Configuration conf = rebuilt.conf;
 

http://git-wip-us.apache.org/repos/asf/tez/blob/f2b155db/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/conf/TestOnFileUnorderedPartitionedKVOutputConfigurer.java
----------------------------------------------------------------------
diff --git a/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/conf/TestOnFileUnorderedPartitionedKVOutputConfigurer.java b/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/conf/TestOnFileUnorderedPartitionedKVOutputConfigurer.java
index bd53698..d12c5eb 100644
--- a/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/conf/TestOnFileUnorderedPartitionedKVOutputConfigurer.java
+++ b/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/conf/TestOnFileUnorderedPartitionedKVOutputConfigurer.java
@@ -87,11 +87,9 @@ public class TestOnFileUnorderedPartitionedKVOutputConfigurer {
 
     OnFileUnorderedPartitionedKVOutputConfigurer configuration = builder.build();
 
-
-    byte[] confBytes = configuration.toByteArray();
     OnFileUnorderedPartitionedKVOutputConfigurer rebuilt =
         new OnFileUnorderedPartitionedKVOutputConfigurer();
-    rebuilt.fromByteArray(confBytes);
+    rebuilt.fromUserPayload(configuration.toUserPayload());
 
     Configuration conf = rebuilt.conf;
 
@@ -129,10 +127,9 @@ public class TestOnFileUnorderedPartitionedKVOutputConfigurer {
             .setValueSerializationClass("SerClass2");
     OnFileUnorderedPartitionedKVOutputConfigurer configuration = builder.build();
 
-    byte[] confBytes = configuration.toByteArray();
     OnFileUnorderedPartitionedKVOutputConfigurer rebuilt =
         new OnFileUnorderedPartitionedKVOutputConfigurer();
-    rebuilt.fromByteArray(confBytes);
+    rebuilt.fromUserPayload(configuration.toUserPayload());
 
     Configuration conf = rebuilt.conf;
 
@@ -165,10 +162,9 @@ public class TestOnFileUnorderedPartitionedKVOutputConfigurer {
 
     OnFileUnorderedPartitionedKVOutputConfigurer configuration = builder.build();
 
-    byte[] confBytes = configuration.toByteArray();
     OnFileUnorderedPartitionedKVOutputConfigurer rebuilt =
         new OnFileUnorderedPartitionedKVOutputConfigurer();
-    rebuilt.fromByteArray(confBytes);
+    rebuilt.fromUserPayload(configuration.toUserPayload());
 
     Configuration conf = rebuilt.conf;
 

http://git-wip-us.apache.org/repos/asf/tez/blob/f2b155db/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/conf/TestOrderedPartitionedKVEdgeConfigurer.java
----------------------------------------------------------------------
diff --git a/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/conf/TestOrderedPartitionedKVEdgeConfigurer.java b/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/conf/TestOrderedPartitionedKVEdgeConfigurer.java
index 17b048d..b0f9c5c 100644
--- a/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/conf/TestOrderedPartitionedKVEdgeConfigurer.java
+++ b/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/conf/TestOrderedPartitionedKVEdgeConfigurer.java
@@ -67,13 +67,10 @@ public class TestOrderedPartitionedKVEdgeConfigurer {
 
     OrderedPartitionedKVEdgeConfigurer configuration = builder.build();
 
-    byte[] outputBytes = configuration.getOutputPayload().getPayload();
-    byte[] inputBytes = configuration.getInputPayload().getPayload();
-
     OnFileSortedOutputConfigurer rebuiltOutput = new OnFileSortedOutputConfigurer();
-    rebuiltOutput.fromByteArray(outputBytes);
+    rebuiltOutput.fromUserPayload(configuration.getOutputPayload());
     ShuffledMergedInputConfigurer rebuiltInput = new ShuffledMergedInputConfigurer();
-    rebuiltInput.fromByteArray(inputBytes);
+    rebuiltInput.fromUserPayload(configuration.getInputPayload());
 
     Configuration outputConf = rebuiltOutput.conf;
     assertEquals(true, outputConf.getBoolean(TezRuntimeConfiguration.TEZ_RUNTIME_IFILE_READAHEAD,
@@ -96,13 +93,10 @@ public class TestOrderedPartitionedKVEdgeConfigurer {
 
     OrderedPartitionedKVEdgeConfigurer configuration = builder.build();
 
-    byte[] outputBytes = configuration.getOutputPayload().getPayload();
-    byte[] inputBytes = configuration.getInputPayload().getPayload();
-
     OnFileSortedOutputConfigurer rebuiltOutput = new OnFileSortedOutputConfigurer();
-    rebuiltOutput.fromByteArray(outputBytes);
+    rebuiltOutput.fromUserPayload(configuration.getOutputPayload());
     ShuffledMergedInputConfigurer rebuiltInput = new ShuffledMergedInputConfigurer();
-    rebuiltInput.fromByteArray(inputBytes);
+    rebuiltInput.fromUserPayload(configuration.getInputPayload());
 
     Configuration outputConf = rebuiltOutput.conf;
     assertEquals("TestCodec",
@@ -141,13 +135,10 @@ public class TestOrderedPartitionedKVEdgeConfigurer {
 
     OrderedPartitionedKVEdgeConfigurer configuration = builder.build();
 
-    byte[] outputBytes = configuration.getOutputPayload().getPayload();
-    byte[] inputBytes = configuration.getInputPayload().getPayload();
-
     OnFileSortedOutputConfigurer rebuiltOutput = new OnFileSortedOutputConfigurer();
-    rebuiltOutput.fromByteArray(outputBytes);
+    rebuiltOutput.fromUserPayload(configuration.getOutputPayload());
     ShuffledMergedInputConfigurer rebuiltInput = new ShuffledMergedInputConfigurer();
-    rebuiltInput.fromByteArray(inputBytes);
+    rebuiltInput.fromUserPayload(configuration.getInputPayload());
 
     Configuration outputConf = rebuiltOutput.conf;
     Configuration inputConf = rebuiltInput.conf;
@@ -199,13 +190,10 @@ public class TestOrderedPartitionedKVEdgeConfigurer {
 
     OrderedPartitionedKVEdgeConfigurer configuration = builder.build();
 
-    byte[] outputBytes = configuration.getOutputPayload().getPayload();
-    byte[] inputBytes = configuration.getInputPayload().getPayload();
-
     OnFileSortedOutputConfigurer rebuiltOutput = new OnFileSortedOutputConfigurer();
-    rebuiltOutput.fromByteArray(outputBytes);
+    rebuiltOutput.fromUserPayload(configuration.getOutputPayload());
     ShuffledMergedInputConfigurer rebuiltInput = new ShuffledMergedInputConfigurer();
-    rebuiltInput.fromByteArray(inputBytes);
+    rebuiltInput.fromUserPayload(configuration.getInputPayload());
 
     Configuration outputConf = rebuiltOutput.conf;
     Configuration inputConf = rebuiltInput.conf;
@@ -262,13 +250,10 @@ public class TestOrderedPartitionedKVEdgeConfigurer {
 
     OrderedPartitionedKVEdgeConfigurer configuration = builder.build();
 
-    byte[] outputBytes = configuration.getOutputPayload().getPayload();
-    byte[] inputBytes = configuration.getInputPayload().getPayload();
-
     OnFileSortedOutputConfigurer rebuiltOutput = new OnFileSortedOutputConfigurer();
-    rebuiltOutput.fromByteArray(outputBytes);
+    rebuiltOutput.fromUserPayload(configuration.getOutputPayload());
     ShuffledMergedInputConfigurer rebuiltInput = new ShuffledMergedInputConfigurer();
-    rebuiltInput.fromByteArray(inputBytes);
+    rebuiltInput.fromUserPayload(configuration.getInputPayload());
 
     Configuration outputConf = rebuiltOutput.conf;
     Configuration inputConf = rebuiltInput.conf;

http://git-wip-us.apache.org/repos/asf/tez/blob/f2b155db/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/conf/TestShuffledMergedInputConfigurer.java
----------------------------------------------------------------------
diff --git a/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/conf/TestShuffledMergedInputConfigurer.java b/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/conf/TestShuffledMergedInputConfigurer.java
index 7ebe4cf..af91773 100644
--- a/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/conf/TestShuffledMergedInputConfigurer.java
+++ b/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/conf/TestShuffledMergedInputConfigurer.java
@@ -80,9 +80,8 @@ public class TestShuffledMergedInputConfigurer {
     ShuffledMergedInputConfigurer configuration = builder.build();
 
 
-    byte[] confBytes = configuration.toByteArray();
     ShuffledMergedInputConfigurer rebuilt = new ShuffledMergedInputConfigurer();
-    rebuilt.fromByteArray(confBytes);
+    rebuilt.fromUserPayload(configuration.toUserPayload());
 
     Configuration conf = rebuilt.conf;
 
@@ -118,9 +117,8 @@ public class TestShuffledMergedInputConfigurer {
         ShuffledMergedInputConfigurer.newBuilder("KEY", "VALUE");
     ShuffledMergedInputConfigurer configuration = builder.build();
 
-    byte[] confBytes = configuration.toByteArray();
     ShuffledMergedInputConfigurer rebuilt = new ShuffledMergedInputConfigurer();
-    rebuilt.fromByteArray(confBytes);
+    rebuilt.fromUserPayload(configuration.toUserPayload());
 
     Configuration conf = rebuilt.conf;
 
@@ -148,9 +146,8 @@ public class TestShuffledMergedInputConfigurer {
 
     ShuffledMergedInputConfigurer configuration = builder.build();
 
-    byte[] confBytes = configuration.toByteArray();
     ShuffledMergedInputConfigurer rebuilt = new ShuffledMergedInputConfigurer();
-    rebuilt.fromByteArray(confBytes);
+    rebuilt.fromUserPayload(configuration.toUserPayload());
 
     Configuration conf = rebuilt.conf;
 

http://git-wip-us.apache.org/repos/asf/tez/blob/f2b155db/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/conf/TestShuffledUnorderedKVInputConfigurer.java
----------------------------------------------------------------------
diff --git a/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/conf/TestShuffledUnorderedKVInputConfigurer.java b/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/conf/TestShuffledUnorderedKVInputConfigurer.java
index 40ed505..4910bcf 100644
--- a/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/conf/TestShuffledUnorderedKVInputConfigurer.java
+++ b/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/conf/TestShuffledUnorderedKVInputConfigurer.java
@@ -76,10 +76,8 @@ public class TestShuffledUnorderedKVInputConfigurer {
 
     ShuffledUnorderedKVInputConfigurer configuration = builder.build();
 
-
-    byte[] confBytes = configuration.toByteArray();
     ShuffledUnorderedKVInputConfigurer rebuilt = new ShuffledUnorderedKVInputConfigurer();
-    rebuilt.fromByteArray(confBytes);
+    rebuilt.fromUserPayload(configuration.toUserPayload());
 
     Configuration conf = rebuilt.conf;
 
@@ -114,9 +112,8 @@ public class TestShuffledUnorderedKVInputConfigurer {
         ShuffledUnorderedKVInputConfigurer.newBuilder("KEY", "VALUE");
     ShuffledUnorderedKVInputConfigurer configuration = builder.build();
 
-    byte[] confBytes = configuration.toByteArray();
     ShuffledUnorderedKVInputConfigurer rebuilt = new ShuffledUnorderedKVInputConfigurer();
-    rebuilt.fromByteArray(confBytes);
+    rebuilt.fromUserPayload(configuration.toUserPayload());
 
     Configuration conf = rebuilt.conf;
 

http://git-wip-us.apache.org/repos/asf/tez/blob/f2b155db/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/conf/TestUnorderedPartitionedKVEdgeConfigurer.java
----------------------------------------------------------------------
diff --git a/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/conf/TestUnorderedPartitionedKVEdgeConfigurer.java b/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/conf/TestUnorderedPartitionedKVEdgeConfigurer.java
index a6efdb6..1943105 100644
--- a/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/conf/TestUnorderedPartitionedKVEdgeConfigurer.java
+++ b/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/conf/TestUnorderedPartitionedKVEdgeConfigurer.java
@@ -68,15 +68,12 @@ public class TestUnorderedPartitionedKVEdgeConfigurer {
 
     UnorderedPartitionedKVEdgeConfigurer configuration = builder.build();
 
-    byte[] outputBytes = configuration.getOutputPayload().getPayload();
-    byte[] inputBytes = configuration.getInputPayload().getPayload();
-
     OnFileUnorderedPartitionedKVOutputConfigurer rebuiltOutput =
         new OnFileUnorderedPartitionedKVOutputConfigurer();
-    rebuiltOutput.fromByteArray(outputBytes);
+    rebuiltOutput.fromUserPayload(configuration.getOutputPayload());
     ShuffledUnorderedKVInputConfigurer rebuiltInput =
         new ShuffledUnorderedKVInputConfigurer();
-    rebuiltInput.fromByteArray(inputBytes);
+    rebuiltInput.fromUserPayload(configuration.getInputPayload());
 
     Configuration outputConf = rebuiltOutput.conf;
     assertEquals(true, outputConf.getBoolean(TezRuntimeConfiguration.TEZ_RUNTIME_IFILE_READAHEAD,
@@ -103,15 +100,12 @@ public class TestUnorderedPartitionedKVEdgeConfigurer {
 
     UnorderedPartitionedKVEdgeConfigurer configuration = builder.build();
 
-    byte[] outputBytes = configuration.getOutputPayload().getPayload();
-    byte[] inputBytes = configuration.getInputPayload().getPayload();
-
     OnFileUnorderedPartitionedKVOutputConfigurer rebuiltOutput =
         new OnFileUnorderedPartitionedKVOutputConfigurer();
-    rebuiltOutput.fromByteArray(outputBytes);
+    rebuiltOutput.fromUserPayload(configuration.getOutputPayload());
     ShuffledUnorderedKVInputConfigurer rebuiltInput =
         new ShuffledUnorderedKVInputConfigurer();
-    rebuiltInput.fromByteArray(inputBytes);
+    rebuiltInput.fromUserPayload(configuration.getInputPayload());
 
     Configuration outputConf = rebuiltOutput.conf;
     assertEquals("TestCodec",
@@ -150,15 +144,12 @@ public class TestUnorderedPartitionedKVEdgeConfigurer {
 
     UnorderedPartitionedKVEdgeConfigurer configuration = builder.build();
 
-    byte[] outputBytes = configuration.getOutputPayload().getPayload();
-    byte[] inputBytes = configuration.getInputPayload().getPayload();
-
     OnFileUnorderedPartitionedKVOutputConfigurer rebuiltOutput =
         new OnFileUnorderedPartitionedKVOutputConfigurer();
-    rebuiltOutput.fromByteArray(outputBytes);
+    rebuiltOutput.fromUserPayload(configuration.getOutputPayload());
     ShuffledUnorderedKVInputConfigurer rebuiltInput =
         new ShuffledUnorderedKVInputConfigurer();
-    rebuiltInput.fromByteArray(inputBytes);
+    rebuiltInput.fromUserPayload(configuration.getInputPayload());
 
     Configuration outputConf = rebuiltOutput.conf;
     Configuration inputConf = rebuiltInput.conf;

http://git-wip-us.apache.org/repos/asf/tez/blob/f2b155db/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/conf/TestUnorderedUnpartitionedKVEdgeConfigurer.java
----------------------------------------------------------------------
diff --git a/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/conf/TestUnorderedUnpartitionedKVEdgeConfigurer.java b/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/conf/TestUnorderedUnpartitionedKVEdgeConfigurer.java
index ba9cd56..c5fdbda 100644
--- a/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/conf/TestUnorderedUnpartitionedKVEdgeConfigurer.java
+++ b/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/conf/TestUnorderedUnpartitionedKVEdgeConfigurer.java
@@ -60,15 +60,13 @@ public class TestUnorderedUnpartitionedKVEdgeConfigurer {
 
     UnorderedUnpartitionedKVEdgeConfigurer configuration = builder.build();
 
-    byte[] outputBytes = configuration.getOutputPayload().getPayload();
-    byte[] inputBytes = configuration.getInputPayload().getPayload();
 
     OnFileUnorderedKVOutputConfigurer rebuiltOutput =
         new OnFileUnorderedKVOutputConfigurer();
-    rebuiltOutput.fromByteArray(outputBytes);
+    rebuiltOutput.fromUserPayload(configuration.getOutputPayload());
     ShuffledUnorderedKVInputConfigurer rebuiltInput =
         new ShuffledUnorderedKVInputConfigurer();
-    rebuiltInput.fromByteArray(inputBytes);
+    rebuiltInput.fromUserPayload(configuration.getInputPayload());
 
     Configuration outputConf = rebuiltOutput.conf;
     assertEquals(true, outputConf.getBoolean(TezRuntimeConfiguration.TEZ_RUNTIME_IFILE_READAHEAD,
@@ -95,15 +93,12 @@ public class TestUnorderedUnpartitionedKVEdgeConfigurer {
 
     UnorderedUnpartitionedKVEdgeConfigurer configuration = builder.build();
 
-    byte[] outputBytes = configuration.getOutputPayload().getPayload();
-    byte[] inputBytes = configuration.getInputPayload().getPayload();
-
     OnFileUnorderedKVOutputConfigurer rebuiltOutput =
         new OnFileUnorderedKVOutputConfigurer();
-    rebuiltOutput.fromByteArray(outputBytes);
+    rebuiltOutput.fromUserPayload(configuration.getOutputPayload());
     ShuffledUnorderedKVInputConfigurer rebuiltInput =
         new ShuffledUnorderedKVInputConfigurer();
-    rebuiltInput.fromByteArray(inputBytes);
+    rebuiltInput.fromUserPayload(configuration.getInputPayload());
 
     Configuration outputConf = rebuiltOutput.conf;
     assertEquals("TestCodec",
@@ -140,15 +135,12 @@ public class TestUnorderedUnpartitionedKVEdgeConfigurer {
 
     UnorderedUnpartitionedKVEdgeConfigurer configuration = builder.build();
 
-    byte[] outputBytes = configuration.getOutputPayload().getPayload();
-    byte[] inputBytes = configuration.getInputPayload().getPayload();
-
     OnFileUnorderedKVOutputConfigurer rebuiltOutput =
         new OnFileUnorderedKVOutputConfigurer();
-    rebuiltOutput.fromByteArray(outputBytes);
+    rebuiltOutput.fromUserPayload(configuration.getOutputPayload());
     ShuffledUnorderedKVInputConfigurer rebuiltInput =
         new ShuffledUnorderedKVInputConfigurer();
-    rebuiltInput.fromByteArray(inputBytes);
+    rebuiltInput.fromUserPayload(configuration.getInputPayload());
 
     Configuration outputConf = rebuiltOutput.conf;
     Configuration inputConf = rebuiltInput.conf;

http://git-wip-us.apache.org/repos/asf/tez/blob/f2b155db/tez-tests/src/test/java/org/apache/tez/mapreduce/TestMRRJobsDAGApi.java
----------------------------------------------------------------------
diff --git a/tez-tests/src/test/java/org/apache/tez/mapreduce/TestMRRJobsDAGApi.java b/tez-tests/src/test/java/org/apache/tez/mapreduce/TestMRRJobsDAGApi.java
index 79e428c..f08fae8 100644
--- a/tez-tests/src/test/java/org/apache/tez/mapreduce/TestMRRJobsDAGApi.java
+++ b/tez-tests/src/test/java/org/apache/tez/mapreduce/TestMRRJobsDAGApi.java
@@ -187,7 +187,7 @@ public class TestMRRJobsDAGApi {
 
     DAG dag = new DAG("TezSleepProcessor");
     Vertex vertex = new Vertex("SleepVertex", new ProcessorDescriptor(
-        SleepProcessor.class.getName()).setUserPayload(new UserPayload(spConf.toUserPayload())), 1,
+        SleepProcessor.class.getName()).setUserPayload(spConf.toUserPayload()), 1,
         Resource.newInstance(1024, 1));
     dag.addVertex(vertex);
 
@@ -236,7 +236,7 @@ public class TestMRRJobsDAGApi {
       for (int dagIndex = 1; dagIndex <= 2; dagIndex++) {
         DAG dag = new DAG("TezSleepProcessor");
         Vertex vertex = new Vertex("SleepVertex", new ProcessorDescriptor(
-            SleepProcessor.class.getName()).setUserPayload(new UserPayload(spConf.toUserPayload())), 1,
+            SleepProcessor.class.getName()).setUserPayload(spConf.toUserPayload()), 1,
             Resource.newInstance(1024, 1));
         dag.addVertex(vertex);
 
@@ -275,7 +275,7 @@ public class TestMRRJobsDAGApi {
 
     DAG dag = new DAG("TezSleepProcessor");
     Vertex vertex = new Vertex("SleepVertex", new ProcessorDescriptor(
-        SleepProcessor.class.getName()).setUserPayload(new UserPayload(spConf.toUserPayload())), 1,
+        SleepProcessor.class.getName()).setUserPayload(spConf.toUserPayload()), 1,
         Resource.newInstance(1024, 1));
     dag.addVertex(vertex);
 
@@ -317,7 +317,7 @@ public class TestMRRJobsDAGApi {
 
     DAG dag = new DAG("TezSleepProcessorHistoryLogging");
     Vertex vertex = new Vertex("SleepVertex", new ProcessorDescriptor(
-        SleepProcessor.class.getName()).setUserPayload(new UserPayload(spConf.toUserPayload())), 2,
+        SleepProcessor.class.getName()).setUserPayload(spConf.toUserPayload()), 2,
         Resource.newInstance(1024, 1));
     dag.addVertex(vertex);
 


Mime
View raw message