E
- type of the elements stored in the queue.public class ManyToOneConcurrentArrayQueue<E> extends Object
Modifier and Type | Field and Description |
---|---|
protected AtomicReferenceArray<E> |
buffer |
protected int |
capacity |
protected long |
head |
protected static AtomicLongFieldUpdater<com.hazelcast.internal.util.concurrent.AbstractConcurrentArrayQueueConsumer> |
HEAD |
protected long |
headCache |
protected long |
p1 |
protected long |
p10 |
protected long |
p11 |
protected long |
p12 |
protected long |
p13 |
protected long |
p14 |
protected long |
p15 |
protected long |
p16 |
protected long |
p17 |
protected long |
p18 |
protected long |
p19 |
protected long |
p2 |
protected long |
p20 |
protected long |
p21 |
protected long |
p22 |
protected long |
p23 |
protected long |
p24 |
protected long |
p25 |
protected long |
p26 |
protected long |
p27 |
protected long |
p28 |
protected long |
p29 |
protected long |
p3 |
protected long |
p30 |
protected long |
p31 |
protected long |
p32 |
protected long |
p33 |
protected long |
p34 |
protected long |
p35 |
protected long |
p36 |
protected long |
p37 |
protected long |
p38 |
protected long |
p39 |
protected long |
p4 |
protected long |
p40 |
protected long |
p41 |
protected long |
p42 |
protected long |
p43 |
protected long |
p44 |
protected long |
p45 |
protected long |
p5 |
protected long |
p6 |
protected long |
p7 |
protected long |
p8 |
protected long |
p9 |
protected static AtomicLongFieldUpdater<com.hazelcast.internal.util.concurrent.AbstractConcurrentArrayQueueProducer> |
SHARED_HEAD_CACHE |
protected long |
sharedHeadCache |
protected long |
tail |
protected static AtomicLongFieldUpdater<com.hazelcast.internal.util.concurrent.AbstractConcurrentArrayQueueProducer> |
TAIL |
Constructor and Description |
---|
ManyToOneConcurrentArrayQueue(int requestedCapacity) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(E e) |
boolean |
addAll(Collection<? extends E> c) |
long |
addedCount()
Returns the number of items added to this pipe since creation.
|
int |
capacity()
Returns the number of items this pipe can hold at a time.
|
void |
clear() |
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
int |
drain(Predicate<? super E> itemHandler)
Drains the items available in the pipe to the supplied item handler.
|
int |
drainTo(Collection<? super E> target,
int limit)
Drains at most
limit available items into the provided
Collection . |
E |
element() |
boolean |
isEmpty() |
Iterator<E> |
iterator() |
boolean |
offer(E e) |
E |
peek() |
E |
poll() |
int |
remainingCapacity()
Returns the number of items this pipe has still room for.
|
E |
remove() |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
long |
removedCount()
Returns the number of items removed from this pipe since creation.
|
boolean |
retainAll(Collection<?> c) |
protected static int |
seqToArrayIndex(long sequence,
long mask) |
int |
size() |
Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
equals, hashCode, parallelStream, removeIf, spliterator, stream
protected final int capacity
protected final AtomicReferenceArray<E> buffer
protected long p31
protected long p32
protected long p33
protected long p34
protected long p35
protected long p36
protected long p37
protected long p38
protected long p39
protected long p40
protected long p41
protected long p42
protected long p43
protected long p44
protected long p45
protected static final AtomicLongFieldUpdater<com.hazelcast.internal.util.concurrent.AbstractConcurrentArrayQueueConsumer> HEAD
protected volatile long head
protected long p16
protected long p17
protected long p18
protected long p19
protected long p20
protected long p21
protected long p22
protected long p23
protected long p24
protected long p25
protected long p26
protected long p27
protected long p28
protected long p29
protected long p30
protected static final AtomicLongFieldUpdater<com.hazelcast.internal.util.concurrent.AbstractConcurrentArrayQueueProducer> TAIL
protected static final AtomicLongFieldUpdater<com.hazelcast.internal.util.concurrent.AbstractConcurrentArrayQueueProducer> SHARED_HEAD_CACHE
protected volatile long tail
protected long headCache
protected volatile long sharedHeadCache
protected long p1
protected long p2
protected long p3
protected long p4
protected long p5
protected long p6
protected long p7
protected long p8
protected long p9
protected long p10
protected long p11
protected long p12
protected long p13
protected long p14
protected long p15
public ManyToOneConcurrentArrayQueue(int requestedCapacity)
public boolean offer(E e)
public E poll()
public int drain(Predicate<? super E> itemHandler)
Pipe
boolean
which decides whether to continue
draining. If it returns false
, this method refrains from draining
further items and returns.
Implementation note: this method is expected to take advantage of the fact that many items are being drained at once and minimize the per-item cost of housekeeping.
itemHandler
- the item handlerpublic int drainTo(Collection<? super E> target, int limit)
Pipe
limit
available items into the provided
Collection
.
Implementation note: this method is expected to take advantage of the fact that many items are being drained at once and minimize the per-item cost of housekeeping.
target
- destination for the drained itemslimit
- the maximum number of items to drainpublic long addedCount()
Pipe
addedCount
in interface Pipe<E>
public long removedCount()
Pipe
removedCount
in interface Pipe<E>
public int capacity()
Pipe
public int remainingCapacity()
Pipe
remainingCapacity
in interface Pipe<E>
public boolean add(E e)
add
in interface Collection<E>
add
in interface Queue<E>
public boolean isEmpty()
isEmpty
in interface Collection<E>
public boolean contains(Object o)
contains
in interface Collection<E>
public Iterator<E> iterator()
iterator
in interface Iterable<E>
iterator
in interface Collection<E>
public Object[] toArray()
toArray
in interface Collection<E>
public <T> T[] toArray(T[] a)
toArray
in interface Collection<E>
public boolean remove(Object o)
remove
in interface Collection<E>
public boolean containsAll(Collection<?> c)
containsAll
in interface Collection<E>
public boolean addAll(Collection<? extends E> c)
addAll
in interface Collection<E>
public boolean removeAll(Collection<?> c)
removeAll
in interface Collection<E>
public boolean retainAll(Collection<?> c)
retainAll
in interface Collection<E>
public void clear()
clear
in interface Collection<E>
public int size()
size
in interface Collection<E>
protected static int seqToArrayIndex(long sequence, long mask)
Copyright © 2017 Hazelcast, Inc.. All Rights Reserved.