tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hit...@apache.org
Subject git commit: TEZ-1234. Replace Interfaces with Abstract classes for VertexManagerPlugin and EdgeManager. (hitesh)
Date Thu, 26 Jun 2014 20:39:24 GMT
Repository: incubator-tez
Updated Branches:
  refs/heads/master 4dfd8341d -> 5ae6a40b6


TEZ-1234. Replace Interfaces with Abstract classes for VertexManagerPlugin and EdgeManager.
(hitesh)


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

Branch: refs/heads/master
Commit: 5ae6a40b694229574097f0bc75bca522a7bc00c2
Parents: 4dfd834
Author: Hitesh Shah <hitesh@apache.org>
Authored: Thu Jun 26 13:39:02 2014 -0700
Committer: Hitesh Shah <hitesh@apache.org>
Committed: Thu Jun 26 13:39:02 2014 -0700

----------------------------------------------------------------------
 .../java/org/apache/tez/dag/api/EdgeManager.java    | 16 ++++++++--------
 .../org/apache/tez/dag/api/VertexManagerPlugin.java | 12 ++++++------
 .../tez/dag/app/dag/impl/BroadcastEdgeManager.java  |  2 +-
 .../app/dag/impl/ImmediateStartVertexManager.java   |  2 +-
 .../tez/dag/app/dag/impl/OneToOneEdgeManager.java   |  2 +-
 .../dag/app/dag/impl/RootInputVertexManager.java    |  2 +-
 .../dag/app/dag/impl/ScatterGatherEdgeManager.java  |  2 +-
 .../apache/tez/dag/app/dag/impl/TestVertexImpl.java |  2 +-
 .../org/apache/tez/test/EdgeManagerForTest.java     |  2 +-
 .../apache/tez/test/VertexManagerPluginForTest.java |  3 ++-
 .../vertexmanager/InputReadyVertexManager.java      |  2 +-
 .../library/vertexmanager/ShuffleVertexManager.java |  4 ++--
 .../org/apache/tez/test/dag/MultiAttemptDAG.java    |  3 +--
 13 files changed, 27 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/5ae6a40b/tez-api/src/main/java/org/apache/tez/dag/api/EdgeManager.java
----------------------------------------------------------------------
diff --git a/tez-api/src/main/java/org/apache/tez/dag/api/EdgeManager.java b/tez-api/src/main/java/org/apache/tez/dag/api/EdgeManager.java
index a3970fc..7911f48 100644
--- a/tez-api/src/main/java/org/apache/tez/dag/api/EdgeManager.java
+++ b/tez-api/src/main/java/org/apache/tez/dag/api/EdgeManager.java
@@ -33,7 +33,7 @@ import org.apache.tez.runtime.api.events.InputReadErrorEvent;
  * Implementations must provide a 0 argument public constructor.
  */
 @Evolving
