Package org.apache.druid.segment
Interface TransformableRowIterator
-
- All Superinterfaces:
AutoCloseable
,Closeable
,RowIterator
,TimeAndDimsIterator
- All Known Implementing Classes:
ForwardingRowIterator
public interface TransformableRowIterator extends RowIterator
TransformableRowIterator tightensRowIterator.getPointer()
contract, that allows to transform iterated rows without allocations on each iterations, and reuse the mechanics of the underlying iterator. SeeIndexMerger.toMergedIndexRowIterator(org.apache.druid.segment.TransformableRowIterator, int, java.util.List<org.apache.druid.segment.DimensionMergerV9>)
for an example.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TimeAndDimsPointer
getMarkedPointer()
Returns a pointer to the row, that was the current row whenRowIterator.mark()
was called for the last time.RowPointer
getPointer()
Returns a pointer to the current row.-
Methods inherited from interface org.apache.druid.segment.RowIterator
hasTimeAndDimsChangedSinceMark, mark
-
Methods inherited from interface org.apache.druid.segment.TimeAndDimsIterator
close, moveToNext
-
-
-
-
Method Detail
-
getPointer
RowPointer getPointer()
Returns a pointer to the current row. This method _always returns the same object_, but pointing to different row after eachTimeAndDimsIterator.moveToNext()
call that returns {@link true}. Other aspects of the behaviour of this method are the same as in the genericRowIterator.getPointer()
contract.- Specified by:
getPointer
in interfaceRowIterator
- Specified by:
getPointer
in interfaceTimeAndDimsIterator
-
getMarkedPointer
TimeAndDimsPointer getMarkedPointer()
Returns a pointer to the row, that was the current row whenRowIterator.mark()
was called for the last time. This method always returns the same object, but pointing to different rows after eachRowIterator.mark()
call. This method must not be called before ever calling toTimeAndDimsIterator.moveToNext()
. If the very first call toTimeAndDimsIterator.moveToNext()
returnedfalse
, the behaviour of this method is undefined (it may return a "wrong" pointer, null, throw an exception, etc.). This method could be called before the first call toRowIterator.mark()
(it should return the same object as it is required to return after all subsequentRowIterator.mark()
calls), but the data of the returned pointer should not be accessed before the first call toRowIterator.mark()
. This method is used inRowCombiningTimeAndDimsIterator
implementation. getMarkedPointer() returnsTimeAndDimsPointer
instead ofRowPointer
(likegetPointer()
) merely becauseRowCombiningTimeAndDimsIterator
doesn't need this method to return anything more specific thanTimeAndDimsPointer
.
-
-