Package org.apache.druid.segment
Interface TransformableRowIterator
- All Superinterfaces:
AutoCloseable,Closeable,RowIterator,TimeAndDimsIterator
- All Known Implementing Classes:
ForwardingRowIterator
TransformableRowIterator tightens
RowIterator.getPointer() contract, that allows to transform iterated
rows without allocations on each iterations, and reuse the mechanics of the underlying iterator. See IndexMerger.toMergedIndexRowIterator(org.apache.druid.segment.TransformableRowIterator, int, java.util.List<org.apache.druid.segment.DimensionMergerV9>) for an example.-
Method Summary
Modifier and TypeMethodDescriptionReturns a pointer to the row, that was the current row whenRowIterator.mark()was called for the last time.Returns a pointer to the current row.Methods inherited from interface org.apache.druid.segment.RowIterator
hasTimeAndDimsChangedSinceMark, markMethods inherited from interface org.apache.druid.segment.TimeAndDimsIterator
close, moveToNext
-
Method Details
-
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}. Other aspects of the behaviour of this method are the same as in the genericinvalid @link
{@link trueRowIterator.getPointer()contract.- Specified by:
getPointerin interfaceRowIterator- Specified by:
getPointerin 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 inRowCombiningTimeAndDimsIteratorimplementation. getMarkedPointer() returnsTimeAndDimsPointerinstead ofRowPointer(likegetPointer()) merely becauseRowCombiningTimeAndDimsIteratordoesn't need this method to return anything more specific thanTimeAndDimsPointer.
-