Improve cache cost to handle heterogenous historicals (#5416)

This commit is contained in:
Niketh Sabbineni 2018-02-23 13:17:31 -08:00 committed by Jihoon Son
parent e9977ce4ef
commit ac5034e241
1 changed files with 5 additions and 1 deletions

View File

@ -61,7 +61,11 @@ public class CachingCostBalancerStrategy extends CostBalancerStrategy
// add segments that will be loaded to the cost
cost += costCacheForLoadingSegments(server).computeCost(serverName, proposalSegment);
return cost;
if (server.getAvailableSize() <= 0) {
return Double.POSITIVE_INFINITY;
}
return cost * (server.getMaxSize() / server.getAvailableSize());
}
private ClusterCostCache costCacheForLoadingSegments(ServerHolder server)