mirror of https://github.com/apache/druid.git
update
This commit is contained in:
parent
3eda9dc5f2
commit
72758e1345
|
@ -45,12 +45,13 @@ public class BalancerCostAnalyzer
|
||||||
private static final Logger log = new Logger(BalancerCostAnalyzer.class);
|
private static final Logger log = new Logger(BalancerCostAnalyzer.class);
|
||||||
private static final int MAX_SEGMENTS_TO_MOVE = 5;
|
private static final int MAX_SEGMENTS_TO_MOVE = 5;
|
||||||
private static final int DAY_IN_MILLIS = 1000 * 60 * 60 * 24;
|
private static final int DAY_IN_MILLIS = 1000 * 60 * 60 * 24;
|
||||||
private float initialTotalCost;
|
|
||||||
private float totalCostChange;
|
|
||||||
|
|
||||||
private List<ServerHolder> serverHolderList;
|
private List<ServerHolder> serverHolderList;
|
||||||
private Random rand;
|
private Random rand;
|
||||||
|
|
||||||
|
private float initialTotalCost;
|
||||||
|
private float totalCostChange;
|
||||||
|
|
||||||
public BalancerCostAnalyzer(){
|
public BalancerCostAnalyzer(){
|
||||||
rand = new Random(0);
|
rand = new Random(0);
|
||||||
totalCostChange = 0f;
|
totalCostChange = 0f;
|
||||||
|
@ -170,7 +171,6 @@ public class BalancerCostAnalyzer
|
||||||
);
|
);
|
||||||
totalCostChange += currCost - minPair.lhs;
|
totalCostChange += currCost - minPair.lhs;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return segmentHoldersToMove;
|
return segmentHoldersToMove;
|
||||||
|
|
|
@ -184,5 +184,6 @@ public class DruidMasterBalancerTest
|
||||||
|
|
||||||
params = new DruidMasterBalancer(master, new BalancerCostAnalyzer()).run(params);
|
params = new DruidMasterBalancer(master, new BalancerCostAnalyzer()).run(params);
|
||||||
Assert.assertTrue(params.getMasterStats().getPerTierStats().get("movedCount").get("normal").get() > 0);
|
Assert.assertTrue(params.getMasterStats().getPerTierStats().get("movedCount").get("normal").get() > 0);
|
||||||
|
Assert.assertTrue(params.getMasterStats().getPerTierStats().get("costChange").get("normal").get() > 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue