protected void changeFieldAcrossCluster(Field field, Object value) throws Exception { disp.callRemoteMethods(null, new MethodCall(SET, field.getName(), value), RequestOptions.SYNC()); }
try { if(result_collector != null) invokeRpc(result, result_collector, RequestOptions.SYNC().flags(Message.Flag.RSVP), local_addr, tmp_result);
protected void configChange(String name) throws Exception { int tmp=Util.readIntFromStdin(name + ": "); ConfigChange change=new ConfigChange(name, tmp); invokeRpc(configChange, RequestOptions.SYNC().flags(Message.Flag.RSVP), change); }
if(options == null) { log.warn("request options were null, using default of sync"); options=RequestOptions.SYNC();
opts=RequestOptions.SYNC();
/** * Sends a unicast message to the target defined by msg.getDest() and returns a future * @param dest the target to which to send the unicast message. Must not be null. * @param data the payload to send * @param opts the options * @return CompletableFuture<T> A future from which the result can be fetched, or null if the call was asynchronous * @throws Exception If there was problem sending the request, processing it at the receiver, or processing * it at the sender. {@link java.util.concurrent.Future#get()} will throw this exception */ public <T> CompletableFuture<T> sendMessageWithFuture(Address dest, Buffer data, RequestOptions opts) throws Exception { if(dest == null) throw new IllegalArgumentException("message destination is null, cannot send message"); if(opts == null) { log.warn("request options were null, using default of sync"); opts=RequestOptions.SYNC(); } rpc_stats.add(RpcStats.Type.UNICAST, dest, opts.mode() != ResponseMode.GET_NONE, 0); if(opts.mode() == ResponseMode.GET_NONE) { corr.sendUnicastRequest(dest, data, null, opts); return null; } // if we get here, the RPC is synchronous UnicastRequest<T> req=new UnicastRequest<>(corr, dest, opts); req.execute(data, false); return req; }
initiator=true; results.reset(getSenders()); invokeRpc(clearResults,RequestOptions.SYNC().flags(Message.Flag.RSVP)); invokeRpc(startSending, RequestOptions.ASYNC(), local_addr); break; case 's': ConfigChange change=new ConfigChange("sync", !sync); invokeRpc(configChange, RequestOptions.SYNC().flags(Message.Flag.RSVP), change); break; case 'o': change=new ConfigChange("oob", !oob); invokeRpc(configChange, RequestOptions.SYNC().flags(Message.Flag.RSVP), change); break; case 'x':
protected void changeFieldAcrossCluster(Field field, Object value) throws Exception { disp.callRemoteMethods(null, new MethodCall(SET, field.getName(), value), RequestOptions.SYNC()); }
try { if(result_collector != null) invokeRpc(result, result_collector, RequestOptions.SYNC().flags(Message.Flag.RSVP), local_addr, tmp_result);
protected void configChange(String name) throws Exception { int tmp=Util.readIntFromStdin(name + ": "); ConfigChange change=new ConfigChange(name, tmp); invokeRpc(configChange, RequestOptions.SYNC().flags(Message.Flag.RSVP), change); }
if(options == null) { log.warn("request options were null, using default of sync"); options=RequestOptions.SYNC();
opts=RequestOptions.SYNC();
/** * Sends a unicast message to the target defined by msg.getDest() and returns a future * @param dest the target to which to send the unicast message. Must not be null. * @param data the payload to send * @param opts the options * @return CompletableFuture<T> A future from which the result can be fetched, or null if the call was asynchronous * @throws Exception If there was problem sending the request, processing it at the receiver, or processing * it at the sender. {@link java.util.concurrent.Future#get()} will throw this exception */ public <T> CompletableFuture<T> sendMessageWithFuture(Address dest, Buffer data, RequestOptions opts) throws Exception { if(dest == null) throw new IllegalArgumentException("message destination is null, cannot send message"); if(opts == null) { log.warn("request options were null, using default of sync"); opts=RequestOptions.SYNC(); } rpc_stats.add(RpcStats.Type.UNICAST, dest, opts.mode() != ResponseMode.GET_NONE, 0); if(opts.mode() == ResponseMode.GET_NONE) { corr.sendUnicastRequest(dest, data, null, opts); return null; } // if we get here, the RPC is synchronous UnicastRequest<T> req=new UnicastRequest<>(corr, dest, opts); req.execute(data, false); return req; }
initiator=true; results.reset(getSenders()); invokeRpc(clearResults,RequestOptions.SYNC().flags(Message.Flag.RSVP)); invokeRpc(startSending, RequestOptions.ASYNC(), local_addr); break; case 's': ConfigChange change=new ConfigChange("sync", !sync); invokeRpc(configChange, RequestOptions.SYNC().flags(Message.Flag.RSVP), change); break; case 'o': change=new ConfigChange("oob", !oob); invokeRpc(configChange, RequestOptions.SYNC().flags(Message.Flag.RSVP), change); break; case 'x':
@Override public void send(final Buffer data, final boolean synchronous, final long timeout) throws Exception { final RequestOptions options = synchronous ? RequestOptions.SYNC() : RequestOptions.ASYNC(); options.exclusionList( dispatcher.getChannel().getAddress() ); options.setTransientFlags( TransientFlag.DONT_LOOPBACK ); options.setTimeout( timeout ); if ( synchronous ) { try { RspList<Object> rspList = dispatcher.castMessage( null, data, options ); handleResponseProblems( rspList, null ); } catch (Exception e) { throw log.unableToSendWorkViaJGroups( e ); } } else { try { dispatcher.castMessageWithFuture( null, data, options ); } catch (RuntimeException e) { throw log.unableToSendWorkViaJGroups( e ); } } }
private void sendMessage(List<LuceneWork> queue) throws Exception { final String indexManagerName = getIndexName(); ServiceManager serviceManager = getExtendedSearchIntegrator().getServiceManager(); //send message to all listeners byte[] data = serviceManager.requestService( LuceneWorkSerializer.class ).toSerializedModel( queue ); data = MessageSerializationHelper.prependString( indexManagerName, data ); final MessageDispatcher dispatcher = new MessageDispatcher( channel ); final RequestOptions options = RequestOptions.SYNC() .exclusionList( channel.address() ) .setTransientFlags( TransientFlag.DONT_LOOPBACK ) .setTimeout( TIMEOUT ); //milliseconds Buffer buffer = new Buffer( data ); dispatcher.castMessage( null, buffer, options ); serviceManager.releaseService( LuceneWorkSerializer.class ); }