|
@@ -236,13 +236,6 @@ public class NameNode {
|
|
+ namenode.getHostName()+portString);
|
|
+ namenode.getHostName()+portString);
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * Compose a "host:port" string from the address.
|
|
|
|
- */
|
|
|
|
- public static String getHostPortString(InetSocketAddress addr) {
|
|
|
|
- return addr.getHostName() + ":" + addr.getPort();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
//
|
|
//
|
|
// Common NameNode methods implementation for the active name-node role.
|
|
// Common NameNode methods implementation for the active name-node role.
|
|
//
|
|
//
|
|
@@ -273,7 +266,7 @@ public class NameNode {
|
|
*/
|
|
*/
|
|
protected void setRpcServiceServerAddress(Configuration conf,
|
|
protected void setRpcServiceServerAddress(Configuration conf,
|
|
InetSocketAddress serviceRPCAddress) {
|
|
InetSocketAddress serviceRPCAddress) {
|
|
- setServiceAddress(conf, getHostPortString(serviceRPCAddress));
|
|
|
|
|
|
+ setServiceAddress(conf, NetUtils.getHostPortString(serviceRPCAddress));
|
|
}
|
|
}
|
|
|
|
|
|
protected void setRpcServerAddress(Configuration conf,
|
|
protected void setRpcServerAddress(Configuration conf,
|
|
@@ -293,7 +286,7 @@ public class NameNode {
|
|
|
|
|
|
protected void setHttpServerAddress(Configuration conf) {
|
|
protected void setHttpServerAddress(Configuration conf) {
|
|
conf.set(DFS_NAMENODE_HTTP_ADDRESS_KEY,
|
|
conf.set(DFS_NAMENODE_HTTP_ADDRESS_KEY,
|
|
- getHostPortString(getHttpAddress()));
|
|
|
|
|
|
+ NetUtils.getHostPortString(getHttpAddress()));
|
|
}
|
|
}
|
|
|
|
|
|
protected void loadNamesystem(Configuration conf) throws IOException {
|
|
protected void loadNamesystem(Configuration conf) throws IOException {
|
|
@@ -306,8 +299,8 @@ public class NameNode {
|
|
|
|
|
|
NamenodeRegistration setRegistration() {
|
|
NamenodeRegistration setRegistration() {
|
|
nodeRegistration = new NamenodeRegistration(
|
|
nodeRegistration = new NamenodeRegistration(
|
|
- getHostPortString(rpcServer.getRpcAddress()),
|
|
|
|
- getHostPortString(getHttpAddress()),
|
|
|
|
|
|
+ NetUtils.getHostPortString(rpcServer.getRpcAddress()),
|
|
|
|
+ NetUtils.getHostPortString(getHttpAddress()),
|
|
getFSImage().getStorage(), getRole());
|
|
getFSImage().getStorage(), getRole());
|
|
return nodeRegistration;
|
|
return nodeRegistration;
|
|
}
|
|
}
|