Class IntrusiveStack<T extends IntrusiveStack<T>>
java.lang.Object
org.apache.cassandra.utils.concurrent.IntrusiveStack<T>
- Type Parameters:
T-
- All Implemented Interfaces:
Iterable<T>
- Direct Known Subclasses:
FailureRecordingCallback.FailureResponses
An efficient stack/list that is expected to be ordinarily either empty or close to, and for which
we need concurrent insertions and do not need to support removal - i.e. the list is semi immutable.
This is an intrusive stack, and for simplicity we treat all
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static <T extends IntrusiveStack<T>>
longaccumulate(T list, LongAccumulator<T> accumulator, long initialValue) voidprotected static <T extends IntrusiveStack<T>>
voidprotected static <T extends IntrusiveStack<T>,O>
Iterable<T>iterable(AtomicReferenceFieldUpdater<O, T> headUpdater, O owner) protected static <T extends IntrusiveStack<T>>
Iterable<T>iterable(T list) iterator()protected static <T extends IntrusiveStack<T>>
Iterator<T>iterator(T list) protected static <O,T extends IntrusiveStack<T>>
Tpush(AtomicReferenceFieldUpdater<? super O, T> headUpdater, O owner, T prepend) protected static <O,T extends IntrusiveStack<T>>
Tpush(AtomicReferenceFieldUpdater<O, T> headUpdater, O owner, T prepend, BiFunction<T, T, T> combine) protected static <O,T extends IntrusiveStack<T>>
Tpush(Function<O, T> getter, IntrusiveStack.Setter<O, T> setter, O owner, T prepend) protected static <O,T extends IntrusiveStack<T>>
Tpush(Function<O, T> getter, IntrusiveStack.Setter<O, T> setter, O owner, T prepend, BiFunction<T, T, T> combine) protected static <T extends IntrusiveStack<T>,O>
voidpushExclusive(AtomicReferenceFieldUpdater<O, T> headUpdater, O owner, T prepend) protected static <O,T extends IntrusiveStack<T>>
voidpushExclusive(AtomicReferenceFieldUpdater<O, T> headUpdater, O owner, T prepend, BiFunction<T, T, T> combine) protected static <T extends IntrusiveStack<T>>
TpushExclusive(T head, T prepend) protected Treverse()protected static <T extends IntrusiveStack<T>>
Treverse(T list) protected static intsize(IntrusiveStack<?> list) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
spliterator
-
Constructor Details
-
IntrusiveStack
public IntrusiveStack()
-
-
Method Details
-
push
@Inline protected static <O,T extends IntrusiveStack<T>> T push(AtomicReferenceFieldUpdater<? super O, T> headUpdater, O owner, T prepend) -
push
protected static <O,T extends IntrusiveStack<T>> T push(AtomicReferenceFieldUpdater<O, T> headUpdater, O owner, T prepend, BiFunction<T, T, T> combine) -
push
@Inline protected static <O,T extends IntrusiveStack<T>> T push(Function<O, T> getter, IntrusiveStack.Setter<O, T> setter, O owner, T prepend) -
push
protected static <O,T extends IntrusiveStack<T>> T push(Function<O, T> getter, IntrusiveStack.Setter<O, T> setter, O owner, T prepend, BiFunction<T, T, T> combine) -
pushExclusive
protected static <O,T extends IntrusiveStack<T>> void pushExclusive(AtomicReferenceFieldUpdater<O, T> headUpdater, O owner, T prepend, BiFunction<T, T, T> combine) -
pushExclusive
protected static <T extends IntrusiveStack<T>,O> void pushExclusive(AtomicReferenceFieldUpdater<O, T> headUpdater, O owner, T prepend) -
pushExclusive
-
iterable
protected static <T extends IntrusiveStack<T>,O> Iterable<T> iterable(AtomicReferenceFieldUpdater<O, T> headUpdater, O owner) -
iterable
-
iterator
-
size
-
accumulate
protected static <T extends IntrusiveStack<T>> long accumulate(T list, LongAccumulator<T> accumulator, long initialValue) -
reverse
-
reverse
-
forEach
- Specified by:
forEachin interfaceIterable<T extends IntrusiveStack<T>>
-
forEach
-
iterator
- Specified by:
iteratorin interfaceIterable<T extends IntrusiveStack<T>>
-