@Override protected void handleNoSpaceLeft() { long start = System.nanoTime(); for (long idleCount = 0; ; idleCount++) { long elapsedNanos = System.nanoTime() - start; if (elapsedNanos > backoffTimeoutNanos) { throw new HazelcastOverloadException(String.format("Timed out trying to acquire another call ID." + " maxConcurrentInvocations = %d, backoffTimeout = %d msecs, elapsed:%d msecs", getMaxConcurrentInvocations(), NANOSECONDS.toMillis(backoffTimeoutNanos), NANOSECONDS.toMillis(elapsedNanos))); } IDLER.idle(idleCount); if (hasSpace()) { return; } } } }
public static CallIdSequence newCallIdSequence(boolean isBackPressureEnabled, int maxAllowedConcurrentInvocations, long backoffTimeoutMs) { if (!isBackPressureEnabled) { return new CallIdSequenceWithoutBackpressure(); } else if (backoffTimeoutMs <= 0) { return new FailFastCallIdSequence(maxAllowedConcurrentInvocations); } else { return new CallIdSequenceWithBackpressure(maxAllowedConcurrentInvocations, backoffTimeoutMs); } } }
public static CallIdSequence newCallIdSequence(boolean isBackPressureEnabled, int maxAllowedConcurrentInvocations, long backoffTimeoutMs) { if (!isBackPressureEnabled) { return new CallIdSequenceWithoutBackpressure(); } else if (backoffTimeoutMs <= 0) { return new FailFastCallIdSequence(maxAllowedConcurrentInvocations); } else { return new CallIdSequenceWithBackpressure(maxAllowedConcurrentInvocations, backoffTimeoutMs); } } }
@Override protected void handleNoSpaceLeft() { long start = System.nanoTime(); for (long idleCount = 0; ; idleCount++) { long elapsedNanos = System.nanoTime() - start; if (elapsedNanos > backoffTimeoutNanos) { throw new HazelcastOverloadException(String.format("Timed out trying to acquire another call ID." + " maxConcurrentInvocations = %d, backoffTimeout = %d msecs, elapsed:%d msecs", getMaxConcurrentInvocations(), NANOSECONDS.toMillis(backoffTimeoutNanos), NANOSECONDS.toMillis(elapsedNanos))); } IDLER.idle(idleCount); if (hasSpace()) { return; } } } }