InternalDelegatingExecutionCallback(ExecutionCallback<ClientMessage> callback) { this.callback = callback; callIdSequence.forceNext(); }
InternalDelegatingExecutionCallback(ExecutionCallback<ClientMessage> callback) { this.callback = callback; callIdSequence.forceNext(); }
public ClientInvocationFuture invokeUrgent() { assert (clientMessage != null); clientMessage.setCorrelationId(callIdSequence.forceNext()); invokeOnSelection(); return clientInvocationFuture; }
public ClientInvocationFuture invokeUrgent() { assert (clientMessage != null); clientMessage.setCorrelationId(callIdSequence.forceNext()); invokeOnSelection(); return clientInvocationFuture; }
private void retry() { // retry modifies the client message and should not reuse the client message. // It could be the case that it is in write queue of the connection. clientMessage = clientMessage.copy(); // first we force a new invocation slot because we are going to return our old invocation slot immediately after // It is important that we first 'force' taking a new slot; otherwise it could be that a sneaky invocation gets // through that takes our slot! clientMessage.setCorrelationId(callIdSequence.forceNext()); //we release the old slot callIdSequence.complete(); try { invokeOnSelection(); } catch (Throwable e) { clientInvocationFuture.complete(e); } }
private void retry() { // retry modifies the client message and should not reuse the client message. // It could be the case that it is in write queue of the connection. clientMessage = clientMessage.copy(); // first we force a new invocation slot because we are going to return our old invocation slot immediately after // It is important that we first 'force' taking a new slot; otherwise it could be that a sneaky invocation gets // through that takes our slot! clientMessage.setCorrelationId(callIdSequence.forceNext()); //we release the old slot callIdSequence.complete(); try { invokeOnSelection(); } catch (Throwable e) { clientInvocationFuture.complete(e); } }
/** * Registers an invocation. * * @param invocation The invocation to register. * @return {@code false} when InvocationRegistry is not alive and registration is not successful, {@code true} otherwise */ public boolean register(Invocation invocation) { final long callId; boolean force = invocation.op.isUrgent() || invocation.isRetryCandidate(); try { callId = force ? callIdSequence.forceNext() : callIdSequence.next(); } catch (HazelcastOverloadException e) { throw new HazelcastOverloadException("Failed to start invocation due to overload: " + invocation, e); } try { // fails with IllegalStateException if the operation is already active setCallId(invocation.op, callId); } catch (IllegalStateException e) { callIdSequence.complete(); throw e; } invocations.put(callId, invocation); if (!alive) { invocation.notifyError(new HazelcastInstanceNotActiveException()); return false; } return true; }
/** * Registers an invocation. * * @param invocation The invocation to register. * @return {@code false} when InvocationRegistry is not alive and registration is not successful, {@code true} otherwise */ public boolean register(Invocation invocation) { final long callId; boolean force = invocation.op.isUrgent() || invocation.isRetryCandidate(); try { callId = force ? callIdSequence.forceNext() : callIdSequence.next(); } catch (HazelcastOverloadException e) { throw new HazelcastOverloadException("Failed to start invocation due to overload: " + invocation, e); } try { // fails with IllegalStateException if the operation is already active setCallId(invocation.op, callId); } catch (IllegalStateException e) { callIdSequence.complete(); throw e; } invocations.put(callId, invocation); if (!alive) { invocation.notifyError(new HazelcastInstanceNotActiveException()); return false; } return true; }