QueryResponse unicast ( Address address , ClusteredQueryCommand clusteredQueryCommand ) { if ( address . equals ( myAddress ) ) { Future < QueryResponse > localResponse = localInvoke ( clusteredQueryCommand ) ; try { return localResponse . get ( ) ; } catch ( InterruptedException e ) { throw new SearchException ( "Interrupted while searching locally" , e ) ; } catch ( ExecutionException e ) { throw new SearchException ( "Exception while searching locally" , e ) ; } } else { Map < Address , Response > responses = rpcManager . invokeRemotely ( Collections . singletonList ( address ) , clusteredQueryCommand , rpcOptions ) ; List < QueryResponse > queryResponses = cast ( responses ) ; return queryResponses . get ( 0 ) ; } }
Send this ClusteredQueryCommand to a node .