Class DiskNormalizedCostBalancerStrategy
- java.lang.Object
-
- org.apache.druid.server.coordinator.balancer.CostBalancerStrategy
-
- org.apache.druid.server.coordinator.balancer.DiskNormalizedCostBalancerStrategy
-
- All Implemented Interfaces:
BalancerStrategy
public class DiskNormalizedCostBalancerStrategy extends CostBalancerStrategy
ABalancerStrategywhich can be used when historicals in a tier have varying disk capacities. This strategy normalizes the cost of placing a segment on a server as calculated byCostBalancerStrategyby doing the following:- Divide the cost by the number of segments on the server. This ensures that cost does not increase just because the number of segments on a server is higher.
- Multiply the resulting value by disk usage ratio. This ensures that all hosts have equivalent levels of percentage disk utilization.
cost = as computed by CostBalancerStrategy normalizedCost = (cost / numSegments) * usageRatio = (cost / numSegments) * (diskUsed / totalDiskSpace)
-
-
Constructor Summary
Constructors Constructor Description DiskNormalizedCostBalancerStrategy(com.google.common.util.concurrent.ListeningExecutorService exec)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected doublecomputePlacementCost(org.apache.druid.timeline.DataSegment proposalSegment, ServerHolder server)Computes the cost of placing a segment on this server.-
Methods inherited from class org.apache.druid.server.coordinator.balancer.CostBalancerStrategy
computeJointSegmentsCost, computeJointSegmentsCost, findDestinationServerToMoveSegment, findServersToDropSegment, findServersToLoadSegment, getStats, intervalCost, intervalCost
-
-
-
-
Method Detail
-
computePlacementCost
protected double computePlacementCost(org.apache.druid.timeline.DataSegment proposalSegment, ServerHolder server)Description copied from class:CostBalancerStrategyComputes the cost of placing a segment on this server.- Overrides:
computePlacementCostin classCostBalancerStrategy
-
-