Class DiskNormalizedCostBalancerStrategy
java.lang.Object
org.apache.druid.server.coordinator.balancer.CostBalancerStrategy
org.apache.druid.server.coordinator.balancer.DiskNormalizedCostBalancerStrategy
- All Implemented Interfaces:
BalancerStrategy
A
BalancerStrategy which 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 by CostBalancerStrategy by 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
ConstructorsConstructorDescriptionDiskNormalizedCostBalancerStrategy(com.google.common.util.concurrent.ListeningExecutorService exec) -
Method Summary
Modifier and TypeMethodDescriptionprotected doublecomputePlacementCost(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
-
Constructor Details
-
DiskNormalizedCostBalancerStrategy
public DiskNormalizedCostBalancerStrategy(com.google.common.util.concurrent.ListeningExecutorService exec)
-
-
Method Details
-
computePlacementCost
Description copied from class:CostBalancerStrategyComputes the cost of placing a segment on this server.- Overrides:
computePlacementCostin classCostBalancerStrategy
-