E
- implementation storing the data for sharing during exchange or parallel coordination of an event.public final class RingBuffer<E> extends java.lang.Object implements Cursored, EventSequencer<E>, EventSink<E>
EventProcessor
s.Modifier and Type | Field and Description |
---|---|
static long |
INITIAL_CURSOR_VALUE |
Modifier and Type | Method and Description |
---|---|
void |
addGatingSequences(Sequence... gatingSequences)
Add the specified gating sequences to this instance of the Disruptor.
|
E |
claimAndGetPreallocated(long sequence)
Sets the cursor to a specific sequence and returns the preallocated entry that is stored there.
|
static <E> RingBuffer<E> |
create(ProducerType producerType,
EventFactory<E> factory,
int bufferSize,
WaitStrategy waitStrategy)
Create a new Ring Buffer with the specified producer type (SINGLE or MULTI)
|
static <E> RingBuffer<E> |
createMultiProducer(EventFactory<E> factory,
int bufferSize)
Create a new multiple producer RingBuffer using the default wait strategy
BlockingWaitStrategy . |
static <E> RingBuffer<E> |
createMultiProducer(EventFactory<E> factory,
int bufferSize,
WaitStrategy waitStrategy)
Create a new multiple producer RingBuffer with the specified wait strategy.
|
static <E> RingBuffer<E> |
createSingleProducer(EventFactory<E> factory,
int bufferSize)
Create a new single producer RingBuffer using the default wait strategy
BlockingWaitStrategy . |
static <E> RingBuffer<E> |
createSingleProducer(EventFactory<E> factory,
int bufferSize,
WaitStrategy waitStrategy)
Create a new single producer RingBuffer with the specified wait strategy.
|
E |
get(long sequence)
Get the event for a given sequence in the RingBuffer.
|
int |
getBufferSize()
The size of the buffer.
|
long |
getCursor()
Get the current cursor value for the ring buffer.
|
long |
getMinimumGatingSequence()
Get the minimum sequence value from all of the gating sequences
added to this ringBuffer.
|
boolean |
hasAvailableCapacity(int requiredCapacity)
Given specified requiredCapacity determines if that amount of space
is available.
|
boolean |
isPublished(long sequence)
Determines if a particular entry has been published.
|
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.
|
EventPoller<E> |
newPoller(Sequence... gatingSequences)
Creates an event poller for this ring buffer gated on the supplied sequences.
|
long |
next()
Increment and return the next sequence for the ring buffer.
|
long |
next(int n)
The same functionality as
next() , but allows the caller to claim
the next n sequences. |
void |
publish(long sequence)
Publish the specified sequence.
|
void |
publish(long lo,
long hi)
Publish the specified sequences.
|
void |
publishEvent(EventTranslator<E> translator)
Publishes an event to the ring buffer.
|
<A> void |
publishEvent(EventTranslatorOneArg<E,A> translator,
A arg0)
Allows one user supplied argument.
|
<A,B,C> void |
publishEvent(EventTranslatorThreeArg<E,A,B,C> translator,
A arg0,
B arg1,
C arg2)
Allows three user supplied arguments
|
<A,B> void |
publishEvent(EventTranslatorTwoArg<E,A,B> translator,
A arg0,
B arg1)
Allows two user supplied arguments.
|
void |
publishEvent(EventTranslatorVararg<E> translator,
java.lang.Object... args)
Allows a variable number of user supplied arguments
|
void |
publishEvents(EventTranslator<E>[] translators)
Publishes multiple events to the ring buffer.
|
void |
publishEvents(EventTranslator<E>[] translators,
int batchStartsAt,
int batchSize)
Publishes multiple events to the ring buffer.
|
<A> void |
publishEvents(EventTranslatorOneArg<E,A> translator,
A[] arg0)
Allows one user supplied argument per event.
|
<A> void |
publishEvents(EventTranslatorOneArg<E,A> translator,
int batchStartsAt,
int batchSize,
A[] arg0)
Allows one user supplied argument per event.
|
<A,B,C> void |
publishEvents(EventTranslatorThreeArg<E,A,B,C> translator,
A[] arg0,
B[] arg1,
C[] arg2)
Allows three user supplied arguments per event.
|
<A,B,C> void |
publishEvents(EventTranslatorThreeArg<E,A,B,C> translator,
int batchStartsAt,
int batchSize,
A[] arg0,
B[] arg1,
C[] arg2)
Allows three user supplied arguments per event.
|
<A,B> void |
publishEvents(EventTranslatorTwoArg<E,A,B> translator,
A[] arg0,
B[] arg1)
Allows two user supplied arguments per event.
|
<A,B> void |
publishEvents(EventTranslatorTwoArg<E,A,B> translator,
int batchStartsAt,
int batchSize,
A[] arg0,
B[] arg1)
Allows two user supplied arguments per event.
|
void |
publishEvents(EventTranslatorVararg<E> translator,
int batchStartsAt,
int batchSize,
java.lang.Object[]... args)
Allows a variable number of user supplied arguments per event.
|
void |
publishEvents(EventTranslatorVararg<E> translator,
java.lang.Object[]... args)
Allows a variable number of user supplied arguments per event.
|
long |
remainingCapacity()
Get the remaining capacity for this ringBuffer.
|
boolean |
removeGatingSequence(Sequence sequence)
Remove the specified sequence from this ringBuffer.
|
void |
resetTo(long sequence)
Deprecated.
|
long |
tryNext()
Increment and return the next sequence for the ring buffer.
|
long |
tryNext(int n)
The same functionality as
tryNext() , but allows the caller to attempt
to claim the next n sequences. |
boolean |
tryPublishEvent(EventTranslator<E> translator)
Attempts to publish an event to the ring buffer.
|
<A> boolean |
tryPublishEvent(EventTranslatorOneArg<E,A> translator,
A arg0)
Allows one user supplied argument.
|
<A,B,C> boolean |
tryPublishEvent(EventTranslatorThreeArg<E,A,B,C> translator,
A arg0,
B arg1,
C arg2)
Allows three user supplied arguments
|
<A,B> boolean |
tryPublishEvent(EventTranslatorTwoArg<E,A,B> translator,
A arg0,
B arg1)
Allows two user supplied arguments.
|
boolean |
tryPublishEvent(EventTranslatorVararg<E> translator,
java.lang.Object... args)
Allows a variable number of user supplied arguments
|
boolean |
tryPublishEvents(EventTranslator<E>[] translators)
Attempts to publish multiple events to the ring buffer.
|
boolean |
tryPublishEvents(EventTranslator<E>[] translators,
int batchStartsAt,
int batchSize)
Attempts to publish multiple events to the ring buffer.
|
<A> boolean |
tryPublishEvents(EventTranslatorOneArg<E,A> translator,
A[] arg0)
Allows one user supplied argument.
|
<A> boolean |
tryPublishEvents(EventTranslatorOneArg<E,A> translator,
int batchStartsAt,
int batchSize,
A[] arg0)
Allows one user supplied argument.
|
<A,B,C> boolean |
tryPublishEvents(EventTranslatorThreeArg<E,A,B,C> translator,
A[] arg0,
B[] arg1,
C[] arg2)
Allows three user supplied arguments per event.
|
<A,B,C> boolean |
tryPublishEvents(EventTranslatorThreeArg<E,A,B,C> translator,
int batchStartsAt,
int batchSize,
A[] arg0,
B[] arg1,
C[] arg2)
Allows three user supplied arguments per event.
|
<A,B> boolean |
tryPublishEvents(EventTranslatorTwoArg<E,A,B> translator,
A[] arg0,
B[] arg1)
Allows two user supplied arguments per event.
|
<A,B> boolean |
tryPublishEvents(EventTranslatorTwoArg<E,A,B> translator,
int batchStartsAt,
int batchSize,
A[] arg0,
B[] arg1)
Allows two user supplied arguments per event.
|
boolean |
tryPublishEvents(EventTranslatorVararg<E> translator,
int batchStartsAt,
int batchSize,
java.lang.Object[]... args)
Allows a variable number of user supplied arguments per event.
|
boolean |
tryPublishEvents(EventTranslatorVararg<E> translator,
java.lang.Object[]... args)
Allows a variable number of user supplied arguments per event.
|
public static final long INITIAL_CURSOR_VALUE
public static <E> RingBuffer<E> createMultiProducer(EventFactory<E> factory, int bufferSize, WaitStrategy waitStrategy)
factory
- used to create the events within the ring buffer.bufferSize
- number of elements to create within the ring buffer.waitStrategy
- used to determine how to wait for new elements to become available.java.lang.IllegalArgumentException
- if bufferSize is less than 1 or not a power of 2MultiProducerSequencer
public static <E> RingBuffer<E> createMultiProducer(EventFactory<E> factory, int bufferSize)
BlockingWaitStrategy
.factory
- used to create the events within the ring buffer.bufferSize
- number of elements to create within the ring buffer.java.lang.IllegalArgumentException
- if bufferSize is less than 1 or not a power of 2MultiProducerSequencer
public static <E> RingBuffer<E> createSingleProducer(EventFactory<E> factory, int bufferSize, WaitStrategy waitStrategy)
factory
- used to create the events within the ring buffer.bufferSize
- number of elements to create within the ring buffer.waitStrategy
- used to determine how to wait for new elements to become available.java.lang.IllegalArgumentException
- if bufferSize is less than 1 or not a power of 2SingleProducerSequencer
public static <E> RingBuffer<E> createSingleProducer(EventFactory<E> factory, int bufferSize)
BlockingWaitStrategy
.factory
- used to create the events within the ring buffer.bufferSize
- number of elements to create within the ring buffer.java.lang.IllegalArgumentException
- if bufferSize is less than 1 or not a power of 2MultiProducerSequencer
public static <E> RingBuffer<E> create(ProducerType producerType, EventFactory<E> factory, int bufferSize, WaitStrategy waitStrategy)
producerType
- producer type to use ProducerType
.factory
- used to create events within the ring buffer.bufferSize
- number of elements to create within the ring buffer.waitStrategy
- used to determine how to wait for new elements to become available.java.lang.IllegalArgumentException
- if bufferSize is less than 1 or not a power of 2public E get(long sequence)
Get the event for a given sequence in the RingBuffer.
This call has 2 uses. Firstly use this call when publishing to a ring buffer.
After calling next()
use this call to get hold of the
preallocated event to fill with data before calling publish(long)
.
Secondly use this call when consuming data from the ring buffer. After calling
SequenceBarrier.waitFor(long)
call this method with any value greater than
that your current consumer sequence and less than or equal to the value returned from
the SequenceBarrier.waitFor(long)
method.
get
in interface DataProvider<E>
sequence
- for the eventpublic long next()
long sequence = ringBuffer.next(); try { Event e = ringBuffer.get(sequence); // Do some work with the event. } finally { ringBuffer.publish(sequence); }
next
in interface Sequenced
publish(long)
,
get(long)
public long next(int n)
next()
, but allows the caller to claim
the next n sequences.next
in interface Sequenced
n
- number of slots to claimSequenced.next(int)
public long tryNext() throws InsufficientCapacityException
Increment and return the next sequence for the ring buffer. Calls of this method should ensure that they always publish the sequence afterward. E.g.
long sequence = ringBuffer.next(); try { Event e = ringBuffer.get(sequence); // Do some work with the event. } finally { ringBuffer.publish(sequence); }
This method will not block if there is not space available in the ring
buffer, instead it will throw an InsufficientCapacityException
.
tryNext
in interface Sequenced
InsufficientCapacityException
- if the necessary space in the ring buffer is not availablepublish(long)
,
get(long)
public long tryNext(int n) throws InsufficientCapacityException
tryNext()
, but allows the caller to attempt
to claim the next n sequences.tryNext
in interface Sequenced
n
- number of slots to claimInsufficientCapacityException
- if the necessary space in the ring buffer is not available@Deprecated public void resetTo(long sequence)
sequence
- The sequence to reset too.java.lang.IllegalStateException
- If any gating sequences have already been specified.public E claimAndGetPreallocated(long sequence)
sequence
- The sequence to claim.public boolean isPublished(long sequence)
sequence
- The sequence to identify the entry.public void addGatingSequences(Sequence... gatingSequences)
gatingSequences
- The sequences to add.public long getMinimumGatingSequence()
public boolean removeGatingSequence(Sequence sequence)
sequence
- to be removed.public SequenceBarrier newBarrier(Sequence... sequencesToTrack)
sequencesToTrack
- the additional sequences to trackSequenceBarrier
public EventPoller<E> newPoller(Sequence... gatingSequences)
gatingSequences
- public long getCursor()
Sequencer
that is being used.getCursor
in interface Cursored
MultiProducerSequencer
,
SingleProducerSequencer
public int getBufferSize()
getBufferSize
in interface Sequenced
public boolean hasAvailableCapacity(int requiredCapacity)
next()
will not block. Especially true if this
ring buffer is set up to handle multiple producers.hasAvailableCapacity
in interface Sequenced
requiredCapacity
- The capacity to check for.public void publishEvent(EventTranslator<E> translator)
EventSink
publishEvent
in interface EventSink<E>
translator
- The user specified translation for the eventEventSink.publishEvent(com.lmax.disruptor.EventTranslator)
public boolean tryPublishEvent(EventTranslator<E> translator)
EventSink
tryPublishEvent
in interface EventSink<E>
translator
- The user specified translation for the eventEventSink.tryPublishEvent(com.lmax.disruptor.EventTranslator)
public <A> void publishEvent(EventTranslatorOneArg<E,A> translator, A arg0)
EventSink
publishEvent
in interface EventSink<E>
translator
- The user specified translation for the eventarg0
- A user supplied argument.com.lmax.disruptor.EventSink#publishEvent(com.lmax.disruptor.EventTranslatorOneArg, A)
public <A> boolean tryPublishEvent(EventTranslatorOneArg<E,A> translator, A arg0)
EventSink
tryPublishEvent
in interface EventSink<E>
translator
- The user specified translation for the eventarg0
- A user supplied argument.com.lmax.disruptor.EventSink#tryPublishEvent(com.lmax.disruptor.EventTranslatorOneArg, A)
public <A,B> void publishEvent(EventTranslatorTwoArg<E,A,B> translator, A arg0, B arg1)
EventSink
publishEvent
in interface EventSink<E>
translator
- The user specified translation for the eventarg0
- A user supplied argument.arg1
- A user supplied argument.com.lmax.disruptor.EventSink#publishEvent(com.lmax.disruptor.EventTranslatorTwoArg, A, B)
public <A,B> boolean tryPublishEvent(EventTranslatorTwoArg<E,A,B> translator, A arg0, B arg1)
EventSink
tryPublishEvent
in interface EventSink<E>
translator
- The user specified translation for the eventarg0
- A user supplied argument.arg1
- A user supplied argument.com.lmax.disruptor.EventSink#tryPublishEvent(com.lmax.disruptor.EventTranslatorTwoArg, A, B)
public <A,B,C> void publishEvent(EventTranslatorThreeArg<E,A,B,C> translator, A arg0, B arg1, C arg2)
EventSink
publishEvent
in interface EventSink<E>
translator
- The user specified translation for the eventarg0
- A user supplied argument.arg1
- A user supplied argument.arg2
- A user supplied argument.com.lmax.disruptor.EventSink#publishEvent(com.lmax.disruptor.EventTranslatorThreeArg, A, B, C)
public <A,B,C> boolean tryPublishEvent(EventTranslatorThreeArg<E,A,B,C> translator, A arg0, B arg1, C arg2)
EventSink
tryPublishEvent
in interface EventSink<E>
translator
- The user specified translation for the eventarg0
- A user supplied argument.arg1
- A user supplied argument.arg2
- A user supplied argument.com.lmax.disruptor.EventSink#tryPublishEvent(com.lmax.disruptor.EventTranslatorThreeArg, A, B, C)
public void publishEvent(EventTranslatorVararg<E> translator, java.lang.Object... args)
EventSink
publishEvent
in interface EventSink<E>
translator
- The user specified translation for the eventargs
- User supplied arguments.EventSink.publishEvent(com.lmax.disruptor.EventTranslatorVararg, java.lang.Object...)
public boolean tryPublishEvent(EventTranslatorVararg<E> translator, java.lang.Object... args)
EventSink
tryPublishEvent
in interface EventSink<E>
translator
- The user specified translation for the eventargs
- User supplied arguments.EventSink.tryPublishEvent(com.lmax.disruptor.EventTranslatorVararg, java.lang.Object...)
public void publishEvents(EventTranslator<E>[] translators)
EventSink
With this call the data that is to be inserted into the ring buffer will be a field (either explicitly or captured anonymously), therefore this call will require an instance of the translator for each value that is to be inserted into the ring buffer.
publishEvents
in interface EventSink<E>
translators
- The user specified translation for each eventEventSink.publishEvents(com.lmax.disruptor.EventTranslator[])
public void publishEvents(EventTranslator<E>[] translators, int batchStartsAt, int batchSize)
EventSink
With this call the data that is to be inserted into the ring buffer will be a field (either explicitly or captured anonymously), therefore this call will require an instance of the translator for each value that is to be inserted into the ring buffer.
publishEvents
in interface EventSink<E>
translators
- The user specified translation for each eventbatchStartsAt
- The first element of the array which is within the batch.batchSize
- The actual size of the batchEventSink.publishEvents(com.lmax.disruptor.EventTranslator[], int, int)
public boolean tryPublishEvents(EventTranslator<E>[] translators)
EventSink
tryPublishEvents
in interface EventSink<E>
translators
- The user specified translation for the eventEventSink.tryPublishEvents(com.lmax.disruptor.EventTranslator[])
public boolean tryPublishEvents(EventTranslator<E>[] translators, int batchStartsAt, int batchSize)
EventSink
tryPublishEvents
in interface EventSink<E>
translators
- The user specified translation for the eventbatchStartsAt
- The first element of the array which is within the batch.batchSize
- The actual size of the batchEventSink.tryPublishEvents(com.lmax.disruptor.EventTranslator[], int, int)
public <A> void publishEvents(EventTranslatorOneArg<E,A> translator, A[] arg0)
EventSink
publishEvents
in interface EventSink<E>
translator
- The user specified translation for the eventarg0
- A user supplied argument.com.lmax.disruptor.EventSink#publishEvents(com.lmax.disruptor.EventTranslatorOneArg, A[])
public <A> void publishEvents(EventTranslatorOneArg<E,A> translator, int batchStartsAt, int batchSize, A[] arg0)
EventSink
publishEvents
in interface EventSink<E>
translator
- The user specified translation for each eventbatchStartsAt
- The first element of the array which is within the batch.batchSize
- The actual size of the batcharg0
- An array of user supplied arguments, one element per event.com.lmax.disruptor.EventSink#publishEvents(com.lmax.disruptor.EventTranslatorOneArg, int, int, A[])
public <A> boolean tryPublishEvents(EventTranslatorOneArg<E,A> translator, A[] arg0)
EventSink
tryPublishEvents
in interface EventSink<E>
translator
- The user specified translation for each eventarg0
- An array of user supplied arguments, one element per event.com.lmax.disruptor.EventSink#tryPublishEvents(com.lmax.disruptor.EventTranslatorOneArg, A[])
public <A> boolean tryPublishEvents(EventTranslatorOneArg<E,A> translator, int batchStartsAt, int batchSize, A[] arg0)
EventSink
tryPublishEvents
in interface EventSink<E>
translator
- The user specified translation for each eventbatchStartsAt
- The first element of the array which is within the batch.batchSize
- The actual size of the batcharg0
- An array of user supplied arguments, one element per event.com.lmax.disruptor.EventSink#tryPublishEvents(com.lmax.disruptor.EventTranslatorOneArg, int, int, A[])
public <A,B> void publishEvents(EventTranslatorTwoArg<E,A,B> translator, A[] arg0, B[] arg1)
EventSink
publishEvents
in interface EventSink<E>
translator
- The user specified translation for the eventarg0
- An array of user supplied arguments, one element per event.arg1
- An array of user supplied arguments, one element per event.com.lmax.disruptor.EventSink#publishEvents(com.lmax.disruptor.EventTranslatorTwoArg, A[], B[])
public <A,B> void publishEvents(EventTranslatorTwoArg<E,A,B> translator, int batchStartsAt, int batchSize, A[] arg0, B[] arg1)
EventSink
publishEvents
in interface EventSink<E>
translator
- The user specified translation for the eventbatchStartsAt
- The first element of the array which is within the batch.batchSize
- The actual size of the batch.arg0
- An array of user supplied arguments, one element per event.arg1
- An array of user supplied arguments, one element per event.com.lmax.disruptor.EventSink#publishEvents(com.lmax.disruptor.EventTranslatorTwoArg, int, int, A[], B[])
public <A,B> boolean tryPublishEvents(EventTranslatorTwoArg<E,A,B> translator, A[] arg0, B[] arg1)
EventSink
tryPublishEvents
in interface EventSink<E>
translator
- The user specified translation for the eventarg0
- An array of user supplied arguments, one element per event.arg1
- An array of user supplied arguments, one element per event.com.lmax.disruptor.EventSink#tryPublishEvents(com.lmax.disruptor.EventTranslatorTwoArg, A[], B[])
public <A,B> boolean tryPublishEvents(EventTranslatorTwoArg<E,A,B> translator, int batchStartsAt, int batchSize, A[] arg0, B[] arg1)
EventSink
tryPublishEvents
in interface EventSink<E>
translator
- The user specified translation for the eventbatchStartsAt
- The first element of the array which is within the batch.batchSize
- The actual size of the batch.arg0
- An array of user supplied arguments, one element per event.arg1
- An array of user supplied arguments, one element per event.com.lmax.disruptor.EventSink#tryPublishEvents(com.lmax.disruptor.EventTranslatorTwoArg, int, int, A[], B[])
public <A,B,C> void publishEvents(EventTranslatorThreeArg<E,A,B,C> translator, A[] arg0, B[] arg1, C[] arg2)
EventSink
publishEvents
in interface EventSink<E>
translator
- The user specified translation for the eventarg0
- An array of user supplied arguments, one element per event.arg1
- An array of user supplied arguments, one element per event.arg2
- An array of user supplied arguments, one element per event.com.lmax.disruptor.EventSink#publishEvents(com.lmax.disruptor.EventTranslatorThreeArg, A[], B[], C[])
public <A,B,C> void publishEvents(EventTranslatorThreeArg<E,A,B,C> translator, int batchStartsAt, int batchSize, A[] arg0, B[] arg1, C[] arg2)
EventSink
publishEvents
in interface EventSink<E>
translator
- The user specified translation for the eventbatchStartsAt
- The first element of the array which is within the batch.batchSize
- The number of elements in the batch.arg0
- An array of user supplied arguments, one element per event.arg1
- An array of user supplied arguments, one element per event.arg2
- An array of user supplied arguments, one element per event.com.lmax.disruptor.EventSink#publishEvents(com.lmax.disruptor.EventTranslatorThreeArg, int, int, A[], B[], C[])
public <A,B,C> boolean tryPublishEvents(EventTranslatorThreeArg<E,A,B,C> translator, A[] arg0, B[] arg1, C[] arg2)
EventSink
tryPublishEvents
in interface EventSink<E>
translator
- The user specified translation for the eventarg0
- An array of user supplied arguments, one element per event.arg1
- An array of user supplied arguments, one element per event.arg2
- An array of user supplied arguments, one element per event.com.lmax.disruptor.EventSink#tryPublishEvents(com.lmax.disruptor.EventTranslatorThreeArg, A[], B[], C[])
public <A,B,C> boolean tryPublishEvents(EventTranslatorThreeArg<E,A,B,C> translator, int batchStartsAt, int batchSize, A[] arg0, B[] arg1, C[] arg2)
EventSink
tryPublishEvents
in interface EventSink<E>
translator
- The user specified translation for the eventbatchStartsAt
- The first element of the array which is within the batch.batchSize
- The actual size of the batch.arg0
- An array of user supplied arguments, one element per event.arg1
- An array of user supplied arguments, one element per event.arg2
- An array of user supplied arguments, one element per event.com.lmax.disruptor.EventSink#tryPublishEvents(com.lmax.disruptor.EventTranslatorThreeArg, int, int, A[], B[], C[])
public void publishEvents(EventTranslatorVararg<E> translator, java.lang.Object[]... args)
EventSink
publishEvents
in interface EventSink<E>
translator
- The user specified translation for the eventargs
- User supplied arguments, one Object[] per event.EventSink.publishEvents(com.lmax.disruptor.EventTranslatorVararg, java.lang.Object[][])
public void publishEvents(EventTranslatorVararg<E> translator, int batchStartsAt, int batchSize, java.lang.Object[]... args)
EventSink
publishEvents
in interface EventSink<E>
translator
- The user specified translation for the eventbatchStartsAt
- The first element of the array which is within the batch.batchSize
- The actual size of the batchargs
- User supplied arguments, one Object[] per event.EventSink.publishEvents(com.lmax.disruptor.EventTranslatorVararg, int, int, java.lang.Object[][])
public boolean tryPublishEvents(EventTranslatorVararg<E> translator, java.lang.Object[]... args)
EventSink
tryPublishEvents
in interface EventSink<E>
translator
- The user specified translation for the eventargs
- User supplied arguments, one Object[] per event.EventSink.tryPublishEvents(com.lmax.disruptor.EventTranslatorVararg, java.lang.Object[][])
public boolean tryPublishEvents(EventTranslatorVararg<E> translator, int batchStartsAt, int batchSize, java.lang.Object[]... args)
EventSink
tryPublishEvents
in interface EventSink<E>
translator
- The user specified translation for the eventbatchStartsAt
- The first element of the array which is within the batch.batchSize
- The actual size of the batch.args
- User supplied arguments, one Object[] per event.EventSink.tryPublishEvents(com.lmax.disruptor.EventTranslatorVararg, int, int, java.lang.Object[][])
public void publish(long sequence)
public void publish(long lo, long hi)
publish
in interface Sequenced
lo
- the lowest sequence number to be publishedhi
- the highest sequence number to be publishedSequenced.next(int)
public long remainingCapacity()
remainingCapacity
in interface Sequenced
Copyright © 2011 - 2015 LMAX Ltd. All Rights Reserved.