public interface UncheckedBlock
getOffsetBase() and getPositionCount().
Implementations of UncheckedBlock should perform any boundary checks within assert statements so they can
be disabled in performance critical deployments by disabling assertions.
Example usage:
UncheckedBlock block = ...
int sum = 0;
for (int i = block.getOffsetBase(); i < block.getOffsetBase() + block.getPositionCount(); i++) {
sum += block.getIntUnchecked(i);
}
For nested structures, such as dictionaries and RLEs, the indexing is unchecked with respect to the top
level block, but not with respect to the inner blocks. If, for performance reasons, it is desired to
use unchecked indexing also for the inner blocks, you may unpeel the blocks using existing utilities
such as ColumnarArray, ColumnarMap, ColumnarRow and BlockFlattener.| Modifier and Type | Method and Description |
|---|---|
default Block |
getBlockUnchecked(int internalPosition)
Gets a Block value at
internalPosition - getOffsetBase(). |
default byte |
getByteUnchecked(int internalPosition)
Gets a byte value at
internalPosition - getOffsetBase(). |
default int |
getIntUnchecked(int internalPosition)
Gets a little endian int value at
internalPosition - getOffsetBase(). |
default long |
getLongUnchecked(int internalPosition)
Gets a little endian long value at
internalPosition - getOffsetBase(). |
default long |
getLongUnchecked(int internalPosition,
int offset)
Gets a little endian long at
offset in the value at internalPosition - getOffsetBase(). |
int |
getOffsetBase() |
default short |
getShortUnchecked(int internalPosition)
Gets a little endian short at value at
internalPosition - getOffsetBase(). |
default int |
getSliceLengthUnchecked(int internalPosition)
Gets the length of the slice value at
internalPosition - getOffsetBase(). |
default io.airlift.slice.Slice |
getSliceUnchecked(int internalPosition,
int offset,
int length)
Gets a slice with offset
offset at internalPosition - getOffsetBase(). |
boolean |
isNullUnchecked(int internalPosition) |
default byte getByteUnchecked(int internalPosition)
internalPosition - getOffsetBase().default short getShortUnchecked(int internalPosition)
internalPosition - getOffsetBase().default int getIntUnchecked(int internalPosition)
internalPosition - getOffsetBase().default long getLongUnchecked(int internalPosition)
internalPosition - getOffsetBase().default long getLongUnchecked(int internalPosition,
int offset)
offset in the value at internalPosition - getOffsetBase().default int getSliceLengthUnchecked(int internalPosition)
internalPosition - getOffsetBase().
This method must be implemented if getSliceUnchecked is implemented.default io.airlift.slice.Slice getSliceUnchecked(int internalPosition,
int offset,
int length)
offset at internalPosition - getOffsetBase().default Block getBlockUnchecked(int internalPosition)
internalPosition - getOffsetBase().boolean isNullUnchecked(int internalPosition)
internalPosition - getOffsetBase() is nullint getOffsetBase()
Copyright © 2012–2022. All rights reserved.