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, wait
claim, ensureAvailable, hasAvailableCapacity, isAvailable, next, next, publish, publish, remainingCapacity, tryNext, tryNext
protected 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()
Cursored
getCursor
in interface Cursored
Cursored.getCursor()
public final int getBufferSize()
Sequencer
getBufferSize
in interface Sequencer
Sequencer.getBufferSize()
public final void addGatingSequences(Sequence... gatingSequences)
Sequencer
addGatingSequences
in interface Sequencer
gatingSequences
- The sequences to add.Sequencer.addGatingSequences(Sequence...)
public boolean removeGatingSequence(Sequence sequence)
Sequencer
removeGatingSequence
in interface Sequencer
sequence
- to be removed.Sequencer.removeGatingSequence(Sequence)
public long getMinimumSequence()
Sequencer
getMinimumSequence
in interface Sequencer
Sequencer.getMinimumSequence()
public SequenceBarrier newBarrier(Sequence... sequencesToTrack)
Sequencer
newBarrier
in interface Sequencer
Sequencer.newBarrier(Sequence...)
Copyright © 2011 - 2013 LMAX Ltd. All Rights Reserved.