-public interface EdgeManager {
+public abstract class EdgeManager {
   
   /**
    * Initializes the EdgeManager. This method is called in the following
@@ -48,7 +48,7 @@ public interface EdgeManager {
    *          information like configuration which the user may have specified
    *          while setting up the edge.
    */
-  public void initialize(EdgeManagerContext edgeManagerContext);
+  public abstract void initialize(EdgeManagerContext edgeManagerContext);
   
   /**
    * Get the number of physical inputs on the destination task
@@ -56,7 +56,7 @@ public interface EdgeManager {
    * inputs is needed
    * @return Number of physical inputs on the destination task
    */
-  public int getNumDestinationTaskPhysicalInputs(int destinationTaskIndex);
+  public abstract int getNumDestinationTaskPhysicalInputs(int destinationTaskIndex);
 
   /**
    * Get the number of physical outputs on the source task
@@ -64,7 +64,7 @@ public interface EdgeManager {
    * is needed
    * @return Number of physical outputs on the source task
    */
-  public int getNumSourceTaskPhysicalOutputs(int sourceTaskIndex);
+  public abstract int getNumSourceTaskPhysicalOutputs(int sourceTaskIndex);
   
   /**
    * Return the routing information to inform consumers about the source task
@@ -83,7 +83,7 @@ public interface EdgeManager {
    * @param destinationTaskAndInputIndices
    *          Map via which the routing information is returned
    */
-  public void routeDataMovementEventToDestination(DataMovementEvent event,
+  public abstract void routeDataMovementEventToDestination(DataMovementEvent event,
       int sourceTaskIndex, int sourceOutputIndex,
       Map<Integer, List<Integer>> destinationTaskAndInputIndices);
   
@@ -101,14 +101,14 @@ public interface EdgeManager {
    * @param destinationTaskAndInputIndices
    *          Map via which the routing information is returned
    */
-  public void routeInputSourceTaskFailedEventToDestination(int sourceTaskIndex,
+  public abstract void routeInputSourceTaskFailedEventToDestination(int sourceTaskIndex,
       Map<Integer, List<Integer>> destinationTaskAndInputIndices);
 
   /**
    * Get the number of destination tasks that consume data from the source task
    * @param sourceTaskIndex Source task index
    */
-  public int getNumDestinationConsumerTasks(int sourceTaskIndex);
+  public abstract int getNumDestinationConsumerTasks(int sourceTaskIndex);
   
   /**
    * Return the source task index to which to send the input error event
@@ -116,7 +116,7 @@ public interface EdgeManager {
    * @param destinationTaskIndex Destination task that reported the error
    * @return Index of the source task that created the unavailable input
    */
-  public int routeInputErrorEventToSource(InputReadErrorEvent event,
+  public abstract int routeInputErrorEventToSource(InputReadErrorEvent event,
       int destinationTaskIndex);
   
 }

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/5ae6a40b/tez-api/src/main/java/org/apache/tez/dag/api/VertexManagerPlugin.java
----------------------------------------------------------------------
diff --git a/tez-api/src/main/java/org/apache/tez/dag/api/VertexManagerPlugin.java b/tez-api/src/main/java/org/apache/tez/dag/api/VertexManagerPlugin.java
index 438b2dd..41c5667 100644
--- a/tez-api/src/main/java/org/apache/tez/dag/api/VertexManagerPlugin.java
+++ b/tez-api/src/main/java/org/apache/tez/dag/api/VertexManagerPlugin.java
@@ -30,32 +30,32 @@ import org.apache.tez.runtime.api.events.VertexManagerEvent;
  * The plugin will be notified of interesting events in the vertex execution life
  * cycle and can respond to them by via the context object
  */
-public interface VertexManagerPlugin {
+public abstract class VertexManagerPlugin {
   /**
    * Initialize the plugin. Called when the vertex is initializing. This happens 
    * after all source vertices and inputs have initialized
    * @param context
    */
-  public void initialize(VertexManagerPluginContext context);
+  public abstract void initialize(VertexManagerPluginContext context);
 
   /**
    * Notification that the vertex is ready to start running tasks
    * @param completions Source vertices and all their tasks that have already completed
    */
-  public void onVertexStarted(Map<String, List<Integer>> completions);
+  public abstract void onVertexStarted(Map<String, List<Integer>> completions);
 
   /**
    * Notification of a source vertex completion.
    * @param srcVertexName
    * @param taskId Index of the task that completed
    */
-  public void onSourceTaskCompleted(String srcVertexName, Integer taskId);
+  public abstract void onSourceTaskCompleted(String srcVertexName, Integer taskId);
 
   /**
    * Notification of an event directly sent to this vertex manager
    * @param vmEvent
    */
-  public void onVertexManagerEventReceived(VertexManagerEvent vmEvent);
+  public abstract void onVertexManagerEventReceived(VertexManagerEvent vmEvent);
 
   /**
    * Notification that the inputs of this vertex have initialized
@@ -63,6 +63,6 @@ public interface VertexManagerPlugin {
    * @param inputDescriptor
    * @param events
    */
-  public void onRootVertexInitialized(String inputName,
+  public abstract void onRootVertexInitialized(String inputName,
       InputDescriptor inputDescriptor, List<Event> events);
  }

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/5ae6a40b/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/BroadcastEdgeManager.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/BroadcastEdgeManager.java
b/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/BroadcastEdgeManager.java
index 6628af5..fdf9152 100644
--- a/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/BroadcastEdgeManager.java
+++ b/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/BroadcastEdgeManager.java
@@ -27,7 +27,7 @@ import org.apache.tez.dag.api.EdgeManagerContext;
 import org.apache.tez.runtime.api.events.DataMovementEvent;
 import org.apache.tez.runtime.api.events.InputReadErrorEvent;
 
-public class BroadcastEdgeManager implements EdgeManager {
+public class BroadcastEdgeManager extends EdgeManager {
 
   EdgeManagerContext context;
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/5ae6a40b/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/ImmediateStartVertexManager.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/ImmediateStartVertexManager.java
b/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/ImmediateStartVertexManager.java
index cf13f64..2933d5a 100644
--- a/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/ImmediateStartVertexManager.java
+++ b/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/ImmediateStartVertexManager.java
@@ -33,7 +33,7 @@ import com.google.common.collect.Lists;
 /**
  * Starts all tasks immediately on vertex start
  */
-public class ImmediateStartVertexManager implements VertexManagerPlugin {
+public class ImmediateStartVertexManager extends VertexManagerPlugin {
   
   private VertexManagerPluginContext context;
   

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/5ae6a40b/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/OneToOneEdgeManager.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/OneToOneEdgeManager.java
b/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/OneToOneEdgeManager.java
index 20b2068..6572c1d 100644
--- a/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/OneToOneEdgeManager.java
+++ b/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/OneToOneEdgeManager.java
@@ -27,7 +27,7 @@ import org.apache.tez.dag.api.EdgeManagerContext;
 import org.apache.tez.runtime.api.events.DataMovementEvent;
 import org.apache.tez.runtime.api.events.InputReadErrorEvent;
 
-public class OneToOneEdgeManager implements EdgeManager {
+public class OneToOneEdgeManager extends EdgeManager {
 
   List<Integer> destinationInputIndices = 
       Collections.unmodifiableList(Collections.singletonList(0)); 

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/5ae6a40b/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/RootInputVertexManager.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/RootInputVertexManager.java
b/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/RootInputVertexManager.java
index 5bd80e7..637deaa 100644
--- a/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/RootInputVertexManager.java
+++ b/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/RootInputVertexManager.java
@@ -37,7 +37,7 @@ import org.apache.tez.runtime.api.events.VertexManagerEvent;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.Lists;
 
-public class RootInputVertexManager implements VertexManagerPlugin {
+public class RootInputVertexManager extends VertexManagerPlugin {
 
   VertexManagerPluginContext context;
   private String configuredInputName;

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/5ae6a40b/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/ScatterGatherEdgeManager.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/ScatterGatherEdgeManager.java
b/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/ScatterGatherEdgeManager.java
index 541f4dd..6f20ea9 100644
--- a/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/ScatterGatherEdgeManager.java
+++ b/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/ScatterGatherEdgeManager.java
@@ -27,7 +27,7 @@ import org.apache.tez.dag.api.EdgeManagerContext;
 import org.apache.tez.runtime.api.events.DataMovementEvent;
 import org.apache.tez.runtime.api.events.InputReadErrorEvent;
 
-public class ScatterGatherEdgeManager implements EdgeManager {
+public class ScatterGatherEdgeManager extends EdgeManager {
 
   EdgeManagerContext context;
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/5ae6a40b/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 16ee7bb..c9bbf3f 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
@@ -3159,7 +3159,7 @@ public class TestVertexImpl {
     Assert.assertEquals(VertexState.RUNNING, vC.getState());
   }
   
-  public static class RootInputSpecUpdaterVertexManager implements VertexManagerPlugin {
+  public static class RootInputSpecUpdaterVertexManager extends VertexManagerPlugin {
 
     private VertexManagerPluginContext context;
     private static final int NUM_TASKS = 5;

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/5ae6a40b/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 93a0a58..49060b8 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
@@ -26,7 +26,7 @@ import org.apache.tez.dag.api.EdgeManagerContext;
 import org.apache.tez.runtime.api.events.DataMovementEvent;
 import org.apache.tez.runtime.api.events.InputReadErrorEvent;
 
-public class EdgeManagerForTest implements EdgeManager {
+public class EdgeManagerForTest extends EdgeManager {
 
   private EdgeManagerContext edgeManagerContext = null;
   private byte[] userPayload;

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/5ae6a40b/tez-dag/src/test/java/org/apache/tez/test/VertexManagerPluginForTest.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/test/java/org/apache/tez/test/VertexManagerPluginForTest.java b/tez-dag/src/test/java/org/apache/tez/test/VertexManagerPluginForTest.java
index 323fd08..be0d408 100644
--- a/tez-dag/src/test/java/org/apache/tez/test/VertexManagerPluginForTest.java
+++ b/tez-dag/src/test/java/org/apache/tez/test/VertexManagerPluginForTest.java
@@ -27,7 +27,8 @@ import org.apache.tez.dag.api.VertexManagerPluginContext;
 import org.apache.tez.runtime.api.Event;
 import org.apache.tez.runtime.api.events.VertexManagerEvent;
 
-public class VertexManagerPluginForTest implements VertexManagerPlugin {
+public class VertexManagerPluginForTest extends VertexManagerPlugin {
+
   @Override
   public void initialize(VertexManagerPluginContext context) {}
 

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/5ae6a40b/tez-runtime-library/src/main/java/org/apache/tez/dag/library/vertexmanager/InputReadyVertexManager.java
----------------------------------------------------------------------
diff --git a/tez-runtime-library/src/main/java/org/apache/tez/dag/library/vertexmanager/InputReadyVertexManager.java
b/tez-runtime-library/src/main/java/org/apache/tez/dag/library/vertexmanager/InputReadyVertexManager.java
index 8e4b109..e5439de 100644
--- a/tez-runtime-library/src/main/java/org/apache/tez/dag/library/vertexmanager/InputReadyVertexManager.java
+++ b/tez-runtime-library/src/main/java/org/apache/tez/dag/library/vertexmanager/InputReadyVertexManager.java
@@ -38,7 +38,7 @@ import org.apache.tez.runtime.api.events.VertexManagerEvent;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 
-public class InputReadyVertexManager implements VertexManagerPlugin {
+public class InputReadyVertexManager extends VertexManagerPlugin {
   private static final Log LOG = 
       LogFactory.getLog(InputReadyVertexManager.class);
 

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/5ae6a40b/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 7c34bad..c31539c 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
@@ -56,7 +56,7 @@ import com.google.protobuf.InvalidProtocolBufferException;
  * <code>slowStartMinSrcCompletionFraction</code> and schedules all tasks 
  *  when <code>slowStartMaxSrcCompletionFraction</code> is reached
  */
-public class ShuffleVertexManager implements VertexManagerPlugin {
+public class ShuffleVertexManager extends VertexManagerPlugin {
   
   private static final String TEZ_AM_PREFIX = "tez.am.";
   
@@ -126,7 +126,7 @@ public class ShuffleVertexManager implements VertexManagerPlugin {
   }
   
   
-  public static class CustomShuffleEdgeManager implements EdgeManager {
+  public static class CustomShuffleEdgeManager extends EdgeManager {
     int numSourceTaskOutputs;
     int numDestinationTasks;
     int basePartitionRange;

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/5ae6a40b/tez-tests/src/test/java/org/apache/tez/test/dag/MultiAttemptDAG.java
----------------------------------------------------------------------
diff --git a/tez-tests/src/test/java/org/apache/tez/test/dag/MultiAttemptDAG.java b/tez-tests/src/test/java/org/apache/tez/test/dag/MultiAttemptDAG.java
index d485c85..879fecf 100644
--- a/tez-tests/src/test/java/org/apache/tez/test/dag/MultiAttemptDAG.java
+++ b/tez-tests/src/test/java/org/apache/tez/test/dag/MultiAttemptDAG.java
@@ -74,8 +74,7 @@ public class MultiAttemptDAG {
       "tez.multi-attempt-dag.use-failing-committer";
   public static boolean MULTI_ATTEMPT_DAG_USE_FAILING_COMMITTER_DEFAULT = false;
 
-  public static class FailOnAttemptVertexManagerPlugin
-      implements VertexManagerPlugin {
+  public static class FailOnAttemptVertexManagerPlugin extends VertexManagerPlugin {
     private int numSourceTasks = 0;
     private AtomicInteger numCompletions = new AtomicInteger();
     private VertexManagerPluginContext context;


Mime
View raw message