@Test public void testNamenodeRpcBindAny() throws IOException { Configuration conf = new HdfsConfiguration(); conf.set(DFS_NAMENODE_RPC_BIND_HOST_KEY, "0.0.0.0"); MiniDFSCluster cluster = null; try { cluster = new MiniDFSCluster.Builder(conf).build(); cluster.waitActive(); assertEquals("0.0.0.0", ((NameNodeRpcServer)cluster.getNameNodeRpc()) .getClientRpcServer().getListenerAddress().getHostName()); } finally { if (cluster != null) { cluster.shutdown(); } conf.unset(DFS_NAMENODE_RPC_BIND_HOST_KEY); } }
@VisibleForTesting RPC.Server getClientRpcServer() { return clientRpcServer; }
NameNodeRpcServer implements NamenodeProtocols { @VisibleForTesting RPC.Server getClientRpcServer() { return clientRpcServer; } }
NameNodeRpcServer implements NamenodeProtocols { @VisibleForTesting RPC.Server getClientRpcServer() { return clientRpcServer; } NameNodeRpcServer(Configuration conf, NameNode nn); }
NameNodeRpcServer implements NamenodeProtocols { @VisibleForTesting RPC.Server getClientRpcServer() { return clientRpcServer; } NameNodeRpcServer(Configuration conf, NameNode nn); @Override // NamenodeProtocol BlocksWithLocations getBlocks(DatanodeInfo datanode, long size); @Override // NamenodeProtocol ExportedBlockKeys getBlockKeys(); @Override // NamenodeProtocol void errorReport(NamenodeRegistration registration,
                          int errorCode, 
                          String msg); @Override // NamenodeProtocol NamenodeRegistration registerSubordinateNamenode(
      NamenodeRegistration registration); @Override // NamenodeProtocol NamenodeCommand startCheckpoint(NamenodeRegistration registration); @Override // NamenodeProtocol void endCheckpoint(NamenodeRegistration registration,
                            CheckpointSignature sig); @Override // ClientProtocol Token<DelegationTokenIdentifier> getDelegationToken(Text renewer); @Override // ClientProtocol long renewDelegationToken(Token<DelegationTokenIdentifier> token); @Override // ClientProtocol void cancelDelegationToken(Token<DelegationTokenIdentifier> token); @Override // ClientProtocol LocatedBlocks getBlockLocations(String src, 
                                          long offset, 
                                          long length); @Override // ClientProtocol FsServerDefaults getServerDefaults(); @Override // ClientProtocol HdfsFileStatus create(String src, FsPermission masked,
      String clientName, EnumSetWritable<CreateFlag> flag,
      boolean createParent, short replication, long blockSize, 
      CryptoProtocolVersion[] supportedVersions); @Override // ClientProtocol LocatedBlock append(String src, String clientName); @Override // ClientProtocol boolean recoverLease(String src, String clientName); @Override // ClientProtocol boolean setReplication(String src, short replication); @Override void setStoragePolicy(String src, String policyName); @Override BlockStoragePolicy[] getStoragePolicies(); @Override // ClientProtocol void setPermission(String src, FsPermission permissions); @Override // ClientProtocol void setOwner(String src, String username, String groupname); @Override LocatedBlock addBlock(String src, String clientName,
      ExtendedBlock previous, DatanodeInfo[] excludedNodes, long fileId,
      String[] favoredNodes); @Override // ClientProtocol LocatedBlock getAdditionalDatanode(final String src,
      final long fileId, final ExtendedBlock blk,
      final DatanodeInfo[] existings, final String[] existingStorageIDs,
      final DatanodeInfo[] excludes,
      final int numAdditionalNodes, final String clientName
      ); @Override // ClientProtocol void abandonBlock(ExtendedBlock b, long fileId, String src,
        String holder); @Override // ClientProtocol boolean complete(String src, String clientName,
                          ExtendedBlock last,  long fileId); @Override // ClientProtocol, DatanodeProtocol void reportBadBlocks(LocatedBlock[] blocks); @Override // ClientProtocol LocatedBlock updateBlockForPipeline(ExtendedBlock block, String clientName); @Override // ClientProtocol void updatePipeline(String clientName, ExtendedBlock oldBlock,
      ExtendedBlock newBlock, DatanodeID[] newNodes, String[] newStorageIDs); @Override // DatanodeProtocol void commitBlockSynchronization(ExtendedBlock block,
      long newgenerationstamp, long newlength,
      boolean closeFile, boolean deleteblock, DatanodeID[] newtargets,
      String[] newtargetstorages); @Override // ClientProtocol long getPreferredBlockSize(String filename); @Deprecated @Override // ClientProtocol boolean rename(String src, String dst); @Override // ClientProtocol void concat(String trg, String[] src); @Override // ClientProtocol void rename2(String src, String dst, Options.Rename... options); @Override // ClientProtocol boolean delete(String src, boolean recursive); @Override // ClientProtocol boolean mkdirs(String src, FsPermission masked, boolean createParent); @Override // ClientProtocol void renewLease(String clientName); @Override // ClientProtocol DirectoryListing getListing(String src, byte[] startAfter,
      boolean needLocation); @Override // ClientProtocol HdfsFileStatus getFileInfo(String src); @Override // ClientProtocol boolean isFileClosed(String src); @Override // ClientProtocol HdfsFileStatus getFileLinkInfo(String src); @Override // ClientProtocol long[] getStats(); @Override // ClientProtocol DatanodeInfo[] getDatanodeReport(DatanodeReportType type); @Override // ClientProtocol DatanodeStorageReport[] getDatanodeStorageReport(
      DatanodeReportType type); @Override // ClientProtocol boolean setSafeMode(SafeModeAction action, boolean isChecked); @Override // ClientProtocol boolean restoreFailedStorage(String arg); @Override // ClientProtocol void saveNamespace(); @Override // ClientProtocol long rollEdits(); @Override // ClientProtocol void refreshNodes(); @Override // NamenodeProtocol long getTransactionID(); @Override // NamenodeProtocol long getMostRecentCheckpointTxId(); @Override // NamenodeProtocol CheckpointSignature rollEditLog(); @Override // NamenodeProtocol RemoteEditLogManifest getEditLogManifest(long sinceTxId); @Override // NamenodeProtocol boolean isUpgradeFinalized(); @Override // ClientProtocol void finalizeUpgrade(); @Override // ClientProtocol RollingUpgradeInfo rollingUpgrade(RollingUpgradeAction action); @Override // ClientProtocol void metaSave(String filename); @Override // ClientProtocol CorruptFileBlocks listCorruptFileBlocks(String path, String cookie); @Override // ClientProtocol void setBalancerBandwidth(long bandwidth); @Override // ClientProtocol ContentSummary getContentSummary(String path); @Override // ClientProtocol void setQuota(String path, long namespaceQuota, long diskspaceQuota); @Override // ClientProtocol void fsync(String src, long fileId, String clientName,
                    long lastBlockLength); @Override // ClientProtocol void setTimes(String src, long mtime, long atime); @Override // ClientProtocol void createSymlink(String target, String link, FsPermission dirPerms,
      boolean createParent); @Override // ClientProtocol String getLinkTarget(String path); @Override // DatanodeProtocol DatanodeRegistration registerDatanode(DatanodeRegistration nodeReg); @Override // DatanodeProtocol HeartbeatResponse sendHeartbeat(DatanodeRegistration nodeReg,
      StorageReport[] report, long dnCacheCapacity, long dnCacheUsed,
      int xmitsInProgress, int xceiverCount,
      int failedVolumes); @Override // DatanodeProtocol DatanodeCommand blockReport(DatanodeRegistration nodeReg,
        String poolId, StorageBlockReport[] reports,
        BlockReportContext context); @Override DatanodeCommand cacheReport(DatanodeRegistration nodeReg,
      String poolId, List<Long> blockIds); @Override // DatanodeProtocol void blockReceivedAndDeleted(DatanodeRegistration nodeReg, String poolId,
      StorageReceivedDeletedBlocks[] receivedAndDeletedBlocks); @Override // DatanodeProtocol void errorReport(DatanodeRegistration nodeReg,
                          int errorCode, String msg); @Override // DatanodeProtocol, NamenodeProtocol NamespaceInfo versionRequest(); @Override // RefreshAuthorizationPolicyProtocol void refreshServiceAcl(); @Override // RefreshAuthorizationPolicyProtocol void refreshUserToGroupsMappings(); @Override // RefreshAuthorizationPolicyProtocol void refreshSuperUserGroupsConfiguration(); @Override // RefreshCallQueueProtocol void refreshCallQueue(); @Override // GenericRefreshProtocol Collection<RefreshResponse> refresh(String identifier, String[] args); @Override // GetUserMappingsProtocol String[] getGroupsForUser(String user); @Override // HAServiceProtocol synchronized void monitorHealth(); @Override // HAServiceProtocol synchronized void transitionToActive(StateChangeRequestInfo req); @Override // HAServiceProtocol synchronized void transitionToStandby(StateChangeRequestInfo req); @Override // HAServiceProtocol synchronized HAServiceStatus getServiceStatus(); @Override DataEncryptionKey getDataEncryptionKey(); @Override String createSnapshot(String snapshotRoot, String snapshotName); @Override void deleteSnapshot(String snapshotRoot, String snapshotName); @Override // Client Protocol void allowSnapshot(String snapshotRoot); @Override // Client Protocol void disallowSnapshot(String snapshot); @Override // ClientProtocol void renameSnapshot(String snapshotRoot, String snapshotOldName,
      String snapshotNewName); @Override // Client Protocol SnapshottableDirectoryStatus[] getSnapshottableDirListing(); @Override // ClientProtocol SnapshotDiffReport getSnapshotDiffReport(String snapshotRoot,
      String earlierSnapshotName, String laterSnapshotName); @Override // ClientProtocol long addCacheDirective(
      CacheDirectiveInfo path, EnumSet<CacheFlag> flags); @Override // ClientProtocol void modifyCacheDirective(
      CacheDirectiveInfo directive, EnumSet<CacheFlag> flags); @Override // ClientProtocol void removeCacheDirective(long id); @Override // ClientProtocol BatchedEntries<CacheDirectiveEntry> listCacheDirectives(long prevId,
      CacheDirectiveInfo filter); @Override //ClientProtocol void addCachePool(CachePoolInfo info); @Override // ClientProtocol void modifyCachePool(CachePoolInfo info); @Override // ClientProtocol void removeCachePool(String cachePoolName); @Override // ClientProtocol BatchedEntries<CachePoolEntry> listCachePools(String prevKey); @Override // ClientProtocol void modifyAclEntries(String src, List<AclEntry> aclSpec); @Override // ClienProtocol void removeAclEntries(String src, List<AclEntry> aclSpec); @Override // ClientProtocol void removeDefaultAcl(String src); @Override // ClientProtocol void removeAcl(String src); @Override // ClientProtocol void setAcl(String src, List<AclEntry> aclSpec); @Override // ClientProtocol AclStatus getAclStatus(String src); @Override // ClientProtocol void createEncryptionZone(String src, String keyName); @Override // ClientProtocol EncryptionZone getEZForPath(String src); @Override // ClientProtocol BatchedEntries<EncryptionZone> listEncryptionZones(
      long prevId); @Override // ClientProtocol void setXAttr(String src, XAttr xAttr, EnumSet<XAttrSetFlag> flag); @Override // ClientProtocol List<XAttr> getXAttrs(String src, List<XAttr> xAttrs); @Override // ClientProtocol List<XAttr> listXAttrs(String src); @Override // ClientProtocol void removeXAttr(String src, XAttr xAttr); @Override // ClientProtocol void checkAccess(String path, FsAction mode); @Override // ClientProtocol long getCurrentEditLogTxid(); @Override // ClientProtocol EventBatchList getEditsFromTxid(long txid); @Override // TraceAdminProtocol SpanReceiverInfo[] listSpanReceivers(); @Override // TraceAdminProtocol long addSpanReceiver(SpanReceiverInfo info); @Override // TraceAdminProtocol void removeSpanReceiver(long id); }
