|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ClaimStrategy
Strategy contract for claiming the sequence of events in the Sequencer by event publishers.
| Method Summary | |
|---|---|
long |
checkAndIncrement(int availableCapacity,
int delta,
Sequence[] gatingSequences)
Atomically checks the available capacity of the ring buffer and claims the next sequence. |
int |
getBufferSize()
Get the size of the data structure used to buffer events. |
long |
getSequence()
Get the current claimed sequence. |
boolean |
hasAvailableCapacity(int availableCapacity,
Sequence[] dependentSequences)
Is there available capacity in the buffer for the requested sequence. |
long |
incrementAndGet(int delta,
Sequence[] dependentSequences)
Increment sequence by a delta and get the result. |
long |
incrementAndGet(Sequence[] dependentSequences)
Claim the next sequence in the Sequencer. |
void |
serialisePublishing(long sequence,
Sequence cursor,
int batchSize)
Serialise publishers in sequence and set cursor to latest available sequence. |
void |
setSequence(long sequence,
Sequence[] dependentSequences)
Set the current sequence value for claiming an event in the Sequencer
The caller should be held up until the claimed sequence is available by tracking the dependentSequences. |
| Method Detail |
|---|
int getBufferSize()
long getSequence()
boolean hasAvailableCapacity(int availableCapacity,
Sequence[] dependentSequences)
availableCapacity - remaining in the buffer.dependentSequences - to be checked for range.
long incrementAndGet(Sequence[] dependentSequences)
Sequencer.
The caller should be held up until the claimed sequence is available by tracking the dependentSequences.
dependentSequences - to be checked for range.
long incrementAndGet(int delta,
Sequence[] dependentSequences)
delta - to increment by.dependentSequences - to be checked for range.
void setSequence(long sequence,
Sequence[] dependentSequences)
Sequencer
The caller should be held up until the claimed sequence is available by tracking the dependentSequences.
dependentSequences - to be checked for range.sequence - to be set as the current value.
void serialisePublishing(long sequence,
Sequence cursor,
int batchSize)
sequence - sequence to be appliedcursor - to serialise against.batchSize - of the sequence.
long checkAndIncrement(int availableCapacity,
int delta,
Sequence[] gatingSequences)
throws InsufficientCapacityException
availableCapacity - the capacity that should be available before claiming the next slotdelta - the number of slots to claimgatingSequences - the set of sequences to check to ensure capacity is available
InsufficientCapacityException - thrown if capacity is not available
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||