|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.lmax.disruptor.RingBuffer<T>
T
- AbstractEntry implementation storing the data for sharing during exchange or parallel coordination of an event.public final class RingBuffer<T extends AbstractEntry>
Ring based store of reusable entries containing the data representing an AbstractEntry
being exchanged between producers and consumers.
Field Summary | |
---|---|
static long |
INITIAL_CURSOR_VALUE
Set to -1 as sequence starting point |
long |
p1
|
long |
p10
|
long |
p11
|
long |
p12
|
long |
p13
|
long |
p14
|
long |
p2
|
long |
p3
|
long |
p4
|
long |
p5
|
long |
p6
|
long |
p7
|
long |
p8
|
long |
p9
|
Constructor Summary | |
---|---|
RingBuffer(EntryFactory<T> entryFactory,
int size)
Construct a RingBuffer with default strategies of: ClaimStrategy.Option.MULTI_THREADED and WaitStrategy.Option.BLOCKING |
|
RingBuffer(EntryFactory<T> entryFactory,
int size,
ClaimStrategy.Option claimStrategyOption,
WaitStrategy.Option waitStrategyOption)
Construct a RingBuffer with the full option set. |
Method Summary | |
---|---|
ConsumerBarrier<T> |
createConsumerBarrier(Consumer... consumersToTrack)
Create a ConsumerBarrier that gates on the RingBuffer and a list of Consumer s |
ForceFillProducerBarrier<T> |
createForceFillProducerBarrier(Consumer... consumersToTrack)
Create a ForceFillProducerBarrier on this RingBuffer that tracks dependent Consumer s. |
ProducerBarrier<T> |
createProducerBarrier(Consumer... consumersToTrack)
Create a ProducerBarrier on this RingBuffer that tracks dependent Consumer s. |
int |
getCapacity()
The capacity of the RingBuffer to hold entries. |
long |
getCursor()
Get the current sequence that producers have committed to the RingBuffer. |
T |
getEntry(long sequence)
Get the AbstractEntry for a given sequence in the RingBuffer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final long INITIAL_CURSOR_VALUE
public long p1
public long p2
public long p3
public long p4
public long p5
public long p6
public long p7
public long p8
public long p9
public long p10
public long p11
public long p12
public long p13
public long p14
Constructor Detail |
---|
public RingBuffer(EntryFactory<T> entryFactory, int size, ClaimStrategy.Option claimStrategyOption, WaitStrategy.Option waitStrategyOption)
entryFactory
- to create AbstractEntry
s for filling the RingBuffersize
- of the RingBuffer that will be rounded up to the next power of 2claimStrategyOption
- threading strategy for producers claiming AbstractEntry
s in the ring.waitStrategyOption
- waiting strategy employed by consumers waiting on AbstractEntry
s becoming available.public RingBuffer(EntryFactory<T> entryFactory, int size)
ClaimStrategy.Option.MULTI_THREADED
and WaitStrategy.Option.BLOCKING
entryFactory
- to create AbstractEntry
s for filling the RingBuffersize
- of the RingBuffer that will be rounded up to the next power of 2Method Detail |
---|
public ConsumerBarrier<T> createConsumerBarrier(Consumer... consumersToTrack)
ConsumerBarrier
that gates on the RingBuffer and a list of Consumer
s
consumersToTrack
- this barrier will track
public ProducerBarrier<T> createProducerBarrier(Consumer... consumersToTrack)
ProducerBarrier
on this RingBuffer that tracks dependent Consumer
s.
consumersToTrack
- to be tracked to prevent wrapping.
ProducerBarrier
with the above configuration.public ForceFillProducerBarrier<T> createForceFillProducerBarrier(Consumer... consumersToTrack)
ForceFillProducerBarrier
on this RingBuffer that tracks dependent Consumer
s.
This barrier is to be used for filling a RingBuffer when no other producers exist.
consumersToTrack
- to be tracked to prevent wrapping.
ForceFillProducerBarrier
with the above configuration.public int getCapacity()
public long getCursor()
public T getEntry(long sequence)
AbstractEntry
for a given sequence in the RingBuffer.
sequence
- for the AbstractEntry
AbstractEntry
for the sequence
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |