Repository: hadoop
Updated Branches:
  refs/heads/HDFS-7240 8658ed7dc -> 8475d6bb5


HDFS-13301. Ozone: Remove containerPort, ratisPort and ozoneRestPort from 
DatanodeID and DatanodeIDProto. Contributed by Shashikant Banerjee.


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

Branch: refs/heads/HDFS-7240
Commit: 8475d6bb55c9b3e78478d6b9d1e4be65e5b604cf
Parents: 8658ed7
Author: Nanda kumar <na...@apache.org>
Authored: Sat Apr 7 01:39:08 2018 +0530
Committer: Nanda kumar <na...@apache.org>
Committed: Sat Apr 7 01:39:08 2018 +0530

----------------------------------------------------------------------
 .../apache/hadoop/hdfs/protocol/DatanodeID.java | 97 +-------------------
 .../hadoop/hdfs/protocolPB/PBHelperClient.java  | 14 +--
 .../src/main/proto/hdfs.proto                   |  3 -
 3 files changed, 5 insertions(+), 109 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/8475d6bb/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/DatanodeID.java
----------------------------------------------------------------------
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/DatanodeID.java
 
b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/DatanodeID.java
index 96f22ff..af720c7 100644
--- 
a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/DatanodeID.java
+++ 
b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/DatanodeID.java
@@ -22,7 +22,6 @@ import org.apache.hadoop.classification.InterfaceAudience;
 import org.apache.hadoop.classification.InterfaceStability;
 
 import com.google.common.annotations.VisibleForTesting;
-import org.apache.hadoop.hdfs.protocol.proto.HdfsProtos;
 
 import java.net.InetSocketAddress;
 
