|
@@ -99,6 +99,7 @@ import org.apache.hadoop.hdfs.protocol.HdfsConstants.SafeModeAction;
|
|
|
import org.apache.hadoop.hdfs.security.token.block.ExportedBlockKeys;
|
|
|
import org.apache.hadoop.hdfs.server.blockmanagement.BlockManager;
|
|
|
import org.apache.hadoop.hdfs.server.blockmanagement.BlockManagerTestUtil;
|
|
|
+import org.apache.hadoop.hdfs.server.datanode.DataNode;
|
|
|
import org.apache.hadoop.hdfs.server.federation.MiniRouterDFSCluster;
|
|
|
import org.apache.hadoop.hdfs.server.federation.MiniRouterDFSCluster.NamenodeContext;
|
|
|
import org.apache.hadoop.hdfs.server.federation.MiniRouterDFSCluster.RouterContext;
|
|
@@ -1934,4 +1935,16 @@ public class TestRouterRpc {
|
|
|
.contains("callerContext=clientContext,clientIp:"));
|
|
|
assertTrue(verifyFileExists(routerFS, dirPath));
|
|
|
}
|
|
|
+
|
|
|
+ @Test
|
|
|
+ public void testSetBalancerBandwidth() throws Exception {
|
|
|
+ long defaultBandwidth =
|
|
|
+ DFSConfigKeys.DFS_DATANODE_BALANCE_BANDWIDTHPERSEC_DEFAULT;
|
|
|
+ long newBandwidth = defaultBandwidth * 2;
|
|
|
+ routerProtocol.setBalancerBandwidth(newBandwidth);
|
|
|
+ ArrayList<DataNode> datanodes = cluster.getCluster().getDataNodes();
|
|
|
+ GenericTestUtils.waitFor(() -> {
|
|
|
+ return datanodes.get(0).getBalancerBandwidth() == newBandwidth;
|
|
|
+ }, 100, 60 * 1000);
|
|
|
+ }
|
|
|
}
|