Package org.apache.druid.segment.join
Class PostJoinCursor
java.lang.Object
org.apache.druid.segment.join.PostJoinCursor
- All Implemented Interfaces:
Cursor
A Cursor decorator used by
HashJoinSegmentCursorFactory.makeCursorHolder(CursorBuildSpec) to add post-join
virtual columns and filters.-
Method Summary
Modifier and TypeMethodDescriptionvoidadvance()Advance the cursor to the next position, checking if thread has been interrupted after advancing and possibly throwingQueryInterruptedExceptionif so.voidAdvancing the post-join requires evaluating the join on whole segment and advancing without interruption can take a long time if there are no matches but the join itself is big.Get aColumnSelectorFactorywhose selectors will be backed by the row values at the current position of the cursorbooleanisDone()Check if the current cursor position is valid, returning false if there are values to read from selectors created byCursor.getColumnSelectorFactory().booleanCheck if the current cursor position is valid, or if the thread has been interrupted.voidreset()Reset to start of cursor.voidsetValueMatcher(ValueMatcher valueMatcher) static PostJoinCursorwrap(Cursor baseCursor, VirtualColumns virtualColumns, Filter filter)
-
Method Details
-
wrap
public static PostJoinCursor wrap(Cursor baseCursor, VirtualColumns virtualColumns, @Nullable Filter filter) -
setValueMatcher
-
getColumnSelectorFactory
Description copied from interface:CursorGet aColumnSelectorFactorywhose selectors will be backed by the row values at the current position of the cursor- Specified by:
getColumnSelectorFactoryin interfaceCursor
-
getPostJoinFilter
-
advance
public void advance()Description copied from interface:CursorAdvance the cursor to the next position, checking if thread has been interrupted after advancing and possibly throwingQueryInterruptedExceptionif so. Callers should checkCursor.isDone()orCursor.isDoneOrInterrupted()before getting the next value from a selector. -
advanceUninterruptibly
public void advanceUninterruptibly()Advancing the post-join requires evaluating the join on whole segment and advancing without interruption can take a long time if there are no matches but the join itself is big. This can leave the thread running well after the timeout elapses. One such issue is described in CPU thread running PostJoinCursor cannot be terminated- Specified by:
advanceUninterruptiblyin interfaceCursor
-
isDone
public boolean isDone()Description copied from interface:CursorCheck if the current cursor position is valid, returning false if there are values to read from selectors created byCursor.getColumnSelectorFactory(). If true, any such selectors will no longer produce values. -
isDoneOrInterrupted
public boolean isDoneOrInterrupted()Description copied from interface:CursorCheck if the current cursor position is valid, or if the thread has been interrupted.- Specified by:
isDoneOrInterruptedin interfaceCursor- See Also:
-
reset
public void reset()Description copied from interface:CursorReset to start of cursor. Most cursor implementations are backed by immutable data, but there is generically no guarantee that advancing through a cursor again will read exactly the same data or even number of rows, since the underlying data might be mutable in some cases.
-