Interface IndexedByShardId<T>

All Known Implementing Classes:
AlwaysReferencedIndexedByShardId, FirstDocIdGroupingAggregatorFunction.MappedShardRefs, IndexedByShardIdFromList, IndexedByShardIdFromSingleton

public interface IndexedByShardId<T>
Ceci n'est pas une List (though it may be backed by one). Using this interface instead of a list makes it explicit that the values are not necessarily continuous by index, especially after the reduce-side top n operation has been run, or it can be sliced up into groups, e.g., 0..10, 10..20, etc., as done in DataNodeComputeHandler and with the help of the ComputeSearchContextByShardId subclass, which is the main production implementation. When you see this class, it will usually be parameterized by ShardContext, its super classes, or one of its variants, e.g., LuceneQueryEvaluator.ShardConfig. These shard IDs are sliced up by DataNodeComputeHandler, and depend on the MAX_CONCURRENT_SHARDS_PER_NODE setting.
  • Method Summary

    Modifier and Type
    Method
    Description
    get(int shardId)
     
    default boolean
     
    Iterable<? extends T>
    This is not necessarily an iterable of all values visible via get(int), but rather, an iterable of the relevant values.
    map(Function<T,S> mapper)
    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).
    int
    The number of elements returned by iterable().
  • Method Details

    • get

      T get(int shardId)
    • iterable

      Iterable<? extends T> iterable()
      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.
    • size

      int size()
      The number of elements returned by iterable().
    • isEmpty

      default boolean isEmpty()
    • map

      <S> IndexedByShardId<S> map(Function<T,S> mapper)
      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).