tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ss...@apache.org
Subject git commit: TEZ-1299. Get rid of unnecessary setter override in EntityDescriptors. (sseth)
Date Tue, 22 Jul 2014 06:16:07 GMT
Repository: tez
Updated Branches:
  refs/heads/master 47b52156c -> da9bec239


TEZ-1299. Get rid of unnecessary setter override in EntityDescriptors.
(sseth)


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

Branch: refs/heads/master
Commit: da9bec23970b7bbf8060a97473f7b69c79b255db
Parents: 47b5215
Author: Siddharth Seth <sseth@apache.org>
Authored: Mon Jul 21 23:15:38 2014 -0700
Committer: Siddharth Seth <sseth@apache.org>
Committed: Mon Jul 21 23:15:38 2014 -0700

----------------------------------------------------------------------
 .../tez/dag/api/EdgeManagerDescriptor.java      | 19 +------------------
 .../org/apache/tez/dag/api/InputDescriptor.java | 20 +-------------------
 .../apache/tez/dag/api/OutputDescriptor.java    | 20 +-------------------
 .../apache/tez/dag/api/ProcessorDescriptor.java | 20 +-------------------
 .../apache/tez/dag/api/TezEntityDescriptor.java | 10 +++++-----
 .../dag/api/VertexManagerPluginDescriptor.java  | 20 +-------------------
 6 files changed, 10 insertions(+), 99 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/da9bec23/tez-api/src/main/java/org/apache/tez/dag/api/EdgeManagerDescriptor.java
----------------------------------------------------------------------
diff --git a/tez-api/src/main/java/org/apache/tez/dag/api/EdgeManagerDescriptor.java b/tez-api/src/main/java/org/apache/tez/dag/api/EdgeManagerDescriptor.java
index 194492f..058e8e8 100644
--- a/tez-api/src/main/java/org/apache/tez/dag/api/EdgeManagerDescriptor.java
+++ b/tez-api/src/main/java/org/apache/tez/dag/api/EdgeManagerDescriptor.java
@@ -18,27 +18,10 @@
 
 package org.apache.tez.dag.api;
 
