MCPcopy Create free account
hub / github.com/apache/storm / integerDivided

Method integerDivided

storm-client/src/jvm/org/apache/storm/utils/Utils.java:1386–1396  ·  view source on GitHub ↗
(int sum, int numPieces)

Source from the content-addressed store, hash-verified

1384 }
1385
1386 public static TreeMap<Integer, Integer> integerDivided(int sum, int numPieces) {
1387 int base = sum / numPieces;
1388 int numInc = sum % numPieces;
1389 int numBases = numPieces - numInc;
1390 TreeMap<Integer, Integer> ret = new TreeMap<Integer, Integer>();
1391 ret.put(base, numBases);
1392 if (numInc != 0) {
1393 ret.put(base + 1, numInc);
1394 }
1395 return ret;
1396 }
1397
1398 /**
1399 * Fills up chunks out of a collection (given a maximum amount of chunks).

Callers 3

partitionFixedMethod · 0.95
machineDistributionMethod · 0.95
badSlotsMethod · 0.95

Calls 1

putMethod · 0.65

Tested by

no test coverage detected