hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From msi...@apache.org
Subject hadoop git commit: HDDS-23. Remove SCMNodeAddressList from SCMRegisterRequestProto. Contributed by Nanda Kumar.
Date Tue, 08 May 2018 13:05:54 GMT
Repository: hadoop
Updated Branches:
  refs/heads/trunk 745058372 -> d72c16516


HDDS-23. Remove SCMNodeAddressList from SCMRegisterRequestProto. Contributed by Nanda Kumar.


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

Branch: refs/heads/trunk
Commit: d72c16516184479e82a73d3e211e2883be779908
Parents: 7450583
Author: Mukul Kumar Singh <msingh@apache.org>
Authored: Tue May 8 18:11:33 2018 +0530
Committer: Mukul Kumar Singh <msingh@apache.org>
Committed: Tue May 8 18:11:33 2018 +0530

----------------------------------------------------------------------
 .../common/states/endpoint/RegisterEndpointTask.java        | 3 +--
 .../ozone/protocol/StorageContainerDatanodeProtocol.java    | 7 +++----
 ...rageContainerDatanodeProtocolClientSideTranslatorPB.java | 3 +--
 ...rageContainerDatanodeProtocolServerSideTranslatorPB.java | 9 +--------
 .../src/main/proto/StorageContainerDatanodeProtocol.proto   | 1 -
 .../apache/hadoop/ozone/container/common/ScmTestMock.java   | 4 +---
 .../hadoop/hdds/scm/server/SCMDatanodeProtocolServer.java   | 7 +++----
 .../apache/hadoop/ozone/container/common/TestEndPoint.java  | 4 +---
 8 files changed, 11 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/d72c1651/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/states/endpoint/RegisterEndpointTask.java
----------------------------------------------------------------------
diff --git a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/states/endpoint/RegisterEndpointTask.java
b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/states/endpoint/RegisterEndpointTask.java
index ca3bef0..42568e3 100644
--- a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/states/endpoint/RegisterEndpointTask.java
+++ b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/states/endpoint/RegisterEndpointTask.java
@@ -99,8 +99,7 @@ public final class RegisterEndpointTask implements
 
       // TODO : Add responses to the command Queue.
       SCMRegisteredCmdResponseProto response = rpcEndPoint.getEndPoint()
-          .register(datanodeDetails.getProtoBufMessage(),
-              conf.getStrings(ScmConfigKeys.OZONE_SCM_NAMES));
+          .register(datanodeDetails.getProtoBufMessage());
       Preconditions.checkState(UUID.fromString(response.getDatanodeUUID())
               .equals(datanodeDetails.getUuid()),
           "Unexpected datanode ID in the response.");

