Class PrefetchingCentroidIterator

java.lang.Object
org.elasticsearch.index.codec.vectors.diskbbq.PrefetchingCentroidIterator
All Implemented Interfaces:
CentroidIterator

public final class PrefetchingCentroidIterator extends Object implements CentroidIterator
A configurable iterator that prefetches posting lists ahead of consumption to optimize disk I/O performance. This iterator wraps another CentroidIterator and maintains a configurable buffer of prefetched posting list locations. The iterator is not thread-safe and is designed for single-threaded access.
  • Constructor Details

    • PrefetchingCentroidIterator

      public PrefetchingCentroidIterator(CentroidIterator delegate, org.apache.lucene.store.IndexInput postingListSlice) throws IOException
      Creates a prefetching iterator with default prefetch depth of 1.
      Parameters:
      delegate - the underlying centroid iterator
      postingListSlice - the index input for posting lists
      Throws:
      IOException - if prefetching fails during initialization
    • PrefetchingCentroidIterator

      public PrefetchingCentroidIterator(CentroidIterator delegate, org.apache.lucene.store.IndexInput postingListSlice, int prefetchAhead) throws IOException
      Creates a prefetching iterator with configurable prefetch depth.
      Parameters:
      delegate - the underlying centroid iterator
      postingListSlice - the index input for posting lists
      prefetchAhead - number of posting lists to prefetch ahead (must be >= 1)
      Throws:
      IOException - if prefetching fails during initialization
      IllegalArgumentException - if prefetchAhead < 1
  • Method Details