Class FilteringPostingList

java.lang.Object
org.apache.cassandra.index.sai.disk.v1.postings.FilteringPostingList
All Implemented Interfaces:
Closeable, AutoCloseable, PostingList

public class FilteringPostingList extends Object implements PostingList
A wrapper that iterates over a delegate PostingList, filtering out postings at positions that are not present in a provided filter.
  • Constructor Details

    • FilteringPostingList

      public FilteringPostingList(org.apache.lucene.util.FixedBitSet filter, OrdinalPostingList delegate)
  • Method Details

    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface PostingList
    • nextPosting

      public long nextPosting() throws IOException
      Description copied from interface: PostingList
      Retrieves the next segment row ID, not including row IDs that have been returned by PostingList.advance(long).
      Specified by:
      nextPosting in interface PostingList
      Returns:
      the segment row ID of the next match
      Throws:
      IOException
    • size

      public long size()
      Description copied from interface: PostingList
      Returns the upper bound of postings in the list. During a merge individual postings may be de-duplicated, so we can't return the exact size only the upper bound of the size.
      Specified by:
      size in interface PostingList
    • advance

      public long advance(long targetRowID) throws IOException
      Description copied from interface: PostingList
      Advances to the first row ID beyond the current that is greater than or equal to the target, and returns that row ID. Exhausts the iterator and returns PostingList.END_OF_STREAM if the target is greater than the highest row ID.

      Note: Callers must use the return value of this method before calling PostingList.nextPosting(), as calling that method will return the next posting, not the one to which we have just advanced.

      Specified by:
      advance in interface PostingList
      Parameters:
      targetRowID - target row ID to advance to
      Returns:
      first segment row ID which is >= the target row ID or PostingList.END_OF_STREAM if one does not exist
      Throws:
      IOException