http://git-wip-us.apache.org/repos/asf/hadoop/blob/d72c1651/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/protocol/StorageContainerDatanodeProtocol.java
----------------------------------------------------------------------
diff --git a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/protocol/StorageContainerDatanodeProtocol.java
b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/protocol/StorageContainerDatanodeProtocol.java
index 43e7412..cb657276 100644
--- a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/protocol/StorageContainerDatanodeProtocol.java
+++ b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/protocol/StorageContainerDatanodeProtocol.java
@@ -69,12 +69,11 @@ public interface StorageContainerDatanodeProtocol {
   /**
    * Register Datanode.
    * @param datanodeDetails - Datanode Details.
-   * @param scmAddresses - List of SCMs this datanode is configured to
-   *                     communicate.
+   *
    * @return SCM Command.
    */
-  SCMRegisteredCmdResponseProto register(DatanodeDetailsProto datanodeDetails,
-      String[] scmAddresses) throws IOException;
+  SCMRegisteredCmdResponseProto register(DatanodeDetailsProto datanodeDetails)
+      throws IOException;
 
   /**
    * Send a container report.

http://git-wip-us.apache.org/repos/asf/hadoop/blob/d72c1651/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/protocolPB/StorageContainerDatanodeProtocolClientSideTranslatorPB.java
----------------------------------------------------------------------
diff --git a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/protocolPB/StorageContainerDatanodeProtocolClientSideTranslatorPB.java
b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/protocolPB/StorageContainerDatanodeProtocolClientSideTranslatorPB.java
index 12fed1c..13162de 100644
--- a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/protocolPB/StorageContainerDatanodeProtocolClientSideTranslatorPB.java
+++ b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/protocolPB/StorageContainerDatanodeProtocolClientSideTranslatorPB.java
@@ -156,8 +156,7 @@ public class StorageContainerDatanodeProtocolClientSideTranslatorPB
    */
   @Override
   public SCMRegisteredCmdResponseProto register(
-      DatanodeDetailsProto datanodeDetailsProto,
-      String[] scmAddresses) throws IOException {
+      DatanodeDetailsProto datanodeDetailsProto) throws IOException {
     SCMRegisterRequestProto.Builder req =
         SCMRegisterRequestProto.newBuilder();
     req.setDatanodeDetails(datanodeDetailsProto);

http://git-wip-us.apache.org/repos/asf/hadoop/blob/d72c1651/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/protocolPB/StorageContainerDatanodeProtocolServerSideTranslatorPB.java
----------------------------------------------------------------------
diff --git a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/protocolPB/StorageContainerDatanodeProtocolServerSideTranslatorPB.java
b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/protocolPB/StorageContainerDatanodeProtocolServerSideTranslatorPB.java
index 985b75a..25757aa 100644
--- a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/protocolPB/StorageContainerDatanodeProtocolServerSideTranslatorPB.java
+++ b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/protocolPB/StorageContainerDatanodeProtocolServerSideTranslatorPB.java
@@ -68,15 +68,8 @@ public class StorageContainerDatanodeProtocolServerSideTranslatorPB
   public StorageContainerDatanodeProtocolProtos.SCMRegisteredCmdResponseProto
       register(RpcController controller, StorageContainerDatanodeProtocolProtos
       .SCMRegisterRequestProto request) throws ServiceException {
-    String[] addressArray = null;
-
-    if (request.hasAddressList()) {
-      addressArray = request.getAddressList().getAddressListList()
-          .toArray(new String[0]);
-    }
-
     try {
-      return impl.register(request.getDatanodeDetails(), addressArray);
+      return impl.register(request.getDatanodeDetails());
     } catch (IOException e) {
       throw new ServiceException(e);
     }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/d72c1651/hadoop-hdds/container-service/src/main/proto/StorageContainerDatanodeProtocol.proto
----------------------------------------------------------------------
diff --git a/hadoop-hdds/container-service/src/main/proto/StorageContainerDatanodeProtocol.proto
b/hadoop-hdds/container-service/src/main/proto/StorageContainerDatanodeProtocol.proto
index bc7fb7a..4d5795a 100644
--- a/hadoop-hdds/container-service/src/main/proto/StorageContainerDatanodeProtocol.proto
+++ b/hadoop-hdds/container-service/src/main/proto/StorageContainerDatanodeProtocol.proto
@@ -146,7 +146,6 @@ message SCMStorageReport {
 
 message SCMRegisterRequestProto {
   required DatanodeDetailsProto datanodeDetails = 1;
-  optional SCMNodeAddressList addressList = 2;
 }
 
 /**

http://git-wip-us.apache.org/repos/asf/hadoop/blob/d72c1651/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/ScmTestMock.java
----------------------------------------------------------------------
diff --git a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/ScmTestMock.java
b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/ScmTestMock.java
index 764ccfd..703878c 100644
--- a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/ScmTestMock.java
+++ b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/ScmTestMock.java
@@ -195,14 +195,12 @@ public class ScmTestMock implements StorageContainerDatanodeProtocol
{
    * Register Datanode.
    *
    * @param datanodeDetailsProto DatanodDetailsProto.
-   * @param scmAddresses - List of SCMs this datanode is configured to
-   * communicate.
    * @return SCM Command.
    */
   @Override
   public StorageContainerDatanodeProtocolProtos
       .SCMRegisteredCmdResponseProto register(
-          DatanodeDetailsProto datanodeDetailsProto, String[] scmAddresses)
+          DatanodeDetailsProto datanodeDetailsProto)
       throws IOException {
     rpcCount.incrementAndGet();
     sleepIfNeeded();

http://git-wip-us.apache.org/repos/asf/hadoop/blob/d72c1651/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/SCMDatanodeProtocolServer.java
----------------------------------------------------------------------
diff --git a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/SCMDatanodeProtocolServer.java
b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/SCMDatanodeProtocolServer.java
index e42b887..cb7a484 100644
--- a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/SCMDatanodeProtocolServer.java
+++ b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/SCMDatanodeProtocolServer.java
@@ -167,17 +167,16 @@ public class SCMDatanodeProtocolServer implements
 
   @Override
   public SCMRegisteredCmdResponseProto register(
-      HddsProtos.DatanodeDetailsProto datanodeDetails, String[] scmAddresses)
+      HddsProtos.DatanodeDetailsProto datanodeDetails)
       throws IOException {
     // TODO : Return the list of Nodes that forms the SCM HA.
     return getRegisteredResponse(scm.getScmNodeManager()
-        .register(datanodeDetails), null);
+        .register(datanodeDetails));
   }
 
   @VisibleForTesting
   public static SCMRegisteredCmdResponseProto getRegisteredResponse(
-        SCMCommand cmd,
-        StorageContainerDatanodeProtocolProtos.SCMNodeAddressList addressList) {
+        SCMCommand cmd) {
     Preconditions.checkState(cmd.getClass() == RegisteredCommand.class);
     RegisteredCommand rCmd = (RegisteredCommand) cmd;
     SCMCmdType type = cmd.getType();

http://git-wip-us.apache.org/repos/asf/hadoop/blob/d72c1651/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/ozone/container/common/TestEndPoint.java
----------------------------------------------------------------------
diff --git a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/ozone/container/common/TestEndPoint.java
b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/ozone/container/common/TestEndPoint.java
index ebfe978..0f9125b 100644
--- a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/ozone/container/common/TestEndPoint.java
+++ b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/ozone/container/common/TestEndPoint.java
@@ -203,14 +203,12 @@ public class TestEndPoint {
 
   @Test
   public void testRegister() throws Exception {
-    String[] scmAddressArray = new String[1];
-    scmAddressArray[0] = serverAddress.toString();
     DatanodeDetails nodeToRegister = getDatanodeDetails();
     try (EndpointStateMachine rpcEndPoint =
              createEndpoint(
                  SCMTestUtils.getConf(), serverAddress, 1000)) {
       SCMRegisteredCmdResponseProto responseProto = rpcEndPoint.getEndPoint()
-          .register(nodeToRegister.getProtoBufMessage(), scmAddressArray);
+          .register(nodeToRegister.getProtoBufMessage());
       Assert.assertNotNull(responseProto);
       Assert.assertEquals(nodeToRegister.getUuidString(),
           responseProto.getDatanodeUUID());


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


Mime
View raw message