Do not override thetas if sum is less or equals to `0`

Closes #4390
This commit is contained in:
Simon Willnauer 2013-12-10 10:41:43 +01:00
parent 2dfb1d98f4
commit acf371ef57
1 changed files with 2 additions and 1 deletions

View File

@ -203,8 +203,9 @@ public class BalancedShardsAllocator extends AbstractComponent implements Shards
sum = indexBalance + shardBalance;
if (sum <= 0.0f) {
thetaMap.put(operation, defaultTheta);
} else {
thetaMap.put(operation, new float[]{shardBalance / sum, indexBalance / sum, 0});
}
thetaMap.put(operation, new float[]{shardBalance / sum, indexBalance / sum, 0});
break;
case BALANCE:
case ALLOCATE: