- synchronized (this) {
- cookie = shards.get(shardName);
- if (cookie == null) {
- cookie = nextShard++;
-
- Builder<String, Long> builder = ImmutableBiMap.builder();
- builder.putAll(shards);
- builder.put(shardName, cookie);
- shards = builder.build();
- }
- }