public abstract class AbstractCallIdSequence extends Object implements CallIdSequence
CallIdSequence
that provides backpressure by taking
the number of in-flight operations into account when before creating a new call-id.
It is possible to temporarily create more concurrent invocations than the declared capacity due to:
Constructor and Description |
---|
AbstractCallIdSequence(int maxConcurrentInvocations) |
Modifier and Type | Method and Description |
---|---|
void |
complete()
Not idempotent: must be called exactly once per invocation.
|
long |
forceNext()
Generates the next unique call ID.
|
long |
getLastCallId()
Returns the last issued call ID.
|
int |
getMaxConcurrentInvocations()
Returns the maximum concurrent invocations supported.
|
protected abstract void |
handleNoSpaceLeft() |
protected boolean |
hasSpace() |
long |
next()
Generates the next unique call ID.
|
public AbstractCallIdSequence(int maxConcurrentInvocations)
public long next()
CallIdSequence
next
in interface CallIdSequence
protected abstract void handleNoSpaceLeft()
public long getLastCallId()
CallIdSequence
getLastCallId
in interface CallIdSequence
public int getMaxConcurrentInvocations()
CallIdSequence
getMaxConcurrentInvocations
in interface CallIdSequence
public void complete()
CallIdSequence
complete
in interface CallIdSequence
public long forceNext()
CallIdSequence
forceNext
in interface CallIdSequence
protected boolean hasSpace()
Copyright © 2018 Hazelcast, Inc.. All Rights Reserved.