Return-Path: X-Original-To: apmail-hadoop-hdfs-commits-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 46BE2F000 for ; Thu, 17 Jan 2013 18:22:00 +0000 (UTC) Received: (qmail 28501 invoked by uid 500); 17 Jan 2013 18:22:00 -0000 Delivered-To: apmail-hadoop-hdfs-commits-archive@hadoop.apache.org Received: (qmail 28427 invoked by uid 500); 17 Jan 2013 18:21:59 -0000 Mailing-List: contact hdfs-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-dev@hadoop.apache.org Delivered-To: mailing list hdfs-commits@hadoop.apache.org Received: (qmail 28410 invoked by uid 99); 17 Jan 2013 18:21:59 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Jan 2013 18:21:59 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Jan 2013 18:21:52 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id BB36323889E1; Thu, 17 Jan 2013 18:21:31 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1434844 - in /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs: ./ src/main/java/org/apache/hadoop/hdfs/protocolPB/ src/main/java/org/apache/hadoop/hdfs/qjournal/protocolPB/ src/main/proto/ Date: Thu, 17 Jan 2013 18:21:29 -0000 To: hdfs-commits@hadoop.apache.org From: suresh@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130117182131.BB36323889E1@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: suresh Date: Thu Jan 17 18:21:29 2013 New Revision: 1434844 URL: http://svn.apache.org/viewvc?rev=1434844&view=rev Log: HDFS-4393. Make empty request and responses in protocol translators can be static final members. Contributed by Brandon Li. Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/ClientDatanodeProtocolTranslatorPB.java hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/ClientNamenodeProtocolServerSideTranslatorPB.java hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/ClientNamenodeProtocolTranslatorPB.java hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/DatanodeProtocolClientSideTranslatorPB.java hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/DatanodeProtocolServerSideTranslatorPB.java hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/JournalProtocolServerSideTranslatorPB.java hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/NamenodeProtocolServerSideTranslatorPB.java hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/NamenodeProtocolTranslatorPB.java hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/RefreshAuthorizationPolicyProtocolClientSideTranslatorPB.java hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/RefreshAuthorizationPolicyProtocolServerSideTranslatorPB.java hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/RefreshUserMappingsProtocolClientSideTranslatorPB.java hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/RefreshUserMappingsProtocolServerSideTranslatorPB.java hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/protocolPB/QJournalProtocolServerSideTranslatorPB.java hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/ClientNamenodeProtocol.proto Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt?rev=1434844&r1=1434843&r2=1434844&view=diff ============================================================================== --- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt (original) +++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt Thu Jan 17 18:21:29 2013 @@ -491,6 +491,9 @@ Release 2.0.3-alpha - Unreleased HDFS-4392. Use NetUtils#getFreeSocketPort in MiniDFSCluster. (Andrew Purtell via suresh) + HDFS-4393. Make empty request and responses in protocol translators can be + static final members. (Brandon Li via suresh) + OPTIMIZATIONS HDFS-3429. DataNode reads checksums even if client does not need them (todd) Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/ClientDatanodeProtocolTranslatorPB.java URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/ClientDatanodeProtocolTranslatorPB.java?rev=1434844&r1=1434843&r2=1434844&view=diff ============================================================================== --- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/ClientDatanodeProtocolTranslatorPB.java (original) +++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/ClientDatanodeProtocolTranslatorPB.java Thu Jan 17 18:21:29 2013 @@ -77,7 +77,7 @@ public class ClientDatanodeProtocolTrans /** RpcController is not used and hence is set to null */ private final static RpcController NULL_CONTROLLER = null; private final ClientDatanodeProtocolPB rpcProxy; - private final static RefreshNamenodesRequestProto REFRESH_NAMENODES = + private final static RefreshNamenodesRequestProto VOID_REFRESH_NAMENODES = RefreshNamenodesRequestProto.newBuilder().build(); public ClientDatanodeProtocolTranslatorPB(DatanodeID datanodeid, @@ -170,7 +170,7 @@ public class ClientDatanodeProtocolTrans @Override public void refreshNamenodes() throws IOException { try { - rpcProxy.refreshNamenodes(NULL_CONTROLLER, REFRESH_NAMENODES); + rpcProxy.refreshNamenodes(NULL_CONTROLLER, VOID_REFRESH_NAMENODES); } catch (ServiceException e) { throw ProtobufHelper.getRemoteException(e); } Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/ClientNamenodeProtocolServerSideTranslatorPB.java URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/ClientNamenodeProtocolServerSideTranslatorPB.java?rev=1434844&r1=1434843&r2=1434844&view=diff ============================================================================== --- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/ClientNamenodeProtocolServerSideTranslatorPB.java (original) +++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/ClientNamenodeProtocolServerSideTranslatorPB.java Thu Jan 17 18:21:29 2013 @@ -148,6 +148,78 @@ public class ClientNamenodeProtocolServe ClientNamenodeProtocolPB { final private ClientProtocol server; + private static final CreateResponseProto VOID_CREATE_RESPONSE = + CreateResponseProto.newBuilder().build(); + + private static final AppendResponseProto VOID_APPEND_RESPONSE = + AppendResponseProto.newBuilder().build(); + + private static final SetPermissionResponseProto VOID_SET_PERM_RESPONSE = + SetPermissionResponseProto.newBuilder().build(); + + private static final SetOwnerResponseProto VOID_SET_OWNER_RESPONSE = + SetOwnerResponseProto.newBuilder().build(); + + private static final AbandonBlockResponseProto VOID_ADD_BLOCK_RESPONSE = + AbandonBlockResponseProto.newBuilder().build(); + + private static final ReportBadBlocksResponseProto VOID_REP_BAD_BLOCK_RESPONSE = + ReportBadBlocksResponseProto.newBuilder().build(); + + private static final ConcatResponseProto VOID_CONCAT_RESPONSE = + ConcatResponseProto.newBuilder().build(); + + private static final Rename2ResponseProto VOID_RENAME2_RESPONSE = + Rename2ResponseProto.newBuilder().build(); + + private static final GetListingResponseProto VOID_GETLISTING_RESPONSE = + GetListingResponseProto.newBuilder().build(); + + private static final RenewLeaseResponseProto VOID_RENEWLEASE_RESPONSE = + RenewLeaseResponseProto.newBuilder().build(); + + private static final SaveNamespaceResponseProto VOID_SAVENAMESPACE_RESPONSE = + SaveNamespaceResponseProto.newBuilder().build(); + + private static final RefreshNodesResponseProto VOID_REFRESHNODES_RESPONSE = + RefreshNodesResponseProto.newBuilder().build(); + + private static final FinalizeUpgradeResponseProto VOID_FINALIZEUPGRADE_RESPONSE = + FinalizeUpgradeResponseProto.newBuilder().build(); + + private static final MetaSaveResponseProto VOID_METASAVE_RESPONSE = + MetaSaveResponseProto.newBuilder().build(); + + private static final GetFileInfoResponseProto VOID_GETFILEINFO_RESPONSE = + GetFileInfoResponseProto.newBuilder().build(); + + private static final GetFileLinkInfoResponseProto VOID_GETFILELINKINFO_RESPONSE = + GetFileLinkInfoResponseProto.newBuilder().build(); + + private static final SetQuotaResponseProto VOID_SETQUOTA_RESPONSE = + SetQuotaResponseProto.newBuilder().build(); + + private static final FsyncResponseProto VOID_FSYNC_RESPONSE = + FsyncResponseProto.newBuilder().build(); + + private static final SetTimesResponseProto VOID_SETTIMES_RESPONSE = + SetTimesResponseProto.newBuilder().build(); + + private static final CreateSymlinkResponseProto VOID_CREATESYMLINK_RESPONSE = + CreateSymlinkResponseProto.newBuilder().build(); + + private static final UpdatePipelineResponseProto + VOID_UPDATEPIPELINE_RESPONSE = + UpdatePipelineResponseProto.newBuilder().build(); + + private static final CancelDelegationTokenResponseProto + VOID_CANCELDELEGATIONTOKEN_RESPONSE = + CancelDelegationTokenResponseProto.newBuilder().build(); + + private static final SetBalancerBandwidthResponseProto + VOID_SETBALANCERBANDWIDTH_RESPONSE = + SetBalancerBandwidthResponseProto.newBuilder().build(); + /** * Constructor * @@ -192,9 +264,6 @@ public class ClientNamenodeProtocolServe } - static final CreateResponseProto VOID_CREATE_RESPONSE = - CreateResponseProto.newBuilder().build(); - @Override public CreateResponseProto create(RpcController controller, CreateRequestProto req) throws ServiceException { @@ -209,9 +278,6 @@ public class ClientNamenodeProtocolServe return VOID_CREATE_RESPONSE; } - static final AppendResponseProto NULL_APPEND_RESPONSE = - AppendResponseProto.newBuilder().build(); - @Override public AppendResponseProto append(RpcController controller, AppendRequestProto req) throws ServiceException { @@ -221,7 +287,7 @@ public class ClientNamenodeProtocolServe return AppendResponseProto.newBuilder() .setBlock(PBHelper.convert(result)).build(); } - return NULL_APPEND_RESPONSE; + return VOID_APPEND_RESPONSE; } catch (IOException e) { throw new ServiceException(e); } @@ -240,9 +306,6 @@ public class ClientNamenodeProtocolServe } - static final SetPermissionResponseProto VOID_SET_PERM_RESPONSE = - SetPermissionResponseProto.newBuilder().build(); - @Override public SetPermissionResponseProto setPermission(RpcController controller, SetPermissionRequestProto req) throws ServiceException { @@ -254,9 +317,6 @@ public class ClientNamenodeProtocolServe return VOID_SET_PERM_RESPONSE; } - static final SetOwnerResponseProto VOID_SET_OWNER_RESPONSE = - SetOwnerResponseProto.newBuilder().build(); - @Override public SetOwnerResponseProto setOwner(RpcController controller, SetOwnerRequestProto req) throws ServiceException { @@ -270,9 +330,6 @@ public class ClientNamenodeProtocolServe return VOID_SET_OWNER_RESPONSE; } - static final AbandonBlockResponseProto VOID_ADD_BLOCK_RESPONSE = - AbandonBlockResponseProto.newBuilder().build(); - @Override public AbandonBlockResponseProto abandonBlock(RpcController controller, AbandonBlockRequestProto req) throws ServiceException { @@ -338,9 +395,6 @@ public class ClientNamenodeProtocolServe } } - static final ReportBadBlocksResponseProto VOID_REP_BAD_BLOCK_RESPONSE = - ReportBadBlocksResponseProto.newBuilder().build(); - @Override public ReportBadBlocksResponseProto reportBadBlocks(RpcController controller, ReportBadBlocksRequestProto req) throws ServiceException { @@ -354,9 +408,6 @@ public class ClientNamenodeProtocolServe return VOID_REP_BAD_BLOCK_RESPONSE; } - static final ConcatResponseProto VOID_CONCAT_RESPONSE = - ConcatResponseProto.newBuilder().build(); - @Override public ConcatResponseProto concat(RpcController controller, ConcatRequestProto req) throws ServiceException { @@ -380,9 +431,6 @@ public class ClientNamenodeProtocolServe } } - static final Rename2ResponseProto VOID_RENAME2_RESPONSE = - Rename2ResponseProto.newBuilder().build(); - @Override public Rename2ResponseProto rename2(RpcController controller, Rename2RequestProto req) throws ServiceException { @@ -419,8 +467,6 @@ public class ClientNamenodeProtocolServe } } - static final GetListingResponseProto NULL_GETLISTING_RESPONSE = - GetListingResponseProto.newBuilder().build(); @Override public GetListingResponseProto getListing(RpcController controller, GetListingRequestProto req) throws ServiceException { @@ -432,16 +478,13 @@ public class ClientNamenodeProtocolServe return GetListingResponseProto.newBuilder().setDirList( PBHelper.convert(result)).build(); } else { - return NULL_GETLISTING_RESPONSE; + return VOID_GETLISTING_RESPONSE; } } catch (IOException e) { throw new ServiceException(e); } } - static final RenewLeaseResponseProto VOID_RENEWLEASE_RESPONSE = - RenewLeaseResponseProto.newBuilder().build(); - @Override public RenewLeaseResponseProto renewLease(RpcController controller, RenewLeaseRequestProto req) throws ServiceException { @@ -526,9 +569,6 @@ public class ClientNamenodeProtocolServe } } - static final SaveNamespaceResponseProto VOID_SAVENAMESPACE_RESPONSE = - SaveNamespaceResponseProto.newBuilder().build(); - @Override public SaveNamespaceResponseProto saveNamespace(RpcController controller, SaveNamespaceRequestProto req) throws ServiceException { @@ -555,9 +595,6 @@ public class ClientNamenodeProtocolServe } - static final RefreshNodesResponseProto VOID_REFRESHNODES_RESPONSE = - RefreshNodesResponseProto.newBuilder().build(); - @Override public RefreshNodesResponseProto refreshNodes(RpcController controller, RefreshNodesRequestProto req) throws ServiceException { @@ -570,9 +607,6 @@ public class ClientNamenodeProtocolServe } - static final FinalizeUpgradeResponseProto VOID_FINALIZEUPGRADE_RESPONSE = - FinalizeUpgradeResponseProto.newBuilder().build(); - @Override public FinalizeUpgradeResponseProto finalizeUpgrade(RpcController controller, FinalizeUpgradeRequestProto req) throws ServiceException { @@ -599,9 +633,6 @@ public class ClientNamenodeProtocolServe } } - static final MetaSaveResponseProto VOID_METASAVE_RESPONSE = - MetaSaveResponseProto.newBuilder().build(); - @Override public MetaSaveResponseProto metaSave(RpcController controller, MetaSaveRequestProto req) throws ServiceException { @@ -614,8 +645,6 @@ public class ClientNamenodeProtocolServe } - static final GetFileInfoResponseProto NULL_GETFILEINFO_RESPONSE = - GetFileInfoResponseProto.newBuilder().build(); @Override public GetFileInfoResponseProto getFileInfo(RpcController controller, GetFileInfoRequestProto req) throws ServiceException { @@ -626,14 +655,12 @@ public class ClientNamenodeProtocolServe return GetFileInfoResponseProto.newBuilder().setFs( PBHelper.convert(result)).build(); } - return NULL_GETFILEINFO_RESPONSE; + return VOID_GETFILEINFO_RESPONSE; } catch (IOException e) { throw new ServiceException(e); } } - static final GetFileLinkInfoResponseProto NULL_GETFILELINKINFO_RESPONSE = - GetFileLinkInfoResponseProto.newBuilder().build(); @Override public GetFileLinkInfoResponseProto getFileLinkInfo(RpcController controller, GetFileLinkInfoRequestProto req) throws ServiceException { @@ -645,7 +672,7 @@ public class ClientNamenodeProtocolServe PBHelper.convert(result)).build(); } else { System.out.println("got null result for getFileLinkInfo for " + req.getSrc()); - return NULL_GETFILELINKINFO_RESPONSE; + return VOID_GETFILELINKINFO_RESPONSE; } } catch (IOException e) { @@ -666,9 +693,6 @@ public class ClientNamenodeProtocolServe } } - static final SetQuotaResponseProto VOID_SETQUOTA_RESPONSE = - SetQuotaResponseProto.newBuilder().build(); - @Override public SetQuotaResponseProto setQuota(RpcController controller, SetQuotaRequestProto req) throws ServiceException { @@ -681,9 +705,6 @@ public class ClientNamenodeProtocolServe } } - static final FsyncResponseProto VOID_FSYNC_RESPONSE = - FsyncResponseProto.newBuilder().build(); - @Override public FsyncResponseProto fsync(RpcController controller, FsyncRequestProto req) throws ServiceException { @@ -695,9 +716,6 @@ public class ClientNamenodeProtocolServe } } - static final SetTimesResponseProto VOID_SETTIMES_RESPONSE = - SetTimesResponseProto.newBuilder().build(); - @Override public SetTimesResponseProto setTimes(RpcController controller, SetTimesRequestProto req) throws ServiceException { @@ -709,9 +727,6 @@ public class ClientNamenodeProtocolServe } } - static final CreateSymlinkResponseProto VOID_CREATESYMLINK_RESPONSE = - CreateSymlinkResponseProto.newBuilder().build(); - @Override public CreateSymlinkResponseProto createSymlink(RpcController controller, CreateSymlinkRequestProto req) throws ServiceException { @@ -755,9 +770,6 @@ public class ClientNamenodeProtocolServe } } - static final UpdatePipelineResponseProto VOID_UPDATEPIPELINE_RESPONSE = - UpdatePipelineResponseProto.newBuilder().build(); - @Override public UpdatePipelineResponseProto updatePipeline(RpcController controller, UpdatePipelineRequestProto req) throws ServiceException { @@ -805,10 +817,6 @@ public class ClientNamenodeProtocolServe } } - static final CancelDelegationTokenResponseProto - VOID_CANCELDELEGATIONTOKEN_RESPONSE = - CancelDelegationTokenResponseProto.newBuilder().build(); - @Override public CancelDelegationTokenResponseProto cancelDelegationToken( RpcController controller, CancelDelegationTokenRequestProto req) @@ -822,10 +830,6 @@ public class ClientNamenodeProtocolServe } } - static final SetBalancerBandwidthResponseProto - VOID_SETBALANCERBANDWIDTH_RESPONSE = - SetBalancerBandwidthResponseProto.newBuilder().build(); - @Override public SetBalancerBandwidthResponseProto setBalancerBandwidth( RpcController controller, SetBalancerBandwidthRequestProto req) Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/ClientNamenodeProtocolTranslatorPB.java URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/ClientNamenodeProtocolTranslatorPB.java?rev=1434844&r1=1434843&r2=1434844&view=diff ============================================================================== --- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/ClientNamenodeProtocolTranslatorPB.java (original) +++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/ClientNamenodeProtocolTranslatorPB.java Thu Jan 17 18:21:29 2013 @@ -129,6 +129,29 @@ public class ClientNamenodeProtocolTrans ProtocolMetaInterface, ClientProtocol, Closeable, ProtocolTranslator { final private ClientNamenodeProtocolPB rpcProxy; + static final GetServerDefaultsRequestProto VOID_GET_SERVER_DEFAULT_REQUEST = + GetServerDefaultsRequestProto.newBuilder().build(); + + private final static GetFsStatusRequestProto VOID_GET_FSSTATUS_REQUEST = + GetFsStatusRequestProto.newBuilder().build(); + + private final static SaveNamespaceRequestProto VOID_SAVE_NAMESPACE_REQUEST = + SaveNamespaceRequestProto.newBuilder().build(); + + private final static RollEditsRequestProto VOID_ROLLEDITS_REQUEST = + RollEditsRequestProto.getDefaultInstance(); + + private final static RefreshNodesRequestProto VOID_REFRESH_NODES_REQUEST = + RefreshNodesRequestProto.newBuilder().build(); + + private final static FinalizeUpgradeRequestProto + VOID_FINALIZE_UPGRADE_REQUEST = + FinalizeUpgradeRequestProto.newBuilder().build(); + + private final static GetDataEncryptionKeyRequestProto + VOID_GET_DATA_ENCRYPTIONKEY_REQUEST = + GetDataEncryptionKeyRequestProto.newBuilder().build(); + public ClientNamenodeProtocolTranslatorPB(ClientNamenodeProtocolPB proxy) { rpcProxy = proxy; } @@ -160,7 +183,7 @@ public class ClientNamenodeProtocolTrans @Override public FsServerDefaults getServerDefaults() throws IOException { - GetServerDefaultsRequestProto req = GetServerDefaultsRequestProto.newBuilder().build(); + GetServerDefaultsRequestProto req = VOID_GET_SERVER_DEFAULT_REQUEST; try { return PBHelper .convert(rpcProxy.getServerDefaults(null, req).getServerDefaults()); @@ -473,9 +496,9 @@ public class ClientNamenodeProtocolTrans @Override public long[] getStats() throws IOException { - GetFsStatusRequestProto req = GetFsStatusRequestProto.newBuilder().build(); try { - return PBHelper.convert(rpcProxy.getFsStats(null, req)); + return PBHelper.convert(rpcProxy.getFsStats(null, + VOID_GET_FSSTATUS_REQUEST)); } catch (ServiceException e) { throw ProtobufHelper.getRemoteException(e); } @@ -522,10 +545,8 @@ public class ClientNamenodeProtocolTrans @Override public void saveNamespace() throws AccessControlException, IOException { - SaveNamespaceRequestProto req = SaveNamespaceRequestProto.newBuilder() - .build(); try { - rpcProxy.saveNamespace(null, req); + rpcProxy.saveNamespace(null, VOID_SAVE_NAMESPACE_REQUEST); } catch (ServiceException e) { throw ProtobufHelper.getRemoteException(e); } @@ -533,9 +554,9 @@ public class ClientNamenodeProtocolTrans @Override public long rollEdits() throws AccessControlException, IOException { - RollEditsRequestProto req = RollEditsRequestProto.getDefaultInstance(); try { - RollEditsResponseProto resp = rpcProxy.rollEdits(null, req); + RollEditsResponseProto resp = rpcProxy.rollEdits(null, + VOID_ROLLEDITS_REQUEST); return resp.getNewSegmentTxId(); } catch (ServiceException se) { throw ProtobufHelper.getRemoteException(se); @@ -557,9 +578,8 @@ public class ClientNamenodeProtocolTrans @Override public void refreshNodes() throws IOException { - RefreshNodesRequestProto req = RefreshNodesRequestProto.newBuilder().build(); try { - rpcProxy.refreshNodes(null, req); + rpcProxy.refreshNodes(null, VOID_REFRESH_NODES_REQUEST); } catch (ServiceException e) { throw ProtobufHelper.getRemoteException(e); } @@ -567,9 +587,8 @@ public class ClientNamenodeProtocolTrans @Override public void finalizeUpgrade() throws IOException { - FinalizeUpgradeRequestProto req = FinalizeUpgradeRequestProto.newBuilder().build(); try { - rpcProxy.finalizeUpgrade(null, req); + rpcProxy.finalizeUpgrade(null, VOID_FINALIZE_UPGRADE_REQUEST); } catch (ServiceException e) { throw ProtobufHelper.getRemoteException(e); } @@ -818,12 +837,10 @@ public class ClientNamenodeProtocolTrans @Override public DataEncryptionKey getDataEncryptionKey() throws IOException { - GetDataEncryptionKeyRequestProto req = GetDataEncryptionKeyRequestProto - .newBuilder().build(); try { - GetDataEncryptionKeyResponseProto rsp = - rpcProxy.getDataEncryptionKey(null, req); - return rsp.hasDataEncryptionKey() ? + GetDataEncryptionKeyResponseProto rsp = rpcProxy.getDataEncryptionKey( + null, VOID_GET_DATA_ENCRYPTIONKEY_REQUEST); + return rsp.hasDataEncryptionKey() ? PBHelper.convert(rsp.getDataEncryptionKey()) : null; } catch (ServiceException e) { throw ProtobufHelper.getRemoteException(e); Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/DatanodeProtocolClientSideTranslatorPB.java URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/DatanodeProtocolClientSideTranslatorPB.java?rev=1434844&r1=1434843&r2=1434844&view=diff ============================================================================== --- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/DatanodeProtocolClientSideTranslatorPB.java (original) +++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/DatanodeProtocolClientSideTranslatorPB.java Thu Jan 17 18:21:29 2013 @@ -84,7 +84,7 @@ public class DatanodeProtocolClientSideT /** RpcController is not used and hence is set to null */ private final DatanodeProtocolPB rpcProxy; - private static final VersionRequestProto VERSION_REQUEST = + private static final VersionRequestProto VOID_VERSION_REQUEST = VersionRequestProto.newBuilder().build(); private final static RpcController NULL_CONTROLLER = null; @@ -243,7 +243,7 @@ public class DatanodeProtocolClientSideT public NamespaceInfo versionRequest() throws IOException { try { return PBHelper.convert(rpcProxy.versionRequest(NULL_CONTROLLER, - VERSION_REQUEST).getInfo()); + VOID_VERSION_REQUEST).getInfo()); } catch (ServiceException e) { throw ProtobufHelper.getRemoteException(e); } Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/DatanodeProtocolServerSideTranslatorPB.java URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/DatanodeProtocolServerSideTranslatorPB.java?rev=1434844&r1=1434843&r2=1434844&view=diff ============================================================================== --- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/DatanodeProtocolServerSideTranslatorPB.java (original) +++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/DatanodeProtocolServerSideTranslatorPB.java Thu Jan 17 18:21:29 2013 @@ -62,15 +62,17 @@ public class DatanodeProtocolServerSideT DatanodeProtocolPB { private final DatanodeProtocol impl; - private static final ErrorReportResponseProto ERROR_REPORT_RESPONSE_PROTO = - ErrorReportResponseProto.newBuilder().build(); + private static final ErrorReportResponseProto + VOID_ERROR_REPORT_RESPONSE_PROTO = + ErrorReportResponseProto.newBuilder().build(); private static final BlockReceivedAndDeletedResponseProto - BLOCK_RECEIVED_AND_DELETE_RESPONSE = + VOID_BLOCK_RECEIVED_AND_DELETE_RESPONSE = BlockReceivedAndDeletedResponseProto.newBuilder().build(); - private static final ReportBadBlocksResponseProto REPORT_BAD_BLOCK_RESPONSE = - ReportBadBlocksResponseProto.newBuilder().build(); + private static final ReportBadBlocksResponseProto + VOID_REPORT_BAD_BLOCK_RESPONSE = + ReportBadBlocksResponseProto.newBuilder().build(); private static final CommitBlockSynchronizationResponseProto - COMMIT_BLOCK_SYNCHRONIZATION_RESPONSE_PROTO = + VOID_COMMIT_BLOCK_SYNCHRONIZATION_RESPONSE_PROTO = CommitBlockSynchronizationResponseProto.newBuilder().build(); public DatanodeProtocolServerSideTranslatorPB(DatanodeProtocol impl) { @@ -180,7 +182,7 @@ public class DatanodeProtocolServerSideT } catch (IOException e) { throw new ServiceException(e); } - return BLOCK_RECEIVED_AND_DELETE_RESPONSE; + return VOID_BLOCK_RECEIVED_AND_DELETE_RESPONSE; } @Override @@ -192,7 +194,7 @@ public class DatanodeProtocolServerSideT } catch (IOException e) { throw new ServiceException(e); } - return ERROR_REPORT_RESPONSE_PROTO; + return VOID_ERROR_REPORT_RESPONSE_PROTO; } @Override @@ -221,7 +223,7 @@ public class DatanodeProtocolServerSideT } catch (IOException e) { throw new ServiceException(e); } - return REPORT_BAD_BLOCK_RESPONSE; + return VOID_REPORT_BAD_BLOCK_RESPONSE; } @Override @@ -242,6 +244,6 @@ public class DatanodeProtocolServerSideT } catch (IOException e) { throw new ServiceException(e); } - return COMMIT_BLOCK_SYNCHRONIZATION_RESPONSE_PROTO; + return VOID_COMMIT_BLOCK_SYNCHRONIZATION_RESPONSE_PROTO; } } Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/JournalProtocolServerSideTranslatorPB.java URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/JournalProtocolServerSideTranslatorPB.java?rev=1434844&r1=1434843&r2=1434844&view=diff ============================================================================== --- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/JournalProtocolServerSideTranslatorPB.java (original) +++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/JournalProtocolServerSideTranslatorPB.java Thu Jan 17 18:21:29 2013 @@ -42,6 +42,13 @@ public class JournalProtocolServerSideTr /** Server side implementation to delegate the requests to */ private final JournalProtocol impl; + private final static JournalResponseProto VOID_JOURNAL_RESPONSE = + JournalResponseProto.newBuilder().build(); + + private final static StartLogSegmentResponseProto + VOID_START_LOG_SEGMENT_RESPONSE = + StartLogSegmentResponseProto.newBuilder().build(); + public JournalProtocolServerSideTranslatorPB(JournalProtocol impl) { this.impl = impl; } @@ -56,7 +63,7 @@ public class JournalProtocolServerSideTr } catch (IOException e) { throw new ServiceException(e); } - return JournalResponseProto.newBuilder().build(); + return VOID_JOURNAL_RESPONSE; } /** @see JournalProtocol#startLogSegment */ @@ -69,7 +76,7 @@ public class JournalProtocolServerSideTr } catch (IOException e) { throw new ServiceException(e); } - return StartLogSegmentResponseProto.newBuilder().build(); + return VOID_START_LOG_SEGMENT_RESPONSE; } @Override Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/NamenodeProtocolServerSideTranslatorPB.java URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/NamenodeProtocolServerSideTranslatorPB.java?rev=1434844&r1=1434843&r2=1434844&view=diff ============================================================================== --- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/NamenodeProtocolServerSideTranslatorPB.java (original) +++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/NamenodeProtocolServerSideTranslatorPB.java Thu Jan 17 18:21:29 2013 @@ -63,6 +63,12 @@ public class NamenodeProtocolServerSideT NamenodeProtocolPB { private final NamenodeProtocol impl; + private final static ErrorReportResponseProto VOID_ERROR_REPORT_RESPONSE = + ErrorReportResponseProto.newBuilder().build(); + + private final static EndCheckpointResponseProto VOID_END_CHECKPOINT_RESPONSE = + EndCheckpointResponseProto.newBuilder().build(); + public NamenodeProtocolServerSideTranslatorPB(NamenodeProtocol impl) { this.impl = impl; } @@ -147,7 +153,7 @@ public class NamenodeProtocolServerSideT } catch (IOException e) { throw new ServiceException(e); } - return ErrorReportResponseProto.newBuilder().build(); + return VOID_ERROR_REPORT_RESPONSE; } @Override @@ -185,7 +191,7 @@ public class NamenodeProtocolServerSideT } catch (IOException e) { throw new ServiceException(e); } - return EndCheckpointResponseProto.newBuilder().build(); + return VOID_END_CHECKPOINT_RESPONSE; } @Override Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/NamenodeProtocolTranslatorPB.java URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/NamenodeProtocolTranslatorPB.java?rev=1434844&r1=1434843&r2=1434844&view=diff ============================================================================== --- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/NamenodeProtocolTranslatorPB.java (original) +++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/NamenodeProtocolTranslatorPB.java Thu Jan 17 18:21:29 2013 @@ -68,13 +68,13 @@ public class NamenodeProtocolTranslatorP /* * Protobuf requests with no parameters instantiated only once */ - private static final GetBlockKeysRequestProto GET_BLOCKKEYS = + private static final GetBlockKeysRequestProto VOID_GET_BLOCKKEYS_REQUEST = GetBlockKeysRequestProto.newBuilder().build(); - private static final GetTransactionIdRequestProto GET_TRANSACTIONID = + private static final GetTransactionIdRequestProto VOID_GET_TRANSACTIONID_REQUEST = GetTransactionIdRequestProto.newBuilder().build(); - private static final RollEditLogRequestProto ROLL_EDITLOG = + private static final RollEditLogRequestProto VOID_ROLL_EDITLOG_REQUEST = RollEditLogRequestProto.newBuilder().build(); - private static final VersionRequestProto VERSION_REQUEST = + private static final VersionRequestProto VOID_VERSION_REQUEST = VersionRequestProto.newBuilder().build(); final private NamenodeProtocolPB rpcProxy; @@ -106,7 +106,7 @@ public class NamenodeProtocolTranslatorP public ExportedBlockKeys getBlockKeys() throws IOException { try { GetBlockKeysResponseProto rsp = rpcProxy.getBlockKeys(NULL_CONTROLLER, - GET_BLOCKKEYS); + VOID_GET_BLOCKKEYS_REQUEST); return rsp.hasKeys() ? PBHelper.convert(rsp.getKeys()) : null; } catch (ServiceException e) { throw ProtobufHelper.getRemoteException(e); @@ -116,8 +116,8 @@ public class NamenodeProtocolTranslatorP @Override public long getTransactionID() throws IOException { try { - return rpcProxy.getTransactionId(NULL_CONTROLLER, GET_TRANSACTIONID) - .getTxId(); + return rpcProxy.getTransactionId(NULL_CONTROLLER, + VOID_GET_TRANSACTIONID_REQUEST).getTxId(); } catch (ServiceException e) { throw ProtobufHelper.getRemoteException(e); } @@ -137,7 +137,7 @@ public class NamenodeProtocolTranslatorP public CheckpointSignature rollEditLog() throws IOException { try { return PBHelper.convert(rpcProxy.rollEditLog(NULL_CONTROLLER, - ROLL_EDITLOG).getSignature()); + VOID_ROLL_EDITLOG_REQUEST).getSignature()); } catch (ServiceException e) { throw ProtobufHelper.getRemoteException(e); } @@ -147,7 +147,7 @@ public class NamenodeProtocolTranslatorP public NamespaceInfo versionRequest() throws IOException { try { return PBHelper.convert(rpcProxy.versionRequest(NULL_CONTROLLER, - VERSION_REQUEST).getInfo()); + VOID_VERSION_REQUEST).getInfo()); } catch (ServiceException e) { throw ProtobufHelper.getRemoteException(e); } Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/RefreshAuthorizationPolicyProtocolClientSideTranslatorPB.java URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/RefreshAuthorizationPolicyProtocolClientSideTranslatorPB.java?rev=1434844&r1=1434843&r2=1434844&view=diff ============================================================================== --- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/RefreshAuthorizationPolicyProtocolClientSideTranslatorPB.java (original) +++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/RefreshAuthorizationPolicyProtocolClientSideTranslatorPB.java Thu Jan 17 18:21:29 2013 @@ -38,6 +38,10 @@ public class RefreshAuthorizationPolicyP private final static RpcController NULL_CONTROLLER = null; private final RefreshAuthorizationPolicyProtocolPB rpcProxy; + private final static RefreshServiceAclRequestProto + VOID_REFRESH_SERVICE_ACL_REQUEST = + RefreshServiceAclRequestProto.newBuilder().build(); + public RefreshAuthorizationPolicyProtocolClientSideTranslatorPB( RefreshAuthorizationPolicyProtocolPB rpcProxy) { this.rpcProxy = rpcProxy; @@ -50,10 +54,9 @@ public class RefreshAuthorizationPolicyP @Override public void refreshServiceAcl() throws IOException { - RefreshServiceAclRequestProto request = RefreshServiceAclRequestProto - .newBuilder().build(); try { - rpcProxy.refreshServiceAcl(NULL_CONTROLLER, request); + rpcProxy.refreshServiceAcl(NULL_CONTROLLER, + VOID_REFRESH_SERVICE_ACL_REQUEST); } catch (ServiceException se) { throw ProtobufHelper.getRemoteException(se); } Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/RefreshAuthorizationPolicyProtocolServerSideTranslatorPB.java URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/RefreshAuthorizationPolicyProtocolServerSideTranslatorPB.java?rev=1434844&r1=1434843&r2=1434844&view=diff ============================================================================== --- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/RefreshAuthorizationPolicyProtocolServerSideTranslatorPB.java (original) +++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/RefreshAuthorizationPolicyProtocolServerSideTranslatorPB.java Thu Jan 17 18:21:29 2013 @@ -32,6 +32,10 @@ public class RefreshAuthorizationPolicyP private final RefreshAuthorizationPolicyProtocol impl; + private final static RefreshServiceAclResponseProto + VOID_REFRESH_SERVICE_ACL_RESPONSE = RefreshServiceAclResponseProto + .newBuilder().build(); + public RefreshAuthorizationPolicyProtocolServerSideTranslatorPB( RefreshAuthorizationPolicyProtocol impl) { this.impl = impl; @@ -46,6 +50,6 @@ public class RefreshAuthorizationPolicyP } catch (IOException e) { throw new ServiceException(e); } - return RefreshServiceAclResponseProto.newBuilder().build(); + return VOID_REFRESH_SERVICE_ACL_RESPONSE; } } Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/RefreshUserMappingsProtocolClientSideTranslatorPB.java URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/RefreshUserMappingsProtocolClientSideTranslatorPB.java?rev=1434844&r1=1434843&r2=1434844&view=diff ============================================================================== --- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/RefreshUserMappingsProtocolClientSideTranslatorPB.java (original) +++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/RefreshUserMappingsProtocolClientSideTranslatorPB.java Thu Jan 17 18:21:29 2013 @@ -39,6 +39,14 @@ public class RefreshUserMappingsProtocol private final static RpcController NULL_CONTROLLER = null; private final RefreshUserMappingsProtocolPB rpcProxy; + private final static RefreshUserToGroupsMappingsRequestProto + VOID_REFRESH_USER_TO_GROUPS_MAPPING_REQUEST = + RefreshUserToGroupsMappingsRequestProto.newBuilder().build(); + + private final static RefreshSuperUserGroupsConfigurationRequestProto + VOID_REFRESH_SUPERUSER_GROUPS_CONFIGURATION_REQUEST = + RefreshSuperUserGroupsConfigurationRequestProto.newBuilder().build(); + public RefreshUserMappingsProtocolClientSideTranslatorPB( RefreshUserMappingsProtocolPB rpcProxy) { this.rpcProxy = rpcProxy; @@ -51,10 +59,9 @@ public class RefreshUserMappingsProtocol @Override public void refreshUserToGroupsMappings() throws IOException { - RefreshUserToGroupsMappingsRequestProto request = - RefreshUserToGroupsMappingsRequestProto.newBuilder().build(); try { - rpcProxy.refreshUserToGroupsMappings(NULL_CONTROLLER, request); + rpcProxy.refreshUserToGroupsMappings(NULL_CONTROLLER, + VOID_REFRESH_USER_TO_GROUPS_MAPPING_REQUEST); } catch (ServiceException se) { throw ProtobufHelper.getRemoteException(se); } @@ -62,10 +69,9 @@ public class RefreshUserMappingsProtocol @Override public void refreshSuperUserGroupsConfiguration() throws IOException { - RefreshSuperUserGroupsConfigurationRequestProto request = - RefreshSuperUserGroupsConfigurationRequestProto.newBuilder().build(); try { - rpcProxy.refreshSuperUserGroupsConfiguration(NULL_CONTROLLER, request); + rpcProxy.refreshSuperUserGroupsConfiguration(NULL_CONTROLLER, + VOID_REFRESH_SUPERUSER_GROUPS_CONFIGURATION_REQUEST); } catch (ServiceException se) { throw ProtobufHelper.getRemoteException(se); } Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/RefreshUserMappingsProtocolServerSideTranslatorPB.java URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/RefreshUserMappingsProtocolServerSideTranslatorPB.java?rev=1434844&r1=1434843&r2=1434844&view=diff ============================================================================== --- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/RefreshUserMappingsProtocolServerSideTranslatorPB.java (original) +++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/RefreshUserMappingsProtocolServerSideTranslatorPB.java Thu Jan 17 18:21:29 2013 @@ -33,6 +33,15 @@ public class RefreshUserMappingsProtocol private final RefreshUserMappingsProtocol impl; + private final static RefreshUserToGroupsMappingsResponseProto + VOID_REFRESH_USER_GROUPS_MAPPING_RESPONSE = + RefreshUserToGroupsMappingsResponseProto.newBuilder().build(); + + private final static RefreshSuperUserGroupsConfigurationResponseProto + VOID_REFRESH_SUPERUSER_GROUPS_CONFIGURATION_RESPONSE = + RefreshSuperUserGroupsConfigurationResponseProto.newBuilder() + .build(); + public RefreshUserMappingsProtocolServerSideTranslatorPB(RefreshUserMappingsProtocol impl) { this.impl = impl; } @@ -47,7 +56,7 @@ public class RefreshUserMappingsProtocol } catch (IOException e) { throw new ServiceException(e); } - return RefreshUserToGroupsMappingsResponseProto.newBuilder().build(); + return VOID_REFRESH_USER_GROUPS_MAPPING_RESPONSE; } @Override @@ -60,7 +69,6 @@ public class RefreshUserMappingsProtocol } catch (IOException e) { throw new ServiceException(e); } - return RefreshSuperUserGroupsConfigurationResponseProto.newBuilder() - .build(); + return VOID_REFRESH_SUPERUSER_GROUPS_CONFIGURATION_RESPONSE; } } Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/protocolPB/QJournalProtocolServerSideTranslatorPB.java URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/protocolPB/QJournalProtocolServerSideTranslatorPB.java?rev=1434844&r1=1434843&r2=1434844&view=diff ============================================================================== --- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/protocolPB/QJournalProtocolServerSideTranslatorPB.java (original) +++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/protocolPB/QJournalProtocolServerSideTranslatorPB.java Thu Jan 17 18:21:29 2013 @@ -65,6 +65,13 @@ public class QJournalProtocolServerSideT /** Server side implementation to delegate the requests to */ private final QJournalProtocol impl; + private final static JournalResponseProto VOID_JOURNAL_RESPONSE = + JournalResponseProto.newBuilder().build(); + + private final static StartLogSegmentResponseProto + VOID_START_LOG_SEGMENT_RESPONSE = + StartLogSegmentResponseProto.newBuilder().build(); + public QJournalProtocolServerSideTranslatorPB(QJournalProtocol impl) { this.impl = impl; } @@ -135,7 +142,7 @@ public class QJournalProtocolServerSideT } catch (IOException e) { throw new ServiceException(e); } - return JournalResponseProto.newBuilder().build(); + return VOID_JOURNAL_RESPONSE; } /** @see JournalProtocol#heartbeat */ @@ -160,7 +167,7 @@ public class QJournalProtocolServerSideT } catch (IOException e) { throw new ServiceException(e); } - return StartLogSegmentResponseProto.newBuilder().build(); + return VOID_START_LOG_SEGMENT_RESPONSE; } @Override Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/ClientNamenodeProtocol.proto URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/ClientNamenodeProtocol.proto?rev=1434844&r1=1434843&r2=1434844&view=diff ============================================================================== --- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/ClientNamenodeProtocol.proto (original) +++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/ClientNamenodeProtocol.proto Thu Jan 17 18:21:29 2013 @@ -168,7 +168,7 @@ message RenameRequestProto { required string dst = 2; } -message RenameResponseProto { // void response +message RenameResponseProto { required bool result = 1; }