Interface PostingList
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Subinterfaces:
OrdinalPostingList
- All Known Implementing Classes:
FilteringPostingList,IntArrayPostingList,MergePostingList,PackedLongsPostingList,PeekablePostingList,PostingList.EmptyPostingList,PostingsReader
Interface for advancing on and consuming a posting list.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionlongadvance(long targetRowID) Advances to the first row ID beyond the current that is greater than or equal to the target, and returns that row ID.default voidclose()default longmaximum()default longminimum()longRetrieves the next segment row ID, not including row IDs that have been returned byadvance(long).longsize()Returns the upper bound of postings in the list.
-
Field Details
-
EMPTY
-
OFFSET_NOT_FOUND
static final long OFFSET_NOT_FOUND- See Also:
-
END_OF_STREAM
static final long END_OF_STREAM- See Also:
-
-
Method Details
-
close
default void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
minimum
default long minimum() -
maximum
default long maximum() -
nextPosting
Retrieves the next segment row ID, not including row IDs that have been returned byadvance(long).- Returns:
- next segment row ID
- Throws:
IOException
-
size
long size()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. -
advance
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 returnsEND_OF_STREAMif the target is greater than the highest row ID.Note: Callers must use the return value of this method before calling
nextPosting(), as calling that method will return the next posting, not the one to which we have just advanced.- Parameters:
targetRowID- target row ID to advance to- Returns:
- first segment row ID which is >= the target row ID or
END_OF_STREAMif one does not exist - Throws:
IOException
-