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 Details

  • Method Details

    • get

      public org.elasticsearch.core.RefCounted get(int shardId)
      Specified by:
      get in interface IndexedByShardId<org.elasticsearch.core.RefCounted>
    • collection

      public Collection<? extends org.elasticsearch.core.RefCounted> 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<org.elasticsearch.core.RefCounted>
    • map

      public <S> IndexedByShardId<S> map(Function<org.elasticsearch.core.RefCounted,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<org.elasticsearch.core.RefCounted>