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>
    • collection

      public Collection<? extends T> collection()
      Description copied from interface: IndexedByShardId
      This is not necessarily a list of all values visible via get(int), but rather, a list of the relevant values. This is useful when you need to perform an operation over all relevant values, e.g., closing them.
      Specified by:
      collection 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>