private void resetAndReInvoke() { if (!context.invocationRegistry.deregister(this)) { // another thread already did something else with this invocation return; } invokeCount = 0; pendingResponse = VOID; pendingResponseReceivedMillis = -1; backupsAcksExpected = 0; backupsAcksReceived = 0; lastHeartbeatMillis = 0; doInvoke(false); }
private void resetAndReInvoke() { if (!context.invocationRegistry.deregister(this)) { // another thread already did something else with this invocation return; } invokeCount = 0; pendingResponse = VOID; pendingResponseReceivedMillis = -1; backupsAcksExpected = 0; backupsAcksReceived = 0; lastHeartbeatMillis = 0; doInvoke(false); }
private void complete(Object value) { future.complete(value); if (context.invocationRegistry.deregister(this) && taskDoneCallback != null) { context.asyncExecutor.execute(taskDoneCallback); } }
private void complete(Object value) { future.complete(value); if (context.invocationRegistry.deregister(this) && taskDoneCallback != null) { context.asyncExecutor.execute(taskDoneCallback); } }
@Override public void run() { // When a cluster is being merged into another one then local node is marked as not-joined and invocations are // notified with MemberLeftException. // We do not want to retry them before the node is joined again because partition table is stale at this point. if (!context.clusterService.isJoined() && !isJoinOperation(op) && !(op instanceof AllowedDuringPassiveState)) { if (!engineActive()) { context.invocationRegistry.deregister(Invocation.this); return; } if (context.logger.isFinestEnabled()) { context.logger.finest("Node is not joined. Re-scheduling " + this + " to be executed in " + tryPauseMillis + " ms."); } try { context.invocationMonitor.schedule(new InvocationRetryTask(), tryPauseMillis); } catch (RejectedExecutionException e) { completeWhenRetryRejected(e); } return; } if (!context.invocationRegistry.deregister(Invocation.this)) { return; } // When retrying, we must reset lastHeartbeat, otherwise InvocationMonitor will see the old value // and falsely conclude that nothing has been done about this operation for a long time. lastHeartbeatMillis = 0; doInvoke(true); }