/** * Utility method to retrieve the BlobServer address from the given JobManager gateway. * * @param jobManagerGateway to obtain the BlobServer address from * @param timeout for this operation * @return CompletableFuture containing the BlobServer address */ public static CompletableFuture<InetSocketAddress> retrieveBlobServerAddress( JobManagerGateway jobManagerGateway, Time timeout) { CompletableFuture<Integer> futureBlobPort = jobManagerGateway.requestBlobServerPort(timeout); final String jmHostname = jobManagerGateway.getHostname(); return futureBlobPort.thenApply( (Integer blobPort) -> new InetSocketAddress(jmHostname, blobPort)); } }
/** * Utility method to retrieve the BlobServer address from the given JobManager gateway. * * @param jobManagerGateway to obtain the BlobServer address from * @param timeout for this operation * @return CompletableFuture containing the BlobServer address */ public static CompletableFuture<InetSocketAddress> retrieveBlobServerAddress( JobManagerGateway jobManagerGateway, Time timeout) { CompletableFuture<Integer> futureBlobPort = jobManagerGateway.requestBlobServerPort(timeout); final String jmHostname = jobManagerGateway.getHostname(); return futureBlobPort.thenApply( (Integer blobPort) -> new InetSocketAddress(jmHostname, blobPort)); } }
/** * Utility method to retrieve the BlobServer address from the given JobManager gateway. * * @param jobManagerGateway to obtain the BlobServer address from * @param timeout for this operation * @return CompletableFuture containing the BlobServer address */ public static CompletableFuture<InetSocketAddress> retrieveBlobServerAddress( JobManagerGateway jobManagerGateway, Time timeout) { CompletableFuture<Integer> futureBlobPort = jobManagerGateway.requestBlobServerPort(timeout); final String jmHostname = jobManagerGateway.getHostname(); return futureBlobPort.thenApply( (Integer blobPort) -> new InetSocketAddress(jmHostname, blobPort)); } }
protected void respondAsLeader(final ChannelHandlerContext ctx, final Routed routed, final JobManagerGateway jobManagerGateway) { if (cache == null) { CompletableFuture<Integer> blobPortFuture = jobManagerGateway.requestBlobServerPort(timeout); cache = blobPortFuture.thenApplyAsync( (Integer port) -> {