From 5694c3404016b07d285c54e0f440317df5971391 Mon Sep 17 00:00:00 2001 From: Chris Nauroth Date: Sat, 15 Jun 2013 03:52:40 +0000 Subject: [PATCH] HDFS-4866. Protocol buffer support cannot compile under C. Contributed by Arpit Agarwal. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1493300 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../NamenodeProtocolServerSideTranslatorPB.java | 8 +++++--- .../hdfs/protocolPB/NamenodeProtocolTranslatorPB.java | 7 ++++--- .../apache/hadoop/hdfs/server/namenode/BackupNode.java | 2 +- .../hadoop/hdfs/server/namenode/NameNodeRpcServer.java | 4 ++-- .../hadoop/hdfs/server/protocol/NamenodeProtocol.java | 4 ++-- .../hadoop-hdfs/src/main/proto/NamenodeProtocol.proto | 2 +- 7 files changed, 18 insertions(+), 12 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 55f69afe49..e8ba482f98 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -251,6 +251,9 @@ Release 2.1.0-beta - UNRELEASED HDFS-2802. Add HDFS Snapshot feature. (See breakdown of tasks below for subtasks and contributors) + HDFS-4866. Protocol buffer support cannot compile under C. (Arpit Agarwal via + cnauroth) + NEW FEATURES HDFS-1804. Add a new block-volume device choosing policy that looks at diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/NamenodeProtocolServerSideTranslatorPB.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/NamenodeProtocolServerSideTranslatorPB.java index aaf8c46129..284808e55e 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/NamenodeProtocolServerSideTranslatorPB.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/NamenodeProtocolServerSideTranslatorPB.java @@ -157,11 +157,13 @@ public class NamenodeProtocolServerSideTranslatorPB implements } @Override - public RegisterResponseProto register(RpcController unused, - RegisterRequestProto request) throws ServiceException { + public RegisterResponseProto registerSubordinateNamenode( + RpcController unused, RegisterRequestProto request) + throws ServiceException { NamenodeRegistration reg; try { - reg = impl.register(PBHelper.convert(request.getRegistration())); + reg = impl.registerSubordinateNamenode( + PBHelper.convert(request.getRegistration())); } catch (IOException e) { throw new ServiceException(e); } diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/NamenodeProtocolTranslatorPB.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/NamenodeProtocolTranslatorPB.java index 918f6843ac..87f105c7d8 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/NamenodeProtocolTranslatorPB.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/NamenodeProtocolTranslatorPB.java @@ -167,12 +167,13 @@ public class NamenodeProtocolTranslatorPB implements NamenodeProtocol, } @Override - public NamenodeRegistration register(NamenodeRegistration registration) - throws IOException { + public NamenodeRegistration registerSubordinateNamenode( + NamenodeRegistration registration) throws IOException { RegisterRequestProto req = RegisterRequestProto.newBuilder() .setRegistration(PBHelper.convert(registration)).build(); try { - return PBHelper.convert(rpcProxy.register(NULL_CONTROLLER, req) + return PBHelper.convert( + rpcProxy.registerSubordinateNamenode(NULL_CONTROLLER, req) .getRegistration()); } catch (ServiceException e) { throw ProtobufHelper.getRemoteException(e); diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/BackupNode.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/BackupNode.java index 077a953690..44f0f3ef8b 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/BackupNode.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/BackupNode.java @@ -371,7 +371,7 @@ public class BackupNode extends NameNode { NamenodeRegistration nnReg = null; while(!isStopRequested()) { try { - nnReg = namenode.register(getRegistration()); + nnReg = namenode.registerSubordinateNamenode(getRegistration()); break; } catch(SocketTimeoutException e) { // name-node is busy LOG.info("Problem connecting to name-node: " + nnRpcAddress); diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeRpcServer.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeRpcServer.java index 6a535ad29d..e21ca931b4 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeRpcServer.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeRpcServer.java @@ -383,8 +383,8 @@ class NameNodeRpcServer implements NamenodeProtocols { } @Override // NamenodeProtocol - public NamenodeRegistration register(NamenodeRegistration registration) - throws IOException { + public NamenodeRegistration registerSubordinateNamenode( + NamenodeRegistration registration) throws IOException { namesystem.checkSuperuserPrivilege(); verifyLayoutVersion(registration.getVersion()); NamenodeRegistration myRegistration = nn.setRegistration(); diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/NamenodeProtocol.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/NamenodeProtocol.java index 44574697cd..d9bae652b7 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/NamenodeProtocol.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/NamenodeProtocol.java @@ -134,8 +134,8 @@ public interface NamenodeProtocol { * @return {@link NamenodeRegistration} of the node, * which this node has just registered with. */ - public NamenodeRegistration register(NamenodeRegistration registration) - throws IOException; + public NamenodeRegistration registerSubordinateNamenode( + NamenodeRegistration registration) throws IOException; /** * A request to the active name-node to start a checkpoint. diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/NamenodeProtocol.proto b/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/NamenodeProtocol.proto index 24e72fa2f9..b268108a3d 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/NamenodeProtocol.proto +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/NamenodeProtocol.proto @@ -225,7 +225,7 @@ service NamenodeProtocolService { /** * Request to register a sub-ordinate namenode */ - rpc register(RegisterRequestProto) returns(RegisterResponseProto); + rpc registerSubordinateNamenode(RegisterRequestProto) returns(RegisterResponseProto); /** * Request to start a checkpoint.