Пример #1
0
 private void countRemaps(long h, AtomicLongMap<Integer> map) {
   int last = 0;
   for (int shards = 2; shards <= MAX_SHARDS; shards++) {
     int chosen = Hashing.consistentHash(h, shards);
     if (chosen != last) {
       map.incrementAndGet(shards);
       last = chosen;
     }
   }
 }