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 updateHeartbeat(long callId, long nowMillis) { Invocation invocation = invocationRegistry.get(callId); if (invocation == null) { // the invocation doesn't exist anymore, so we are done. return; } invocation.lastHeartbeatMillis = nowMillis; } }
public void reset() { Throwable cause = new LocalMemberResetException(node.getLocalMember() + " has reset."); invocationRegistry.reset(cause); }
@Override public void run0() { if (logger.isFinestEnabled()) { logger.finest("Scanning all invocations"); } if (invocationRegistry.size() == 0) { return; } int backupTimeouts = 0; int normalTimeouts = 0; int invocationCount = 0; for (Entry<Long, Invocation> e : invocationRegistry.entrySet()) { invocationCount++; Invocation inv = e.getValue(); try { if (inv.detectAndHandleTimeout(invocationTimeoutMillis)) { normalTimeouts++; } else if (inv.detectAndHandleBackupTimeout(backupTimeoutMillis)) { backupTimeouts++; } } catch (Throwable t) { inspectOutOfMemoryError(t); logger.severe("Failed to check invocation:" + inv, t); } } backupTimeoutsCount.inc(backupTimeouts); normalTimeoutsCount.inc(normalTimeouts); log(invocationCount, backupTimeouts, normalTimeouts); }
@Override public int getRemoteOperationsCount() { return invocationRegistry.size(); }
/** * Shuts down invocation infrastructure. * New invocation requests will be rejected after shutdown and all pending invocations * will be notified with a failure response. */ public void shutdownInvocations() { logger.finest("Shutting down invocations"); invocationRegistry.shutdown(); invocationMonitor.shutdown(); inboundResponseHandlerSupplier.shutdown(); try { invocationMonitor.awaitTermination(TERMINATION_TIMEOUT_MILLIS); } catch (InterruptedException e) { // TODO: we need a better mechanism for dealing with interruption and waiting for termination Thread.currentThread().interrupt(); } }
node.getLogger(OutboundResponseHandler.class)); this.invocationRegistry = new InvocationRegistry( node.getLogger(OperationServiceImpl.class), backpressureRegulator.newCallIdSequence());
if (!context.invocationRegistry.register(this)) { return;
@Override public void run0() { if (logger.isFinestEnabled()) { logger.finest("Scanning all invocations"); } if (invocationRegistry.size() == 0) { return; } int backupTimeouts = 0; int normalTimeouts = 0; int invocationCount = 0; for (Entry<Long, Invocation> e : invocationRegistry.entrySet()) { invocationCount++; Invocation inv = e.getValue(); try { if (inv.detectAndHandleTimeout(invocationTimeoutMillis)) { normalTimeouts++; } else if (inv.detectAndHandleBackupTimeout(backupTimeoutMillis)) { backupTimeouts++; } } catch (Throwable t) { inspectOutOfMemoryError(t); logger.severe("Failed to check invocation:" + inv, t); } } backupTimeoutsCount.inc(backupTimeouts); normalTimeoutsCount.inc(normalTimeouts); log(invocationCount, backupTimeouts, normalTimeouts); }
@Override public int getRemoteOperationsCount() { return invocationRegistry.size(); }
/** * Shuts down invocation infrastructure. * New invocation requests will be rejected after shutdown and all pending invocations * will be notified with a failure response. */ public void shutdownInvocations() { logger.finest("Shutting down invocations"); invocationRegistry.shutdown(); invocationMonitor.shutdown(); inboundResponseHandlerSupplier.shutdown(); try { invocationMonitor.awaitTermination(TERMINATION_TIMEOUT_MILLIS); } catch (InterruptedException e) { // TODO: we need a better mechanism for dealing with interruption and waiting for termination Thread.currentThread().interrupt(); } }
node.getLogger(OutboundResponseHandler.class)); this.invocationRegistry = new InvocationRegistry( node.getLogger(OperationServiceImpl.class), backpressureRegulator.newCallIdSequence());
if (!context.invocationRegistry.register(this)) { return;
private void updateHeartbeat(long callId, long nowMillis) { Invocation invocation = invocationRegistry.get(callId); if (invocation == null) { // the invocation doesn't exist anymore, so we are done. return; } invocation.lastHeartbeatMillis = nowMillis; } }
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 render(DiagnosticsLogWriter writer) { writer.startSection("PendingInvocations"); writer.writeKeyValueEntry("count", invocationRegistry.size()); renderInvocations(writer); writer.endSection(); }
public void reset() { Throwable cause = new LocalMemberResetException(node.getLocalMember() + " has reset."); invocationRegistry.reset(cause); }
void notifyErrorResponse(long callId, Object cause, Address sender) { responsesError.inc(); Invocation invocation = invocationRegistry.get(callId); if (invocation == null) { responsesMissing.inc(); if (nodeEngine.isRunning() && callId != 0) { logger.warning("No Invocation found for error response with callId=" + callId + " sent from " + sender); } return; } invocation.notifyError(cause); }
private void complete(Object value) { future.complete(value); if (context.invocationRegistry.deregister(this) && taskDoneCallback != null) { context.asyncExecutor.execute(taskDoneCallback); } }
private void render(DiagnosticsLogWriter writer) { writer.startSection("PendingInvocations"); writer.writeKeyValueEntry("count", invocationRegistry.size()); renderInvocations(writer); writer.endSection(); }