-public class EdgeManagerDescriptor extends TezEntityDescriptor {
+public class EdgeManagerDescriptor extends TezEntityDescriptor<EdgeManagerDescriptor>
{
 
   public EdgeManagerDescriptor(String edgeManagerClassName) {
     super(edgeManagerClassName);
   }
 
-  @Override
-  public EdgeManagerDescriptor setUserPayload(byte[] userPayload) {
-    this.userPayload = DagTypeConverters.convertToTezUserPayload(userPayload);
-    return this;
-  }
-
-  /**
-   * Provide a human-readable version of the user payload that can be
-   * used in the History UI
-   * @param historyText History text
-   */
-  @Override
-  public EdgeManagerDescriptor setHistoryText(String historyText) {
-    super.setHistoryText(historyText);
-    return this;
-  }
-
 }

http://git-wip-us.apache.org/repos/asf/tez/blob/da9bec23/tez-api/src/main/java/org/apache/tez/dag/api/InputDescriptor.java
----------------------------------------------------------------------
diff --git a/tez-api/src/main/java/org/apache/tez/dag/api/InputDescriptor.java b/tez-api/src/main/java/org/apache/tez/dag/api/InputDescriptor.java
index 0d01262..a95add8 100644
--- a/tez-api/src/main/java/org/apache/tez/dag/api/InputDescriptor.java
+++ b/tez-api/src/main/java/org/apache/tez/dag/api/InputDescriptor.java
@@ -20,7 +20,7 @@ package org.apache.tez.dag.api;
 
 import org.apache.hadoop.classification.InterfaceAudience.Private;
 
-public class InputDescriptor extends TezEntityDescriptor {
+public class InputDescriptor extends TezEntityDescriptor<InputDescriptor> {
 
   @Private // for Writable
   public InputDescriptor() {
@@ -30,22 +30,4 @@ public class InputDescriptor extends TezEntityDescriptor {
   public InputDescriptor(String inputClassName) {
     super(inputClassName);
   }
-
-  @Override
-  public InputDescriptor setUserPayload(byte[] userPayload) {
-    super.setUserPayload(userPayload);
-    return this;
-  }
-
-  /**
-   * Provide a human-readable version of the user payload that can be
-   * used in the History UI
-   * @param historyText History text
-   */
-  @Override
-  public InputDescriptor setHistoryText(String historyText) {
-    super.setHistoryText(historyText);
-    return this;
-  }
-
 }

http://git-wip-us.apache.org/repos/asf/tez/blob/da9bec23/tez-api/src/main/java/org/apache/tez/dag/api/OutputDescriptor.java
----------------------------------------------------------------------
diff --git a/tez-api/src/main/java/org/apache/tez/dag/api/OutputDescriptor.java b/tez-api/src/main/java/org/apache/tez/dag/api/OutputDescriptor.java
index e9cbe51..78c1a7a 100644
--- a/tez-api/src/main/java/org/apache/tez/dag/api/OutputDescriptor.java
+++ b/tez-api/src/main/java/org/apache/tez/dag/api/OutputDescriptor.java
@@ -20,7 +20,7 @@ package org.apache.tez.dag.api;
 
 import org.apache.hadoop.classification.InterfaceAudience.Private;
 
-public class OutputDescriptor extends TezEntityDescriptor {
+public class OutputDescriptor extends TezEntityDescriptor<OutputDescriptor> {
 
   @Private // for Writable
   public OutputDescriptor() {
@@ -30,22 +30,4 @@ public class OutputDescriptor extends TezEntityDescriptor {
   public OutputDescriptor(String outputClassName) {
     super(outputClassName);
   }
-
-  @Override
-  public OutputDescriptor setUserPayload(byte[] userPayload) {
-    super.setUserPayload(userPayload);
-    return this;
-  }
-
-  /**
-   * Provide a human-readable version of the user payload that can be
-   * used in the History UI
-   * @param historyText History text
-   */
-  @Override
-  public OutputDescriptor setHistoryText(String historyText) {
-    super.setHistoryText(historyText);
-    return this;
-  }
-
 }

http://git-wip-us.apache.org/repos/asf/tez/blob/da9bec23/tez-api/src/main/java/org/apache/tez/dag/api/ProcessorDescriptor.java
----------------------------------------------------------------------
diff --git a/tez-api/src/main/java/org/apache/tez/dag/api/ProcessorDescriptor.java b/tez-api/src/main/java/org/apache/tez/dag/api/ProcessorDescriptor.java
index 4641d93..a8593b6 100644
--- a/tez-api/src/main/java/org/apache/tez/dag/api/ProcessorDescriptor.java
+++ b/tez-api/src/main/java/org/apache/tez/dag/api/ProcessorDescriptor.java
@@ -20,7 +20,7 @@ package org.apache.tez.dag.api;
 
 import org.apache.hadoop.classification.InterfaceAudience.Private;
 
-public class ProcessorDescriptor extends TezEntityDescriptor {
+public class ProcessorDescriptor extends TezEntityDescriptor<ProcessorDescriptor> {
 
   @Private // for Writable
   public ProcessorDescriptor() {
@@ -30,22 +30,4 @@ public class ProcessorDescriptor extends TezEntityDescriptor {
   public ProcessorDescriptor(String processorClassName) {
     super(processorClassName);
   }
-
-  @Override
-  public ProcessorDescriptor setUserPayload(byte[] userPayload) {
-    super.setUserPayload(userPayload);
-    return this;
-  }
-
-  /**
-   * Provide a human-readable version of the user payload that can be
-   * used in the History UI
-   * @param historyText History text
-   */
-  @Override
-  public ProcessorDescriptor setHistoryText(String historyText) {
-    super.setHistoryText(historyText);
-    return this;
-  }
-
 }

http://git-wip-us.apache.org/repos/asf/tez/blob/da9bec23/tez-api/src/main/java/org/apache/tez/dag/api/TezEntityDescriptor.java
----------------------------------------------------------------------
diff --git a/tez-api/src/main/java/org/apache/tez/dag/api/TezEntityDescriptor.java b/tez-api/src/main/java/org/apache/tez/dag/api/TezEntityDescriptor.java
index 1047b09..f6fb671 100644
--- a/tez-api/src/main/java/org/apache/tez/dag/api/TezEntityDescriptor.java
+++ b/tez-api/src/main/java/org/apache/tez/dag/api/TezEntityDescriptor.java
@@ -27,7 +27,7 @@ import org.apache.hadoop.io.Text;
 import org.apache.hadoop.io.Writable;
 import org.apache.tez.common.TezUserPayload;
 
-public abstract class TezEntityDescriptor implements Writable {
+public abstract class TezEntityDescriptor<T extends TezEntityDescriptor<T>> implements
Writable {
 
   protected TezUserPayload userPayload;
   private String className;
@@ -50,9 +50,9 @@ public abstract class TezEntityDescriptor implements Writable {
    * @param userPayload User Payload
    * @return
    */
-  public TezEntityDescriptor setUserPayload(byte[] userPayload) {
+  public T setUserPayload(byte[] userPayload) {
     this.userPayload = DagTypeConverters.convertToTezUserPayload(userPayload);
-    return this;
+    return (T) this;
   }
 
   /**
@@ -60,9 +60,9 @@ public abstract class TezEntityDescriptor implements Writable {
    * used in the History UI
    * @param historyText History text
    */
-  public TezEntityDescriptor setHistoryText(String historyText) {
+  public T setHistoryText(String historyText) {
     this.historyText = historyText;
-    return this;
+    return (T) this;
   }
 
   @Private // Internal use only

http://git-wip-us.apache.org/repos/asf/tez/blob/da9bec23/tez-api/src/main/java/org/apache/tez/dag/api/VertexManagerPluginDescriptor.java
----------------------------------------------------------------------
diff --git a/tez-api/src/main/java/org/apache/tez/dag/api/VertexManagerPluginDescriptor.java
b/tez-api/src/main/java/org/apache/tez/dag/api/VertexManagerPluginDescriptor.java
index 3e72523..36cb47a 100644
--- a/tez-api/src/main/java/org/apache/tez/dag/api/VertexManagerPluginDescriptor.java
+++ b/tez-api/src/main/java/org/apache/tez/dag/api/VertexManagerPluginDescriptor.java
@@ -20,7 +20,7 @@ package org.apache.tez.dag.api;
 
 import org.apache.hadoop.classification.InterfaceAudience.Private;
 
-public class VertexManagerPluginDescriptor extends TezEntityDescriptor {
+public class VertexManagerPluginDescriptor extends TezEntityDescriptor<VertexManagerPluginDescriptor>
{
 
   @Private // for Writable
   public VertexManagerPluginDescriptor() {
@@ -30,22 +30,4 @@ public class VertexManagerPluginDescriptor extends TezEntityDescriptor
{
   public VertexManagerPluginDescriptor(String className) {
     super(className);
   }
-
-  @Override
-  public VertexManagerPluginDescriptor setUserPayload(byte[] userPayload) {
-    this.userPayload = DagTypeConverters.convertToTezUserPayload(userPayload);
-    return this;
-  }
-
-  /**
-   * Provide a human-readable version of the user payload that can be
-   * used in the History UI
-   * @param historyText History text
-   */
-  @Override
-  public VertexManagerPluginDescriptor setHistoryText(String historyText) {
-    super.setHistoryText(historyText);
-    return this;
-  }
-
 }


Mime
View raw message