public abstract class AbstractSequencer extends java.lang.Object implements Sequencer
| Modifier and Type | Field and Description |
|---|---|
protected int |
bufferSize |
protected Sequence |
cursor |
protected Sequence[] |
gatingSequences |
protected WaitStrategy |
waitStrategy |
INITIAL_CURSOR_VALUE| Constructor and Description |
|---|
AbstractSequencer(int bufferSize,
WaitStrategy waitStrategy)
Create with the specified buffer size and wait strategy.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addGatingSequences(Sequence... gatingSequences)
Add the specified gating sequences to this instance of the Disruptor.
|
int |
getBufferSize()
The capacity of the data structure to hold entries.
|
long |
getCursor()
Get the current cursor value.
|
long |
getMinimumSequence()
Get the minimum sequence value from all of the gating sequences
added to this ringBuffer.
|
SequenceBarrier |
newBarrier(Sequence... sequencesToTrack)
Create a new SequenceBarrier to be used by an EventProcessor to track which messages
are available to be read from the ring buffer given a list of sequences to track.
|
boolean |
removeGatingSequence(Sequence sequence)
Remove the specified sequence from this sequencer.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclaim, getHighestPublishedSequence, hasAvailableCapacity, isAvailable, next, next, publish, publish, remainingCapacity, tryNext, tryNextprotected final int bufferSize
protected final WaitStrategy waitStrategy
protected final Sequence cursor
protected volatile Sequence[] gatingSequences
public AbstractSequencer(int bufferSize,
WaitStrategy waitStrategy)
bufferSize - The total number of entries, must be a positive power of 2.waitStrategy - public final long getCursor()
CursoredgetCursor in interface CursoredCursored.getCursor()public final int getBufferSize()
SequencergetBufferSize in interface SequencerSequencer.getBufferSize()public final void addGatingSequences(Sequence... gatingSequences)
SequenceraddGatingSequences in interface SequencergatingSequences - The sequences to add.Sequencer.addGatingSequences(Sequence...)public boolean removeGatingSequence(Sequence sequence)
SequencerremoveGatingSequence in interface Sequencersequence - to be removed.Sequencer.removeGatingSequence(Sequence)public long getMinimumSequence()
SequencergetMinimumSequence in interface SequencerSequencer.getMinimumSequence()public SequenceBarrier newBarrier(Sequence... sequencesToTrack)
SequencernewBarrier in interface SequencerSequencer.newBarrier(Sequence...)Copyright © 2011 - 2013 LMAX Ltd. All Rights Reserved.