Module org.elasticsearch.compute
Package org.elasticsearch.compute.lucene
Class AlwaysReferencedIndexedByShardId
java.lang.Object
org.elasticsearch.compute.lucene.AlwaysReferencedIndexedByShardId
- All Implemented Interfaces:
IndexedByShardId<org.elasticsearch.core.RefCounted>
public class AlwaysReferencedIndexedByShardId
extends Object
implements IndexedByShardId<org.elasticsearch.core.RefCounted>
An implementation which always returns
RefCounted.ALWAYS_REFERENCED for any shard ID. Used by tests, but defined here so it could
also be used by the benchmarks.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionorg.elasticsearch.core.RefCountedget(int shardId) Iterable<? extends org.elasticsearch.core.RefCounted> iterable()This is not necessarily an iterable of all values visible via get(int), but rather, an iterable of the relevant values.<S> IndexedByShardId<S> The elements are mapped lazily, i.e., the function would also apply to future elements (as opposed tocollection().stream().map, which only maps the current elements).intsize()The number of elements returned byIndexedByShardId.iterable().Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.compute.lucene.IndexedByShardId
isEmpty
-
Field Details
-
INSTANCE
-
-
Method Details
-
get
public org.elasticsearch.core.RefCounted get(int shardId) - Specified by:
getin interfaceIndexedByShardId<org.elasticsearch.core.RefCounted>
-
iterable
Description copied from interface:IndexedByShardIdThis is not necessarily an iterable of all values visible via get(int), but rather, an iterable of the relevant values. This is useful when you need to perform an operation over all relevant values, e.g., closing them.- Specified by:
iterablein interfaceIndexedByShardId<org.elasticsearch.core.RefCounted>
-
size
public int size()Description copied from interface:IndexedByShardIdThe number of elements returned byIndexedByShardId.iterable().- Specified by:
sizein interfaceIndexedByShardId<org.elasticsearch.core.RefCounted>
-
map
Description copied from interface:IndexedByShardIdThe elements are mapped lazily, i.e., the function would also apply to future elements (as opposed tocollection().stream().map, which only maps the current elements).- Specified by:
mapin interfaceIndexedByShardId<org.elasticsearch.core.RefCounted>
-