public final class SequenceGroup extends Sequence
Sequence group that can dynamically have Sequences added and removed while being
thread safe.
The get() and set(long) methods are lock free and can be
concurrently be called with the add(Sequence) and remove(Sequence).
| Constructor and Description |
|---|
SequenceGroup()
Default Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(Sequence sequence)
Add a
Sequence into this aggregate. |
void |
addWhileRunning(Cursored cursored,
Sequence sequence)
Adds a sequence to the sequence group after threads have started to publish to
the Disruptor.
|
long |
get()
Get the minimum sequence value for the group.
|
boolean |
remove(Sequence sequence)
Remove the first occurrence of the
Sequence from this aggregate. |
void |
set(long value)
Set all
Sequences in the group to a given value. |
int |
size()
Get the size of the group.
|
addAndGet, compareAndSet, incrementAndGet, setVolatile, toStringpublic long get()
public void set(long value)
Sequences in the group to a given value.public void add(Sequence sequence)
Sequence into this aggregate. This should only be used during
initialisation. Use addWhileRunning(Cursored, Sequence)sequence - to be added to the aggregate.addWhileRunning(Cursored, Sequence)public boolean remove(Sequence sequence)
Sequence from this aggregate.sequence - to be removed from this aggregate.public int size()
public void addWhileRunning(Cursored cursored, Sequence sequence)
cursored - The data structure that the owner of this sequence group will
be pulling it's events from.sequence - The sequence to add.Copyright © 2011 - 2018 LMAX Ltd. All Rights Reserved.