Class IndexedByShardIdFromList<T>

java.lang.Object
org.elasticsearch.compute.lucene.IndexedByShardIdFromList<T>
All Implemented Interfaces:
IndexedByShardId<T>

public class IndexedByShardIdFromList<T> extends Object implements IndexedByShardId<T>
An IndexedByShardId used by only in tests, but placed here so it's visible for all test modules.
  • Constructor Details

    • IndexedByShardIdFromList

      public IndexedByShardIdFromList(List<T> list)
  • Method Details

    • get

      public T get(int shardId)
      Specified by:
      get in interface IndexedByShardId<T>
    • iterable

      public Iterable<? extends T> iterable()
      Description copied from interface: IndexedByShardId
      This 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:
      iterable in interface IndexedByShardId<T>
    • size

      public int size()
      Description copied from interface: IndexedByShardId
      The number of elements returned by IndexedByShardId.iterable().
      Specified by:
      size in interface IndexedByShardId<T>
    • map

      public <S> IndexedByShardId<S> map(Function<T,S> mapper)
      Description copied from interface: IndexedByShardId
      The elements are mapped lazily, i.e., the function would also apply to future elements (as opposed to collection().stream().map, which only maps the current elements).
      Specified by:
      map in interface IndexedByShardId<T>