public final class SequenceGroup extends Sequence
Sequence
group that can dynamically have Sequence
s 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)
.
Modifier and Type | Field and Description |
---|---|
protected long |
p1 |
protected long |
p10 |
protected long |
p11 |
protected long |
p12 |
protected long |
p13 |
protected long |
p14 |
protected long |
p15 |
protected long |
p2 |
protected long |
p3 |
protected long |
p4 |
protected long |
p5 |
protected long |
p6 |
protected long |
p7 |
protected long |
p9 |
protected long |
value |
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
Sequence s in the group to a given value. |
int |
size()
Get the size of the group.
|
addAndGet, compareAndSet, incrementAndGet, setVolatile, toString
protected long p9
protected long p10
protected long p11
protected long p12
protected long p13
protected long p14
protected long p15
protected volatile long value
protected long p1
protected long p2
protected long p3
protected long p4
protected long p5
protected long p6
protected long p7
public long get()
public void set(long value)
Sequence
s 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 © 2017. All Rights Reserved.