if (cookie == null) {
cookie = nextShard++;
- Builder<String, Long> b = ImmutableBiMap.builder();
- b.putAll(shards);
- b.put(shardName, cookie);
- shards = b.build();
+ Builder<String, Long> builder = ImmutableBiMap.builder();
+ builder.putAll(shards);
+ builder.put(shardName, cookie);
+ shards = builder.build();
}
}
}
return NULL_FUTURE;
}
- final CompletableFuture<ShardBackendInfo> ret = new CompletableFuture<ShardBackendInfo>();
+ final CompletableFuture<ShardBackendInfo> ret = new CompletableFuture<>();
FutureConverters.toJava(actorContext.findPrimaryShardAsync(shardName)).thenCompose(info -> {
LOG.debug("Looking up primary info for {} from {}", shardName, info);
return new ShardBackendInfo(success.getBackend(),
nextSessionId.getAndIncrement(), success.getVersion(), shardName, UnsignedLong.fromLongBits(cookie),
success.getDataTree(), success.getMaxMessages());
- }).whenComplete((info, t) -> {
- if (t != null) {
- ret.completeExceptionally(t);
+ }).whenComplete((info, throwablw) -> {
+ if (throwablw != null) {
+ ret.completeExceptionally(throwablw);
} else {
ret.complete(info);
}