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
    Collection<? extends T>
    This is not necessarily a list of all values visible via get(int), but rather, a list of the relevant values.
    get(int shardId)
     
    default boolean
     
    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).
  • Method Details

    • get

      T get(int shardId)
    • collection

      Collection<? extends T> collection()
      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.
    • 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).