Package org.apache.cassandra.locator
Class AbstractReplicaCollection.ReplicaList
java.lang.Object
org.apache.cassandra.locator.AbstractReplicaCollection.ReplicaList
- Enclosing class:
- AbstractReplicaCollection<C extends AbstractReplicaCollection<C>>
protected static final class AbstractReplicaCollection.ReplicaList
extends Object
implements Iterable<Replica>
A simple list with no comodification checks and immutability by default (only append permitted, and only one initial copy)
this permits us to reduce the amount of garbage generated, by not wrapping iterators or unnecessarily copying
and reduces the amount of indirection necessary, as well as ensuring monomorphic callsites
TODO flatten into AbstractReplicaCollection?
-
Constructor Summary
ConstructorsConstructorDescriptionReplicaList(int capacity) ReplicaList(Replica[] contents, int begin, int size) -
Method Summary
Modifier and TypeMethodDescriptionvoidfinal booleanintbooleanvoidprotected <T> voidget(int index) booleanisEmpty()booleaniterator()intsize()sorted(Comparator<? super Replica> comparator) stream()subList(int begin, int end) <K> Iterator<K>transformIterator(Function<? super Replica, ? extends K> function)
-
Constructor Details
-
ReplicaList
public ReplicaList() -
ReplicaList
public ReplicaList(int capacity) -
ReplicaList
-
-
Method Details
-
isSubList
-
get
-
add
-
size
public int size() -
isEmpty
public boolean isEmpty() -
subList
-
sorted
-
stream
-
forEach
-
count
-
anyMatch
-
spliterator
- Specified by:
spliteratorin interfaceIterable<Replica>
-
iterator
-
transformIterator
-
forEach
-
equals
-