Package org.apache.druid.segment.data
Class Offset
java.lang.Object
org.apache.druid.segment.data.Offset
- All Implemented Interfaces:
Cloneable,HotLoopCallee,ReadableOffset
- Direct Known Subclasses:
BitmapOffset,FilteredOffset,QueryableIndexCursorHolder.TimestampCheckingOffset,SimpleSettableOffset
@SubclassesMustBePublic
public abstract class Offset
extends Object
implements ReadableOffset, Cloneable
The "mutable" version of a ReadableOffset. Introduces "increment()" and "withinBounds()" methods, which are
very similar to "next()" and "hasNext()" on the Iterator interface except increment() does not return a value.
This class is not thread-safe, all it's methods, including
reset() and clone(), must be called
from a single thread.
Annotated with SubclassesMustBePublic because Offset occurrences are replaced with a subclass in Historical1SimpleDoubleAggPooledTopNScannerPrototype and HistoricalSingleValueDimSelector1SimpleDoubleAggPooledTopNScannerPrototype during
specialization, and specialized version of those prototypes must be able to any subclass of Offset.
This interface is the core "pointer" interface that is used to create ColumnValueSelectors
over historical segments. It's counterpart for incremental index is IncrementalIndexRowHolder.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()abstract ReadableOffsetReturns the same offset ("this") or a readable "view" of this offset, which always returns the same value fromReadableOffset.getOffset(), as this offset.abstract voidMove to next offsetabstract voidreset()Resets the Offset to the position it was created or cloned with.abstract booleanCheck if current offset position is within the valid rangeMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.druid.query.monomorphicprocessing.HotLoopCallee
inspectRuntimeShapeMethods inherited from interface org.apache.druid.segment.data.ReadableOffset
getOffset
-
Constructor Details
-
Offset
public Offset()
-
-
Method Details
-
increment
Move to next offset -
withinBounds
Check if current offset position is within the valid range -
reset
public abstract void reset()Resets the Offset to the position it was created or cloned with. -
getBaseReadableOffset
Returns the same offset ("this") or a readable "view" of this offset, which always returns the same value fromReadableOffset.getOffset(), as this offset. This method is useful for "unwrapping" such offsets asFilteredOffsetand reduce reference indirection, when onlyReadableOffsetAPI is needed. -
clone
-