use of org.apache.hadoop.hdfs.protocol.ReconfigurationProtocol in project hadoop by apache.
the class DFSAdmin method startReconfigurationDispatch.
int startReconfigurationDispatch(final String nodeType, final String address, final PrintStream out, final PrintStream err) throws IOException {
if ("namenode".equals(nodeType)) {
ReconfigurationProtocol reconfProxy = getNameNodeProxy(address);
reconfProxy.startReconfiguration();
return 0;
} else if ("datanode".equals(nodeType)) {
ClientDatanodeProtocol reconfProxy = getDataNodeProxy(address);
reconfProxy.startReconfiguration();
return 0;
} else {
System.err.println("Node type " + nodeType + " does not support reconfiguration.");
return 1;
}
}
use of org.apache.hadoop.hdfs.protocol.ReconfigurationProtocol in project hadoop by apache.
the class DFSAdmin method getNameNodeProxy.
private ReconfigurationProtocol getNameNodeProxy(String node) throws IOException {
InetSocketAddress nodeAddr = NetUtils.createSocketAddr(node);
// Get the current configuration
Configuration conf = getConf();
// For namenode proxy the server principal should be NN's one.
conf.set(CommonConfigurationKeys.HADOOP_SECURITY_SERVICE_USER_NAME_KEY, conf.get(DFSConfigKeys.DFS_NAMENODE_KERBEROS_PRINCIPAL_KEY, ""));
// Create the client
ReconfigurationProtocol reconfigProtocol = DFSUtilClient.createReconfigurationProtocolProxy(nodeAddr, getUGI(), conf, NetUtils.getSocketFactory(conf, ReconfigurationProtocol.class));
return reconfigProtocol;
}
Aggregations