- final CompletableFuture<ShardBackendInfo> ret = new CompletableFuture<ShardBackendInfo>();
-
- FutureConverters.toJava(actorContext.findPrimaryShardAsync(shardName)).thenCompose(info -> {
- LOG.debug("Looking up primary info for {} from {}", shardName, info);
- return FutureConverters.toJava(Patterns.ask(info.getPrimaryShardActor(),
- (Function<ActorRef, Object>) replyTo -> new ConnectClientRequest(null, replyTo,
- ABIVersion.BORON, ABIVersion.current()), DEAD_TIMEOUT));
- }).thenApply(response -> {
- if (response instanceof RequestFailure) {
- final RequestFailure<?, ?> failure = (RequestFailure<?, ?>) response;
- LOG.debug("Connect request failed {}", failure, failure.getCause());
- throw Throwables.propagate(failure.getCause());
- }
-
- LOG.debug("Resolved backend information to {}", response);
+ LOG.debug("Resolving cookie {} to shard {}", cookie, shardName);
+ final ShardState toInsert = resolveBackendInfo(shardName, cookie);