NameNodeRpcServer implements NamenodeProtocols { @VisibleForTesting public RPC.Server getClientRpcServer() { return clientRpcServer; } NameNodeRpcServer(Configuration conf, NameNode nn); @VisibleForTesting RPC.Server getClientRpcServer(); @VisibleForTesting InetSocketAddress getRpcAddress(); @VisibleForTesting Set<InetSocketAddress> getAuxiliaryRpcAddresses(); @Override // NamenodeProtocol BlocksWithLocations getBlocks(DatanodeInfo datanode, long size, long
      minBlockSize); @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, String ecPolicyName,
      String storagePolicy); @Override // ClientProtocol LastBlockWithStatus append(String src, String clientName,
      EnumSetWritable<CreateFlag> flag); @Override // ClientProtocol boolean recoverLease(String src, String clientName); @Override // ClientProtocol boolean setReplication(String src, short replication); @Override void unsetStoragePolicy(String src); @Override void setStoragePolicy(String src, String policyName); @Override BlockStoragePolicy getStoragePolicy(String path); @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, EnumSet<AddBlockFlag> addBlockFlags); @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 truncate(String src, long newLength, String clientName); @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 BatchedDirectoryListing getBatchedListing(
      String[] srcs,
      byte[] startAfter,
      boolean needLocation); @Override // ClientProtocol HdfsFileStatus getFileInfo(String src); @Override // ClientProtocol HdfsLocatedFileStatus getLocatedFileInfo(String src,
      boolean needBlockToken); @Override // ClientProtocol boolean isFileClosed(String src); @Override // ClientProtocol HdfsFileStatus getFileLinkInfo(String src); @Override // ClientProtocol long[] getStats(); @Override // ClientProtocol ReplicatedBlockStats getReplicatedBlockStats(); @Override // ClientProtocol ECBlockGroupStats getECBlockGroupStats(); @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 boolean saveNamespace(long timeWindow, long txGap); @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 // NamenodeProtocol boolean isRollingUpgrade(); @Override // ClientProtocol void finalizeUpgrade(); @Override // ClientProtocol boolean upgradeStatus(); @Override // ClientProtocol RollingUpgradeInfo rollingUpgrade(RollingUpgradeAction action); @Override // ClientProtocol void metaSave(String filename); @Deprecated @Override // ClientProtocol BatchedEntries<OpenFileEntry> listOpenFiles(long prevId); @Override // ClientProtocol BatchedEntries<OpenFileEntry> listOpenFiles(long prevId,
      EnumSet<OpenFilesType> openFilesTypes, String path); @Override // ClientProtocol void msync(); @Override // ClientProtocol HAServiceState getHAServiceState(); @Override // ClientProtocol CorruptFileBlocks listCorruptFileBlocks(String path, String cookie); @Override // ClientProtocol void setBalancerBandwidth(long bandwidth); @Override // ClientProtocol ContentSummary getContentSummary(String path); @Override // ClientProtocol QuotaUsage getQuotaUsage(String path); @Override // ClientProtocol void satisfyStoragePolicy(String src); @Override // ClientProtocol void setQuota(String path, long namespaceQuota, long storagespaceQuota,
                       StorageType type); @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, VolumeFailureSummary volumeFailureSummary,
      boolean requestFullBlockReportLease,
      @Nonnull SlowPeerReports slowPeers,
      @Nonnull SlowDiskReports slowDisks); @Override // DatanodeProtocol DatanodeCommand blockReport(final DatanodeRegistration nodeReg,
        String poolId, final StorageBlockReport[] reports,
        final BlockReportContext context); @Override DatanodeCommand cacheReport(DatanodeRegistration nodeReg,
      String poolId, List<Long> blockIds); @Override // DatanodeProtocol void blockReceivedAndDeleted(final DatanodeRegistration nodeReg,
      String poolId, StorageReceivedDeletedBlocks[] receivedAndDeletedBlocks); @Override // DatanodeProtocol void errorReport(DatanodeRegistration nodeReg,
                          int errorCode, String msg); @Override // DatanodeProtocol, NamenodeProtocol NamespaceInfo versionRequest(); @Override // DatanodeLifelineProtocol void sendLifeline(DatanodeRegistration nodeReg, StorageReport[] report,
      long dnCacheCapacity, long dnCacheUsed, int xmitsInProgress,
      int xceiverCount, int failedVolumes,
      VolumeFailureSummary volumeFailureSummary); @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 void transitionToObserver(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 // Client Protocol SnapshotStatus[] getSnapshotListing(String snapshotRoot); @Override // ClientProtocol SnapshotDiffReport getSnapshotDiffReport(String snapshotRoot,
      String earlierSnapshotName, String laterSnapshotName); @Override // ClientProtocol SnapshotDiffReportListing getSnapshotDiffReportListing(
      String snapshotRoot, String earlierSnapshotName, String laterSnapshotName,
      byte[] startPath, int index); @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 reencryptEncryptionZone(final String zone,
      final ReencryptAction action); @Override // ClientProtocol BatchedEntries<ZoneReencryptionStatus> listReencryptionStatus(
      final long prevId); @Override // ClientProtocol void setErasureCodingPolicy(String src, String ecPolicyName); @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); @Override // ClientProtocol ErasureCodingPolicyInfo[] getErasureCodingPolicies(); @Override // ClientProtocol Map<String, String> getErasureCodingCodecs(); @Override // ClientProtocol ErasureCodingPolicy getErasureCodingPolicy(String src); @Override // ClientProtocol void unsetErasureCodingPolicy(String src); @Override ECTopologyVerifierResult getECTopologyResultForPolicies(
      String... policyNames); @Override AddErasureCodingPolicyResponse[] addErasureCodingPolicies(
      ErasureCodingPolicy[] policies); @Override void removeErasureCodingPolicy(String ecPolicyName); @Override // ClientProtocol void enableErasureCodingPolicy(String ecPolicyName); @Override // ClientProtocol void disableErasureCodingPolicy(String ecPolicyName); @Override // ReconfigurationProtocol void startReconfiguration(); @Override // ReconfigurationProtocol ReconfigurationTaskStatus getReconfigurationStatus(); @Override // ReconfigurationProtocol List<String> listReconfigurableProperties(); @Override Long getNextSPSPath();  }
@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); } }