@Override protected String invocationToString() { return invocation.toString(); }
@Override protected String invocationToString() { return invocation.toString(); }
private void handleRetry(Object cause) { context.retryCount.inc(); if (invokeCount % LOG_INVOCATION_COUNT_MOD == 0) { Level level = invokeCount > LOG_MAX_INVOCATION_COUNT ? WARNING : FINEST; if (context.logger.isLoggable(level)) { context.logger.log(level, "Retrying invocation: " + toString() + ", Reason: " + cause); } } if (future.interrupted) { complete(INTERRUPTED); } else { try { InvocationRetryTask retryTask = new InvocationRetryTask(); if (invokeCount < MAX_FAST_INVOCATION_COUNT) { // fast retry for the first few invocations context.invocationMonitor.execute(retryTask); } else { // progressive retry delay long delayMillis = Math.min(1 << (invokeCount - MAX_FAST_INVOCATION_COUNT), tryPauseMillis); context.invocationMonitor.schedule(retryTask, delayMillis); } } catch (RejectedExecutionException e) { completeWhenRetryRejected(e); } } }
private void handleRetry(Object cause) { context.retryCount.inc(); if (invokeCount % LOG_INVOCATION_COUNT_MOD == 0) { Level level = invokeCount > LOG_MAX_INVOCATION_COUNT ? WARNING : FINEST; if (context.logger.isLoggable(level)) { context.logger.log(level, "Retrying invocation: " + toString() + ", Reason: " + cause); } } if (future.interrupted) { complete(INTERRUPTED); } else { try { InvocationRetryTask retryTask = new InvocationRetryTask(); if (invokeCount < MAX_FAST_INVOCATION_COUNT) { // fast retry for the first few invocations context.invocationMonitor.execute(retryTask); } else { // progressive retry delay long delayMillis = Math.min(1 << (invokeCount - MAX_FAST_INVOCATION_COUNT), tryPauseMillis); context.invocationMonitor.schedule(retryTask, delayMillis); } } catch (RejectedExecutionException e) { completeWhenRetryRejected(e); } } }
private void runCurrent(DiagnosticsLogWriter writer, long now) { writer.startSection("Pending"); int count = 0; boolean maxPrinted = false; for (Invocation invocation : invocationRegistry) { long durationMs = now - invocation.firstInvocationTimeMillis; String operationDesc = toOperationDesc(invocation.op); occurrences.add(operationDesc, 1); if (durationMs < thresholdMillis) { // short invocation, lets move on to the next continue; } // it is a slow invocation count++; if (count < maxCount) { writer.writeEntry(invocation.toString() + " duration=" + durationMs + " ms"); } else if (!maxPrinted) { maxPrinted = true; writer.writeEntry("max number of invocations to print reached."); } slowOccurrences.add(operationDesc, 1); } writer.endSection(); }
private void runCurrent(DiagnosticsLogWriter writer, long now) { writer.startSection("Pending"); int count = 0; boolean maxPrinted = false; for (Invocation invocation : invocationRegistry) { long durationMs = now - invocation.firstInvocationTimeMillis; String operationDesc = toOperationDesc(invocation.op); occurrences.add(operationDesc, 1); if (durationMs < thresholdMillis) { // short invocation, lets move on to the next continue; } // it is a slow invocation count++; if (count < maxCount) { writer.writeEntry(invocation.toString() + " duration=" + durationMs + " ms"); } else if (!maxPrinted) { maxPrinted = true; writer.writeEntry("max number of invocations to print reached."); } slowOccurrences.add(operationDesc, 1); } writer.endSection(); }