public abstract class CallIdSequence extends Object
next(Invocation)
, there is a matching complete(Invocation)
.
If this doesn't match, than either the number of concurrent invocations can grow or shrink over time. This can lead
to OOME or deadlock.
The CallIdSequence provides back pressure if enabled and there are too many concurrent invocations. When this happens,
an exponential backoff policy is applied.
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 improved isolation, at the expensive of:
Constructor and Description |
---|
CallIdSequence() |
Modifier and Type | Method and Description |
---|---|
abstract void |
complete(Invocation invocation) |
abstract int |
getMaxConcurrentInvocations()
Returns the maximum concurrent invocations supported.
|
abstract long |
next(Invocation invocation)
Creates the next call-id.
|
public abstract int getMaxConcurrentInvocations()
public abstract long next(Invocation invocation)
invocation
- the Invocation to create a call-id for.AssertionError
- if invocation.op.callId not equals 0public abstract void complete(Invocation invocation)
Copyright © 2016 Hazelcast, Inc.. All Rights Reserved.