@@ -52,9 +51,6 @@ public class DatanodeID implements Comparable<DatanodeID> {
   private int infoSecurePort; // info server port
   private int ipcPort;       // IPC server port
   private String xferAddr;
-  private int containerPort; // container Stand_alone Rpc port.
-  private int ratisPort; // Container Ratis RPC Port.
-  private int ozoneRestPort;
 
   /**
    * UUID identifying a given datanode. For upgraded Datanodes this is the
@@ -76,12 +72,11 @@ public class DatanodeID implements Comparable<DatanodeID> {
         from.getInfoPort(),
         from.getInfoSecurePort(),
         from.getIpcPort());
-    this.ozoneRestPort = from.getOzoneRestPort();
     this.peerHostName = from.getPeerHostName();
   }
 
   /**
-   * Create a DatanodeID.
+   * Create a DatanodeID
    * @param ipAddr IP
    * @param hostName hostname
    * @param datanodeUuid data node ID, UUID for new Datanodes, may be the
@@ -269,8 +264,6 @@ public class DatanodeID implements Comparable<DatanodeID> {
     infoPort = nodeReg.getInfoPort();
     infoSecurePort = nodeReg.getInfoSecurePort();
     ipcPort = nodeReg.getIpcPort();
-    ratisPort = nodeReg.getRatisPort();
-    ozoneRestPort = nodeReg.getOzoneRestPort();
   }
 
   /**
@@ -284,94 +277,6 @@ public class DatanodeID implements Comparable<DatanodeID> {
     return getXferAddr().compareTo(that.getXferAddr());
   }
 
-  /**
-   * Returns the container port.
-   * @return Port
-   */
-  public int getContainerPort() {
-    return containerPort;
-  }
-
-  /**
-   * Sets the container port.
-   * @param containerPort - container port.
-   */
-  public void setContainerPort(int containerPort) {
-    this.containerPort = containerPort;
-  }
-
-  /**
-   * Gets the Ratis Port.
-   * @return retis port.
-   */
-  public int getRatisPort() {
-    return ratisPort;
-  }
-
-  /**
-   * Sets the Ratis Port.
-   * @param ratisPort - Ratis port.
-   */
-  public void setRatisPort(int ratisPort) {
-    this.ratisPort = ratisPort;
-  }
-
-  /**
-   * Ozone rest port.
-   *
-   * @return rest port.
-   */
-  public int getOzoneRestPort() {
-    return ozoneRestPort;
-  }
-
-  /**
-   * Set the ozone rest port.
-   *
-   * @param ozoneRestPort
-   */
-  public void setOzoneRestPort(int ozoneRestPort) {
-    this.ozoneRestPort = ozoneRestPort;
-  }
-
-  /**
-   * Returns a DataNode ID from the protocol buffers.
-   *
-   * @param datanodeIDProto - protoBuf Message
-   * @return DataNodeID
-   */
-  public static DatanodeID getFromProtoBuf(
-      HdfsProtos.DatanodeIDProto datanodeIDProto) {
-    DatanodeID id = new DatanodeID(datanodeIDProto.getIpAddr(),
-        datanodeIDProto.getHostName(), datanodeIDProto.getDatanodeUuid(),
-        datanodeIDProto.getXferPort(), datanodeIDProto.getInfoPort(),
-        datanodeIDProto.getInfoSecurePort(), datanodeIDProto.getIpcPort());
-    id.setContainerPort(datanodeIDProto.getContainerPort());
-    id.setRatisPort(datanodeIDProto.getRatisPort());
-    id.setOzoneRestPort(datanodeIDProto.getOzoneRestPort());
-    return id;
-  }
-
-  /**
-   * Returns a DataNodeID protobuf message from a datanode ID.
-   * @return HdfsProtos.DatanodeIDProto
-   */
-  public HdfsProtos.DatanodeIDProto getProtoBufMessage() {
-    HdfsProtos.DatanodeIDProto.Builder builder =
-        HdfsProtos.DatanodeIDProto.newBuilder();
-    return builder.setDatanodeUuid(this.getDatanodeUuid())
-        .setIpAddr(this.getIpAddr())
-        .setHostName(this.getHostName())
-        .setXferPort(this.getXferPort())
-        .setInfoPort(this.getInfoPort())
-        .setInfoSecurePort(this.getInfoSecurePort())
-        .setIpcPort(this.getIpcPort())
-        .setContainerPort(this.getContainerPort())
-        .setRatisPort(this.getRatisPort())
-        .setOzoneRestPort(this.getOzoneRestPort())
-        .build();
-  }
-
   public InetSocketAddress getResolvedAddress() {
     return new InetSocketAddress(this.getIpAddr(), this.getXferPort());
   }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/8475d6bb/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocolPB/PBHelperClient.java
----------------------------------------------------------------------
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocolPB/PBHelperClient.java
 
b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocolPB/PBHelperClient.java
index e94b094..d9e7aa0 100644
--- 
a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocolPB/PBHelperClient.java
+++ 
b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocolPB/PBHelperClient.java
@@ -292,9 +292,7 @@ public class PBHelperClient {
             dn.getDatanodeUuid() : "")
         .setInfoPort(dn.getInfoPort())
         .setInfoSecurePort(dn.getInfoSecurePort())
-        .setIpcPort(dn.getIpcPort())
-        .setOzoneRestPort(dn.getOzoneRestPort())
-        .build();
+        .setIpcPort(dn.getIpcPort()).build();
   }
 
   public static DatanodeInfoProto.AdminState convert(
@@ -744,13 +742,9 @@ public class PBHelperClient {
 
   // DatanodeId
   public static DatanodeID convert(DatanodeIDProto dn) {
-    DatanodeID datanodeID =
-        new DatanodeID(dn.getIpAddr(), dn.getHostName(), dn.getDatanodeUuid(),
-            dn.getXferPort(), dn.getInfoPort(),
-            dn.hasInfoSecurePort() ? dn.getInfoSecurePort() : 0,
-            dn.getIpcPort());
-    datanodeID.setOzoneRestPort(dn.getOzoneRestPort());
-    return datanodeID;
+    return new DatanodeID(dn.getIpAddr(), dn.getHostName(),
+        dn.getDatanodeUuid(), dn.getXferPort(), dn.getInfoPort(),
+        dn.hasInfoSecurePort() ? dn.getInfoSecurePort() : 0, dn.getIpcPort());
   }
 
   public static AdminStates convert(AdminState adminState) {

http://git-wip-us.apache.org/repos/asf/hadoop/blob/8475d6bb/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/hdfs.proto
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/hdfs.proto 
b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/hdfs.proto
index 4db2d58..29d0b4e 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/hdfs.proto
+++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/hdfs.proto
@@ -73,9 +73,6 @@ message DatanodeIDProto {
   required uint32 infoPort = 5;  // datanode http port
   required uint32 ipcPort = 6;   // ipc server port
   optional uint32 infoSecurePort = 7 [default = 0]; // datanode https port
-  optional uint32 containerPort = 8 [default = 0]; // Ozone stand_alone 
protocol
-  optional uint32 ratisPort = 9 [default = 0]; //Ozone ratis port
-  optional uint32 ozoneRestPort = 10 [default = 0];
 }
 
 /**


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-commits-h...@hadoop.apache.org

Reply via email to