Package org.apache.druid.segment
Class RowBasedCursor<RowType>
- java.lang.Object
-
- org.apache.druid.segment.RowBasedCursor<RowType>
-
- All Implemented Interfaces:
Cursor
public class RowBasedCursor<RowType> extends Object implements Cursor
ACursorthat is based on a stream of objects. Generally created by aRowBasedCursorFactory.- See Also:
for implementation notes
-
-
Constructor Summary
Constructors Constructor Description RowBasedCursor(RowWalker<RowType> rowWalker, RowAdapter<RowType> rowAdapter, Filter filter, org.joda.time.Interval interval, VirtualColumns virtualColumns, boolean descending, RowSignature rowSignature)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadvance()Advance the cursor to the next position, checking if thread has been interrupted after advancing and possibly throwingQueryInterruptedExceptionif so.voidadvanceUninterruptibly()Advance to the cursor to the next position.ColumnSelectorFactorygetColumnSelectorFactory()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().booleanisDoneOrInterrupted()Check if the current cursor position is valid, or if the thread has been interrupted.voidreset()Reset to start of cursor.
-
-
-
Constructor Detail
-
RowBasedCursor
public RowBasedCursor(RowWalker<RowType> rowWalker, RowAdapter<RowType> rowAdapter, @Nullable Filter filter, org.joda.time.Interval interval, VirtualColumns virtualColumns, boolean descending, RowSignature rowSignature)
-
-
Method Detail
-
getColumnSelectorFactory
public ColumnSelectorFactory 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
-
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()
Description copied from interface:CursorAdvance to the cursor to the next position. Callers should checkCursor.isDone()orCursor.isDoneOrInterrupted()before getting the next value from a selector. However, underlying implementation may still check for thread interruption if advancing the cursor is a long-running operation.- 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:
Cursor.isDone()
-
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.
-
-