Module org.elasticsearch.compute
Package org.elasticsearch.compute.lucene
Class IndexedByShardIdFromSingleton<T>
java.lang.Object
org.elasticsearch.compute.lucene.IndexedByShardIdFromSingleton<T>
- All Implemented Interfaces:
IndexedByShardId<T>
A simple implementation when there's only a single value being used.
-
Constructor Summary
ConstructorsConstructorDescriptionIndexedByShardIdFromSingleton(T value) IndexedByShardIdFromSingleton(T value, int shardId) -
Method Summary
Modifier and TypeMethodDescriptionget(int shardId) 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
-
Constructor Details
-
IndexedByShardIdFromSingleton
-
IndexedByShardIdFromSingleton
-
-
Method Details
-
get
- Specified by:
getin interfaceIndexedByShardId<T>
-
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<T>
-
size
public int size()Description copied from interface:IndexedByShardIdThe number of elements returned byIndexedByShardId.iterable().- Specified by:
sizein interfaceIndexedByShardId<T>
-
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<T>
-