String reconfigureIPCBackoffEnabled(String newVal) { boolean clientBackoffEnabled; if (newVal == null) { clientBackoffEnabled = IPC_BACKOFF_ENABLE_DEFAULT; } else { clientBackoffEnabled = Boolean.parseBoolean(newVal); } rpcServer.getClientRpcServer() .setClientBackoffEnabled(clientBackoffEnabled); return Boolean.toString(clientBackoffEnabled); }
private void initReconfigurableBackoffKey() { ipcClientRPCBackoffEnable = buildBackoffEnableKey(rpcServer .getClientRpcServer().getPort()); reconfigurableProperties.add(ipcClientRPCBackoffEnable); }
public void queueExternalCall(ExternalCall<?> extCall) throws IOException, InterruptedException { if (rpcServer == null) { throw new RetriableException("Namenode is in startup mode"); } rpcServer.getClientRpcServer().queueCall(extCall); }
private static String getRpcServerAddress(MiniDFSCluster cluster) { NameNodeRpcServer rpcServer = (NameNodeRpcServer) cluster.getNameNodeRpc(); return rpcServer.getClientRpcServer().getListenerAddress().getAddress().toString(); }
@Test public void testNamenodeRpcBindAny() throws IOException { Configuration conf = new HdfsConfiguration(); // The name node in MiniDFSCluster only binds to 127.0.0.1. // We can set the bind address to 0.0.0.0 to make it listen // to all interfaces. 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(); } // Reset the config conf.unset(DFS_NAMENODE_RPC_BIND_HOST_KEY); } } }