public static final class CallIdSequence.CallIdSequenceWithBackpressure extends CallIdSequence
CallIdSequence that provided backpressure by taking
the number in flight operations into account when a call-id needs to be determined.
It is possible to temporary exceed the capacity:
- due to system operations
- due to racy nature of checking if space is available and getting the next sequence.
The last cause is not a problem since the capacity is exceeded temporary and it isn't sustainable. So perhaps
there are a few threads that at the same time see that the there is space and do a next. But any following
invocation needs to wait till there is is capacity.CallIdSequence.CallIdSequenceWithBackpressure, CallIdSequence.CallIdSequenceWithoutBackpressure| Constructor and Description |
|---|
CallIdSequence.CallIdSequenceWithBackpressure(int maxConcurrentInvocations,
long backoffTimeoutMs) |
| Modifier and Type | Method and Description |
|---|---|
void |
complete(com.hazelcast.spi.impl.operationservice.impl.Invocation invocation) |
long |
getLastCallId() |
int |
getMaxConcurrentInvocations()
Returns the maximum concurrent invocations supported.
|
long |
next(com.hazelcast.spi.impl.operationservice.impl.Invocation invocation)
Creates the next call-id.
|
skipRegistrationpublic CallIdSequence.CallIdSequenceWithBackpressure(int maxConcurrentInvocations,
long backoffTimeoutMs)
public long getLastCallId()
public int getMaxConcurrentInvocations()
CallIdSequencegetMaxConcurrentInvocations in class CallIdSequencepublic long next(com.hazelcast.spi.impl.operationservice.impl.Invocation invocation)
CallIdSequenceOperation.CALL_ID_LOCAL_SKIPPED is returned if local registration in
the InvocationRegistry can be skipped.next in class CallIdSequenceinvocation - the Invocation to create a call-id for.public void complete(com.hazelcast.spi.impl.operationservice.impl.Invocation invocation)
complete in class CallIdSequenceCopyright © 2016 Hazelcast, Inc.. All Rights Reserved.