Search in sources :

Example 1 with MoveStep

use of org.apache.hadoop.hdfs.server.diskbalancer.planner.MoveStep in project hadoop by apache.

the class TestDiskBalancerWithMockMover method testCustomBandwidth.

/**
   * Test Custom bandwidth.
   *
   * @throws Exception
   */
@Test
public void testCustomBandwidth() throws Exception {
    MockMoverHelper mockMoverHelper = new MockMoverHelper().invoke();
    NodePlan plan = mockMoverHelper.getPlan();
    DiskBalancer balancer = mockMoverHelper.getBalancer();
    for (Step step : plan.getVolumeSetPlans()) {
        MoveStep tempStep = (MoveStep) step;
        tempStep.setBandwidth(100);
    }
    executeSubmitPlan(plan, balancer);
    DiskBalancerWorkStatus status = balancer.queryWorkStatus();
    assertNotNull(status);
    DiskBalancerWorkStatus.DiskBalancerWorkEntry entry = balancer.queryWorkStatus().getCurrentState().get(0);
    assertEquals(100L, entry.getWorkItem().getBandwidth());
}
Also used : NodePlan(org.apache.hadoop.hdfs.server.diskbalancer.planner.NodePlan) DiskBalancer(org.apache.hadoop.hdfs.server.datanode.DiskBalancer) Step(org.apache.hadoop.hdfs.server.diskbalancer.planner.Step) MoveStep(org.apache.hadoop.hdfs.server.diskbalancer.planner.MoveStep) DiskBalancerWorkStatus(org.apache.hadoop.hdfs.server.datanode.DiskBalancerWorkStatus) MoveStep(org.apache.hadoop.hdfs.server.diskbalancer.planner.MoveStep) Test(org.junit.Test)

Aggregations

DiskBalancer (org.apache.hadoop.hdfs.server.datanode.DiskBalancer)1 DiskBalancerWorkStatus (org.apache.hadoop.hdfs.server.datanode.DiskBalancerWorkStatus)1 MoveStep (org.apache.hadoop.hdfs.server.diskbalancer.planner.MoveStep)1 NodePlan (org.apache.hadoop.hdfs.server.diskbalancer.planner.NodePlan)1 Step (org.apache.hadoop.hdfs.server.diskbalancer.planner.Step)1 Test (org.junit.Test)1