Class IntrusiveStack<T extends IntrusiveStack<T>>
- java.lang.Object
-
- org.apache.cassandra.utils.concurrent.IntrusiveStack<T>
-
- Type Parameters:
T
-
- All Implemented Interfaces:
java.lang.Iterable<T>
- Direct Known Subclasses:
FailureRecordingCallback.FailureResponses
public class IntrusiveStack<T extends IntrusiveStack<T>> extends java.lang.Object implements java.lang.Iterable<T>
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 Modifier and Type Class Description protected static interface
IntrusiveStack.Setter<O,T>
-
Constructor Summary
Constructors Constructor Description IntrusiveStack()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static <T extends IntrusiveStack<T>>
longaccumulate(T list, LongAccumulator<T> accumulator, long initialValue)
void
forEach(java.util.function.Consumer<? super T> forEach)
protected static <T extends IntrusiveStack<T>>
voidforEach(T list, java.util.function.Consumer<? super T> forEach)
protected static <T extends IntrusiveStack<T>,O>
java.lang.Iterable<T>iterable(java.util.concurrent.atomic.AtomicReferenceFieldUpdater<O,T> headUpdater, O owner)
protected static <T extends IntrusiveStack<T>>
java.lang.Iterable<T>iterable(T list)
java.util.Iterator<T>
iterator()
protected static <T extends IntrusiveStack<T>>
java.util.Iterator<T>iterator(T list)
protected static <O,T extends IntrusiveStack<T>>
Tpush(java.util.concurrent.atomic.AtomicReferenceFieldUpdater<? super O,T> headUpdater, O owner, T prepend)
protected static <O,T extends IntrusiveStack<T>>
Tpush(java.util.concurrent.atomic.AtomicReferenceFieldUpdater<O,T> headUpdater, O owner, T prepend, java.util.function.BiFunction<T,T,T> combine)
protected static <O,T extends IntrusiveStack<T>>
Tpush(java.util.function.Function<O,T> getter, IntrusiveStack.Setter<O,T> setter, O owner, T prepend)
protected static <O,T extends IntrusiveStack<T>>
Tpush(java.util.function.Function<O,T> getter, IntrusiveStack.Setter<O,T> setter, O owner, T prepend, java.util.function.BiFunction<T,T,T> combine)
protected static <T extends IntrusiveStack<T>,O>
voidpushExclusive(java.util.concurrent.atomic.AtomicReferenceFieldUpdater<O,T> headUpdater, O owner, T prepend)
protected static <O,T extends IntrusiveStack<T>>
voidpushExclusive(java.util.concurrent.atomic.AtomicReferenceFieldUpdater<O,T> headUpdater, O owner, T prepend, java.util.function.BiFunction<T,T,T> combine)
protected static <T extends IntrusiveStack<T>>
TpushExclusive(T head, T prepend)
protected T
reverse()
protected static <T extends IntrusiveStack<T>>
Treverse(T list)
protected static int
size(IntrusiveStack<?> list)
-
-
-
Method Detail
-
push
@Inline protected static <O,T extends IntrusiveStack<T>> T push(java.util.concurrent.atomic.AtomicReferenceFieldUpdater<? super O,T> headUpdater, O owner, T prepend)
-
push
protected static <O,T extends IntrusiveStack<T>> T push(java.util.concurrent.atomic.AtomicReferenceFieldUpdater<O,T> headUpdater, O owner, T prepend, java.util.function.BiFunction<T,T,T> combine)
-
push
@Inline protected static <O,T extends IntrusiveStack<T>> T push(java.util.function.Function<O,T> getter, IntrusiveStack.Setter<O,T> setter, O owner, T prepend)
-
push
protected static <O,T extends IntrusiveStack<T>> T push(java.util.function.Function<O,T> getter, IntrusiveStack.Setter<O,T> setter, O owner, T prepend, java.util.function.BiFunction<T,T,T> combine)
-
pushExclusive
protected static <O,T extends IntrusiveStack<T>> void pushExclusive(java.util.concurrent.atomic.AtomicReferenceFieldUpdater<O,T> headUpdater, O owner, T prepend, java.util.function.BiFunction<T,T,T> combine)
-
pushExclusive
protected static <T extends IntrusiveStack<T>,O> void pushExclusive(java.util.concurrent.atomic.AtomicReferenceFieldUpdater<O,T> headUpdater, O owner, T prepend)
-
pushExclusive
protected static <T extends IntrusiveStack<T>> T pushExclusive(T head, T prepend)
-
iterable
protected static <T extends IntrusiveStack<T>,O> java.lang.Iterable<T> iterable(java.util.concurrent.atomic.AtomicReferenceFieldUpdater<O,T> headUpdater, O owner)
-
iterable
protected static <T extends IntrusiveStack<T>> java.lang.Iterable<T> iterable(T list)
-
iterator
protected static <T extends IntrusiveStack<T>> java.util.Iterator<T> iterator(T list)
-
size
protected static int size(IntrusiveStack<?> list)
-
accumulate
protected static <T extends IntrusiveStack<T>> long accumulate(T list, LongAccumulator<T> accumulator, long initialValue)
-
reverse
protected T reverse()
-
reverse
protected static <T extends IntrusiveStack<T>> T reverse(T list)
-
forEach
public void forEach(java.util.function.Consumer<? super T> forEach)
- Specified by:
forEach
in interfacejava.lang.Iterable<T extends IntrusiveStack<T>>
-
forEach
protected static <T extends IntrusiveStack<T>> void forEach(T list, java.util.function.Consumer<? super T> forEach)
-
iterator
public java.util.Iterator<T> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<T extends IntrusiveStack<T>>
-
-