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