hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/XceiverClientRatis.java
@Override
  public CompletableFuture<ContainerCommandResponseProto> sendCommandAsync(
      ContainerCommandRequestProto request)
      throws IOException, ExecutionException, InterruptedException {
    return sendRequestAsync(request).whenComplete((reply, e) ->
          LOG.debug("received reply {} for request: {} exception: {}", request,
              reply, e))
        .thenApply(reply -> {
          try {
            return ContainerCommandResponseProto.parseFrom(
                ShadedProtoUtil.asByteString(reply.getMessage().getContent()));
          } catch (InvalidProtocolBufferException e) {
            throw new CompletionException(e);
          }
        });
  }
/**
   * Sends a given command to server gets a waitable future back.
   *
   * @param request Request
   * @return Response to the command
   * @throws IOException
   */
Sends a given command to server gets a waitable future back.
@param request Request
@return Response to the command
@throws IOException
Sends a given command to server gets a waitable future back . @param request Request @return Response to the command @throws IOException
@Override
  public CompletableFuture<ContainerCommandResponseProto> sendCommandAsync(
      ContainerCommandRequestProto request)
      throws IOException, ExecutionException, InterruptedException {
    return sendRequestAsync(request).whenComplete((reply, e) ->
          LOG.debug("received reply {} for request: {} exception: {}", request,
              reply, e))
        .thenApply(reply -> {
          try {
            return ContainerCommandResponseProto.parseFrom(
                ShadedProtoUtil.asByteString(reply.getMessage().getContent()));
          } catch (InvalidProtocolBufferException e) {
            throw new CompletionException(e);
          }
        });
  }
@ Override public CompletableFuture < ContainerCommandResponseProto > sendCommandAsync ( ContainerCommandRequestProto request ) throws IOException , ExecutionException , InterruptedException { return sendRequestAsync ( request ) . whenComplete ( ( reply , e ) -> LOG . debug ( "received reply {} for request: {} exception: {}" , request , reply , e ) ) . thenApply ( reply -> { try { return ContainerCommandResponseProto . parseFrom ( ShadedProtoUtil . asByteString ( reply . getMessage ( ) . getContent ( ) ) ) ; } catch ( InvalidProtocolBufferException e ) { throw new CompletionException ( e ) ; } } ) ; }
Sends a given command to server gets a waitable future back.
Sends a given command to server gets a waitable future back .