public CompletableFuture<MetadataResponse> metadata(MetadataRequest request) {
    CompletableFuture<MetadataResponse> future = new CompletableFuture<>();
    if (context.isCurrentContext()) {
      sendRequest(request, protocol::metadata, future);
    } else {
      context.execute(() -> sendRequest(request, protocol::metadata, future));
    }
    return future;
  }
public CompletableFuture < MetadataResponse > metadata ( MetadataRequest request ) { CompletableFuture < MetadataResponse > future = new CompletableFuture < > ( ) ; if ( context . isCurrentContext ( ) ) { sendRequest ( request , protocol :: metadata , future ) ; } else { context . execute ( ( ) -> sendRequest ( request , protocol :: metadata , future ) ) ; } return future ; }
Sends a metadata request to the given node.

@param request the request to send
@return a future to be completed with the response