Package io.trino.spi.block
Class AbstractVariableWidthBlock
java.lang.Object
io.trino.spi.block.AbstractVariableWidthBlock
- All Implemented Interfaces:
Block
- Direct Known Subclasses:
VariableWidthBlock,VariableWidthBlockBuilder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintbytesCompare(int position, int offset, int length, io.airlift.slice.Slice otherSlice, int otherOffset, int otherLength) Compares the byte sequences atoffsetin the value atpositionto the byte sequence atotherOffsetinotherSlice.booleanbytesEqual(int position, int offset, io.airlift.slice.Slice otherSlice, int otherOffset, int length) Is the byte sequences atoffsetin the value atpositionequal to the byte sequence atotherOffsetinotherSlice.intcompareTo(int position, int offset, int length, Block otherBlock, int otherPosition, int otherOffset, int otherLength) Compares the byte sequences atoffsetin the value atpositionto the byte sequence atotherOffsetin the value atotherPositioninotherBlock.booleanIs the byte sequences atoffsetin the value atpositionequal to the byte sequence atotherOffsetin the value atotherPositioninotherBlock.bytegetByte(int position, int offset) Gets a byte atoffsetin the value atposition.Get the encoding for this block.longgetEstimatedDataSizeForStats(int position) Returns the estimated in memory data size for stats of position.intgetInt(int position, int offset) Gets a little endian int atoffsetin the value atposition.longgetLong(int position, int offset) Gets a little endian long atoffsetin the value atposition.protected abstract intgetPositionOffset(int position) protected abstract io.airlift.slice.SlicegetRawSlice(int position) shortgetShort(int position, int offset) Gets a little endian short atoffsetin the value atposition.getSingleValueBlock(int position) Gets the value at the specified position as a single element block.io.airlift.slice.SlicegetSlice(int position, int offset, int length) Gets a slice atoffsetin the value atposition.longhash(int position, int offset, int length) Calculates the hash code the byte sequences atoffsetin the value atposition.protected abstract booleanisEntryNull(int position) booleanisNull(int position) Is the specified position null?voidwriteBytesTo(int position, int offset, int length, BlockBuilder blockBuilder) Appends the byte sequences atoffsetin the value atpositiontoblockBuilder.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.trino.spi.block.Block
copyPositions, copyRegion, copyWithAppendedNull, fixedSizeInBytesPerPosition, getChildren, getLoadedBlock, getLogicalSizeInBytes, getObject, getPositionCount, getPositions, getPositionsSizeInBytes, getRegion, getRegionSizeInBytes, getRetainedSizeInBytes, getSizeInBytes, getSliceLength, isLoaded, mayHaveNull, retainedBytesForEachPart
-
Constructor Details
-
AbstractVariableWidthBlock
public AbstractVariableWidthBlock()
-
-
Method Details
-
getRawSlice
protected abstract io.airlift.slice.Slice getRawSlice(int position) -
getPositionOffset
protected abstract int getPositionOffset(int position) -
isEntryNull
protected abstract boolean isEntryNull(int position) -
getEncodingName
Description copied from interface:BlockGet the encoding for this block.- Specified by:
getEncodingNamein interfaceBlock
-
getByte
public byte getByte(int position, int offset) Description copied from interface:BlockGets a byte atoffsetin the value atposition. -
getShort
public short getShort(int position, int offset) Description copied from interface:BlockGets a little endian short atoffsetin the value atposition. -
getInt
public int getInt(int position, int offset) Description copied from interface:BlockGets a little endian int atoffsetin the value atposition. -
getLong
public long getLong(int position, int offset) Description copied from interface:BlockGets a little endian long atoffsetin the value atposition. -
getSlice
public io.airlift.slice.Slice getSlice(int position, int offset, int length) Description copied from interface:BlockGets a slice atoffsetin the value atposition. -
equals
public boolean equals(int position, int offset, Block otherBlock, int otherPosition, int otherOffset, int length) Description copied from interface:BlockIs the byte sequences atoffsetin the value atpositionequal to the byte sequence atotherOffsetin the value atotherPositioninotherBlock. This method must be implemented if @{code getSlice} is implemented. -
bytesEqual
public boolean bytesEqual(int position, int offset, io.airlift.slice.Slice otherSlice, int otherOffset, int length) Description copied from interface:BlockIs the byte sequences atoffsetin the value atpositionequal to the byte sequence atotherOffsetinotherSlice. This method must be implemented if @{code getSlice} is implemented.- Specified by:
bytesEqualin interfaceBlock
-
hash
public long hash(int position, int offset, int length) Description copied from interface:BlockCalculates the hash code the byte sequences atoffsetin the value atposition. This method must be implemented if @{code getSlice} is implemented. -
compareTo
public int compareTo(int position, int offset, int length, Block otherBlock, int otherPosition, int otherOffset, int otherLength) Description copied from interface:BlockCompares the byte sequences atoffsetin the value atpositionto the byte sequence atotherOffsetin the value atotherPositioninotherBlock. This method must be implemented if @{code getSlice} is implemented. -
bytesCompare
public int bytesCompare(int position, int offset, int length, io.airlift.slice.Slice otherSlice, int otherOffset, int otherLength) Description copied from interface:BlockCompares the byte sequences atoffsetin the value atpositionto the byte sequence atotherOffsetinotherSlice. This method must be implemented if @{code getSlice} is implemented.- Specified by:
bytesComparein interfaceBlock
-
writeBytesTo
Description copied from interface:BlockAppends the byte sequences atoffsetin the value atpositiontoblockBuilder. This method must be implemented if @{code getSlice} is implemented.- Specified by:
writeBytesToin interfaceBlock
-
getSingleValueBlock
Description copied from interface:BlockGets the value at the specified position as a single element block. The method must copy the data into a new block.This method is useful for operators that hold on to a single value without holding on to the entire block.
- Specified by:
getSingleValueBlockin interfaceBlock
-
getEstimatedDataSizeForStats
public long getEstimatedDataSizeForStats(int position) Description copied from interface:BlockReturns the estimated in memory data size for stats of position. Do not use it for other purpose.- Specified by:
getEstimatedDataSizeForStatsin interfaceBlock
-
isNull
public boolean isNull(int position) Description copied from interface:BlockIs the specified position null?
-