HDFS-14974. RBF: Make tests use free ports. Contributed by Inigo Goiri.

This commit is contained in:
Ayush Saxena 2019-11-18 15:49:36 +05:30
parent bd454348b0
commit 3b5a0e86c1

View File

@ -154,10 +154,23 @@ public Configuration build() {
conf.setBoolean(RBFConfigKeys.DFS_ROUTER_STORE_ENABLE, conf.setBoolean(RBFConfigKeys.DFS_ROUTER_STORE_ENABLE,
this.enableStateStore); this.enableStateStore);
conf.setBoolean(RBFConfigKeys.DFS_ROUTER_RPC_ENABLE, this.enableRpcServer); conf.setBoolean(RBFConfigKeys.DFS_ROUTER_RPC_ENABLE, this.enableRpcServer);
if (this.enableRpcServer) {
conf.set(RBFConfigKeys.DFS_ROUTER_RPC_ADDRESS_KEY, "127.0.0.1:0");
conf.set(RBFConfigKeys.DFS_ROUTER_RPC_BIND_HOST_KEY, "0.0.0.0");
}
conf.setBoolean(RBFConfigKeys.DFS_ROUTER_ADMIN_ENABLE, conf.setBoolean(RBFConfigKeys.DFS_ROUTER_ADMIN_ENABLE,
this.enableAdminServer); this.enableAdminServer);
if (this.enableAdminServer) {
conf.set(RBFConfigKeys.DFS_ROUTER_ADMIN_ADDRESS_KEY, "127.0.0.1:0");
conf.set(RBFConfigKeys.DFS_ROUTER_ADMIN_BIND_HOST_KEY, "0.0.0.0");
}
conf.setBoolean(RBFConfigKeys.DFS_ROUTER_HTTP_ENABLE, conf.setBoolean(RBFConfigKeys.DFS_ROUTER_HTTP_ENABLE,
this.enableHttpServer); this.enableHttpServer);
if (this.enableHttpServer) {
conf.set(RBFConfigKeys.DFS_ROUTER_HTTP_ADDRESS_KEY, "127.0.0.1:0");
conf.set(RBFConfigKeys.DFS_ROUTER_HTTPS_ADDRESS_KEY, "127.0.0.1:0");
conf.set(RBFConfigKeys.DFS_ROUTER_HTTP_BIND_HOST_KEY, "0.0.0.0");
}
conf.setBoolean(RBFConfigKeys.DFS_ROUTER_HEARTBEAT_ENABLE, conf.setBoolean(RBFConfigKeys.DFS_ROUTER_HEARTBEAT_ENABLE,
this.enableHeartbeat); this.enableHeartbeat);
conf.setBoolean(RBFConfigKeys.DFS_ROUTER_MONITOR_LOCAL_NAMENODE, conf.setBoolean(RBFConfigKeys.DFS_ROUTER_MONITOR_LOCAL_NAMENODE,