NameNodeRpcServer implements NamenodeProtocols { @VisibleForTesting RPC.Server getClientRpcServer() { return clientRpcServer; } NameNodeRpcServer(Configuration conf, NameNode nn); @Override // NamenodeProtocol BlocksWithLocations getBlocks(DatanodeInfo datanode, long size); @Override // NamenodeProtocol ExportedBlockKeys getBlockKeys(); @Override // NamenodeProtocol void errorReport(NamenodeRegistration registration,
                          int errorCode, 
                          String msg); @Override // NamenodeProtocol NamenodeRegistration registerSubordinateNamenode(
      NamenodeRegistration registration); @Override // NamenodeProtocol NamenodeCommand startCheckpoint(NamenodeRegistration registration); @Override // NamenodeProtocol void endCheckpoint(NamenodeRegistration registration,
                            CheckpointSignature sig); @Override // ClientProtocol Token<DelegationTokenIdentifier> getDelegationToken(Text renewer); @Override // ClientProtocol long renewDelegationToken(Token<DelegationTokenIdentifier> token); @Override // ClientProtocol void cancelDelegationToken(Token<DelegationTokenIdentifier> token); @Override // ClientProtocol LocatedBlocks getBlockLocations(String src, 
                                          long offset, 
                                          long length); @Override // ClientProtocol FsServerDefaults getServerDefaults(); @Override // ClientProtocol HdfsFileStatus create(String src, FsPermission masked,
      String clientName, EnumSetWritable<CreateFlag> flag,
      boolean createParent, short replication, long blockSize, 
      CryptoProtocolVersion[] supportedVersions); @Override // ClientProtocol LocatedBlock append(String src, String clientName); @Override // ClientProtocol boolean recoverLease(String src, String clientName); @Override // ClientProtocol boolean setReplication(String src, short replication); @Override void setStoragePolicy(String src, String policyName); @Override BlockStoragePolicy[] getStoragePolicies(); @Override // ClientProtocol void setPermission(String src, FsPermission permissions); @Override // ClientProtocol void setOwner(String src, String username, String groupname); @Override LocatedBlock addBlock(String src, String clientName,
      ExtendedBlock previous, DatanodeInfo[] excludedNodes, long fileId,
      String[] favoredNodes); @Override // ClientProtocol LocatedBlock getAdditionalDatanode(final String src,
      final long fileId, final ExtendedBlock blk,
      final DatanodeInfo[] existings, final String[] existingStorageIDs,
      final DatanodeInfo[] excludes,
      final int numAdditionalNodes, final String clientName
      ); @Override // ClientProtocol void abandonBlock(ExtendedBlock b, long fileId, String src,
        String holder); @Override // ClientProtocol boolean complete(String src, String clientName,
                          ExtendedBlock last,  long fileId); @Override // ClientProtocol, DatanodeProtocol void reportBadBlocks(LocatedBlock[] blocks); @Override // ClientProtocol LocatedBlock updateBlockForPipeline(ExtendedBlock block, String clientName); @Override // ClientProtocol void updatePipeline(String clientName, ExtendedBlock oldBlock,
      ExtendedBlock newBlock, DatanodeID[] newNodes, String[] newStorageIDs); @Override // DatanodeProtocol void commitBlockSynchronization(ExtendedBlock block,
      long newgenerationstamp, long newlength,
      boolean closeFile, boolean deleteblock, DatanodeID[] newtargets,
      String[] newtargetstorages); @Override // ClientProtocol long getPreferredBlockSize(String filename); @Deprecated @Override // ClientProtocol boolean rename(String src, String dst); @Override // ClientProtocol void concat(String trg, String[] src); @Override // ClientProtocol void rename2(String src, String dst, Options.Rename... options); @Override // ClientProtocol boolean delete(String src, boolean recursive); @Override // ClientProtocol boolean mkdirs(String src, FsPermission masked, boolean createParent); @Override // ClientProtocol void renewLease(String clientName); @Override // ClientProtocol DirectoryListing getListing(String src, byte[] startAfter,
      boolean needLocation); @Override // ClientProtocol HdfsFileStatus getFileInfo(String src); @Override // ClientProtocol boolean isFileClosed(String src); @Override // ClientProtocol HdfsFileStatus getFileLinkInfo(String src); @Override // ClientProtocol long[] getStats(); @Override // ClientProtocol DatanodeInfo[] getDatanodeReport(DatanodeReportType type); @Override // ClientProtocol DatanodeStorageReport[] getDatanodeStorageReport(
      DatanodeReportType type); @Override // ClientProtocol boolean setSafeMode(SafeModeAction action, boolean isChecked); @Override // ClientProtocol boolean restoreFailedStorage(String arg); @Override // ClientProtocol void saveNamespace(); @Override // ClientProtocol long rollEdits(); @Override // ClientProtocol void refreshNodes(); @Override // NamenodeProtocol long getTransactionID(); @Override // NamenodeProtocol long getMostRecentCheckpointTxId(); @Override // NamenodeProtocol CheckpointSignature rollEditLog(); @Override // NamenodeProtocol RemoteEditLogManifest getEditLogManifest(long sinceTxId); @Override // NamenodeProtocol boolean isUpgradeFinalized(); @Override // ClientProtocol void finalizeUpgrade(); @Override // ClientProtocol RollingUpgradeInfo rollingUpgrade(RollingUpgradeAction action); @Override // ClientProtocol void metaSave(String filename); @Override // ClientProtocol CorruptFileBlocks listCorruptFileBlocks(String path, String cookie); @Override // ClientProtocol void setBalancerBandwidth(long bandwidth); @Override // ClientProtocol ContentSummary getContentSummary(String path); @Override // ClientProtocol void setQuota(String path, long namespaceQuota, long diskspaceQuota); @Override // ClientProtocol void fsync(String src, long fileId, String clientName,
                    long lastBlockLength); @Override // ClientProtocol void setTimes(String src, long mtime, long atime); @Override // ClientProtocol void createSymlink(String target, String link, FsPermission dirPerms,
      boolean createParent); @Override // ClientProtocol String getLinkTarget(String path); @Override // DatanodeProtocol DatanodeRegistration registerDatanode(DatanodeRegistration nodeReg); @Override // DatanodeProtocol HeartbeatResponse sendHeartbeat(DatanodeRegistration nodeReg,
      StorageReport[] report, long dnCacheCapacity, long dnCacheUsed,
      int xmitsInProgress, int xceiverCount,
      int failedVolumes); @Override // DatanodeProtocol DatanodeCommand blockReport(DatanodeRegistration nodeReg,
        String poolId, StorageBlockReport[] reports,
        BlockReportContext context); @Override DatanodeCommand cacheReport(DatanodeRegistration nodeReg,
      String poolId, List<Long> blockIds); @Override // DatanodeProtocol void blockReceivedAndDeleted(DatanodeRegistration nodeReg, String poolId,
      StorageReceivedDeletedBlocks[] receivedAndDeletedBlocks); @Override // DatanodeProtocol void errorReport(DatanodeRegistration nodeReg,
                          int errorCode, String msg); @Override // DatanodeProtocol, NamenodeProtocol NamespaceInfo versionRequest(); @Override // RefreshAuthorizationPolicyProtocol void refreshServiceAcl(); @Override // RefreshAuthorizationPolicyProtocol void refreshUserToGroupsMappings(); @Override // RefreshAuthorizationPolicyProtocol void refreshSuperUserGroupsConfiguration(); @Override // RefreshCallQueueProtocol void refreshCallQueue(); @Override // GenericRefreshProtocol Collection<RefreshResponse> refresh(String identifier, String[] args); @Override // GetUserMappingsProtocol String[] getGroupsForUser(String user); @Override // HAServiceProtocol synchronized void monitorHealth(); @Override // HAServiceProtocol synchronized void transitionToActive(StateChangeRequestInfo req); @Override // HAServiceProtocol synchronized void transitionToStandby(StateChangeRequestInfo req); @Override // HAServiceProtocol synchronized HAServiceStatus getServiceStatus(); @Override DataEncryptionKey getDataEncryptionKey(); @Override String createSnapshot(String snapshotRoot, String snapshotName); @Override void deleteSnapshot(String snapshotRoot, String snapshotName); @Override // Client Protocol void allowSnapshot(String snapshotRoot); @Override // Client Protocol void disallowSnapshot(String snapshot); @Override // ClientProtocol void renameSnapshot(String snapshotRoot, String snapshotOldName,
      String snapshotNewName); @Override // Client Protocol SnapshottableDirectoryStatus[] getSnapshottableDirListing(); @Override // ClientProtocol SnapshotDiffReport getSnapshotDiffReport(String snapshotRoot,
      String earlierSnapshotName, String laterSnapshotName); @Override // ClientProtocol long addCacheDirective(
      CacheDirectiveInfo path, EnumSet<CacheFlag> flags); @Override // ClientProtocol void modifyCacheDirective(
      CacheDirectiveInfo directive, EnumSet<CacheFlag> flags); @Override // ClientProtocol void removeCacheDirective(long id); @Override // ClientProtocol BatchedEntries<CacheDirectiveEntry> listCacheDirectives(long prevId,
      CacheDirectiveInfo filter); @Override //ClientProtocol void addCachePool(CachePoolInfo info); @Override // ClientProtocol void modifyCachePool(CachePoolInfo info); @Override // ClientProtocol void removeCachePool(String cachePoolName); @Override // ClientProtocol BatchedEntries<CachePoolEntry> listCachePools(String prevKey); @Override // ClientProtocol void modifyAclEntries(String src, List<AclEntry> aclSpec); @Override // ClienProtocol void removeAclEntries(String src, List<AclEntry> aclSpec); @Override // ClientProtocol void removeDefaultAcl(String src); @Override // ClientProtocol void removeAcl(String src); @Override // ClientProtocol void setAcl(String src, List<AclEntry> aclSpec); @Override // ClientProtocol AclStatus getAclStatus(String src); @Override // ClientProtocol void createEncryptionZone(String src, String keyName); @Override // ClientProtocol EncryptionZone getEZForPath(String src); @Override // ClientProtocol BatchedEntries<EncryptionZone> listEncryptionZones(
      long prevId); @Override // ClientProtocol void setXAttr(String src, XAttr xAttr, EnumSet<XAttrSetFlag> flag); @Override // ClientProtocol List<XAttr> getXAttrs(String src, List<XAttr> xAttrs); @Override // ClientProtocol List<XAttr> listXAttrs(String src); @Override // ClientProtocol void removeXAttr(String src, XAttr xAttr); @Override // ClientProtocol void checkAccess(String path, FsAction mode); @Override // ClientProtocol long getCurrentEditLogTxid(); @Override // ClientProtocol EventBatchList getEditsFromTxid(long txid); @Override // TraceAdminProtocol SpanReceiverInfo[] listSpanReceivers(); @Override // TraceAdminProtocol long addSpanReceiver(SpanReceiverInfo info); @Override // TraceAdminProtocol void removeSpanReceiver(long id);  }