Class TimeSeriesSourceOperator

All Implemented Interfaces:
Closeable, AutoCloseable, Operator, org.elasticsearch.core.Releasable

public final class TimeSeriesSourceOperator extends LuceneSourceOperator
Extension of LuceneSourceOperator for time-series aggregation that inserts metadata blocks, such as slice index and future max timestamp, to allow downstream operators to optimize processing.
  • Constructor Details

    • TimeSeriesSourceOperator

      public TimeSeriesSourceOperator(List<? extends org.elasticsearch.core.RefCounted> shardContextCounters, BlockFactory blockFactory, int maxPageSize, LuceneSliceQueue sliceQueue, int limit, Limiter limiter)
  • Method Details

    • numMetadataBlocks

      protected int numMetadataBlocks()
      Overrides:
      numMetadataBlocks in class LuceneSourceOperator
    • buildMetadataBlocks

      protected void buildMetadataBlocks(Block[] blocks, int offset, int currentPagePos)
      Overrides:
      buildMetadataBlocks in class LuceneSourceOperator
    • pageSize

      public static int pageSize(long estimateRowSizeInBytes, long maxPageSizeInBytes)
      For time-series queries, try to use a page size that is a multiple of CHUNK_SIZE (see NUMERIC_BLOCK_SIZE in the tsdb codec) to enable bulk loading of numeric or tsid fields. Avoid pages that are too large, as this can disable bulk loading if there are holes in the doc IDs and disable constant block optimizations. Therefore, we cap the page size at 2048, which balances the overhead per page with the benefits of bulk loading and constant blocks.