public interface CallIdSequence
It is very important that for each next()
and forceNext()
()}
there is a matching complete()
. If they don't match, the number of concurrent
invocations will grow/shrink without bound over time. This can lead to OOME or deadlock.
When backpressure is enabled and there are too many concurrent invocations, calls of next()
will block using a spin-loop with exponential backoff.
Currently a single CallIdSequence is used for all partitions, so there is contention. Also one partition can cause problems in other partition if a lot of invocations are created for that partition. Then other partitions can't make as many invocations because a single callIdSequence is being used.
In the future we could add a CallIdSequence per partition or using some 'concurrency level' and do a mod based on the partition-id. The advantage is that you reduce contention and improve isolation, at the expense of:
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.
|
long |
next()
Generates the next unique call ID.
|
int getMaxConcurrentInvocations()
long next()
HazelcastOverloadException
- if the outstanding invocation count hasn't dropped below the configured limitlong forceNext()
void complete()
long getLastCallId()
Copyright © 2018 Hazelcast, Inc.. All Rights Reserved.