public abstract class AbstractSingleArrayBlock extends Object implements Block
| Modifier and Type | Field and Description |
|---|---|
protected int |
start |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractSingleArrayBlock(int start) |
| Modifier and Type | Method and Description |
|---|---|
int |
bytesCompare(int position,
int offset,
int length,
io.airlift.slice.Slice otherSlice,
int otherOffset,
int otherLength)
Compares the byte sequences at
offset in the value at position
to the byte sequence at otherOffset in otherSlice. |
boolean |
bytesEqual(int position,
int offset,
io.airlift.slice.Slice otherSlice,
int otherOffset,
int length)
Is the byte sequences at
offset in the value at position equal
to the byte sequence at otherOffset in otherSlice. |
int |
compareTo(int leftPosition,
int leftOffset,
int leftLength,
Block rightBlock,
int rightPosition,
int rightOffset,
int rightLength)
Compares the byte sequences at
offset in the value at position
to the byte sequence at otherOffset in the value at otherPosition
in otherBlock. |
Block |
copyPositions(int[] positions,
int offset,
int length)
Returns a block containing the specified positions.
|
Block |
copyRegion(int position,
int length)
Returns a block starting at the specified position and extends for the
specified length.
|
boolean |
equals(int position,
int offset,
Block otherBlock,
int otherPosition,
int otherOffset,
int length)
Is the byte sequences at
offset in the value at position equal
to the byte sequence at otherOffset in the value at otherPosition
in otherBlock. |
protected abstract Block |
getBlock() |
Block |
getBlock(int position)
Gets a block in the value at
position. |
Block |
getBlockUnchecked(int internalPosition)
Gets a Block value at
internalPosition - getOffsetBase(). |
byte |
getByte(int position)
Gets a byte in the value at
position. |
byte |
getByteUnchecked(int internalPosition)
Gets a byte value at
internalPosition - getOffsetBase(). |
String |
getEncodingName()
Get the encoding for this block.
|
long |
getEstimatedDataSizeForStats(int position)
Returns the estimated in memory data size for stats of position.
|
int |
getInt(int position)
Gets a little endian int in the value at
position. |
int |
getIntUnchecked(int internalPosition)
Gets a little endian int value at
internalPosition - getOffsetBase(). |
long |
getLong(int position)
Gets a little endian long in the value at
position. |
long |
getLong(int position,
int offset)
Gets a little endian long at
offset in the value at position. |
long |
getLongUnchecked(int internalPosition)
Gets a little endian long value at
internalPosition - getOffsetBase(). |
long |
getLongUnchecked(int internalPosition,
int offset)
Gets a little endian long at
offset in the value at internalPosition - getOffsetBase(). |
int |
getOffsetBase() |
long |
getPositionsSizeInBytes(boolean[] positions,
int usedPositionCount)
Returns the size of all positions marked true in the positions array.
|
Block |
getRegion(int position,
int length)
Returns a block starting at the specified position and extends for the
specified length.
|
long |
getRegionSizeInBytes(int position,
int length)
Returns the size of
block.getRegion(position, length). |
short |
getShort(int position)
Gets a little endian short at in the value at
position. |
short |
getShortUnchecked(int internalPosition)
Gets a little endian short at value at
internalPosition - getOffsetBase(). |
Block |
getSingleValueBlock(int position)
Gets the value at the specified position as a single element block.
|
io.airlift.slice.Slice |
getSlice(int position,
int offset,
int length)
Gets a slice at
offset in the value at position. |
int |
getSliceLength(int position)
Gets the length of the value at the
position. |
int |
getSliceLengthUnchecked(int internalPosition)
Gets the length of the slice value at
internalPosition - getOffsetBase(). |
io.airlift.slice.Slice |
getSliceUnchecked(int internalPosition,
int offset,
int length)
Gets a slice with offset
offset at internalPosition - getOffsetBase(). |
long |
hash(int position,
int offset,
int length)
Calculates the hash code the byte sequences at
offset in the
value at position. |
boolean |
isNull(int position)
Is the specified position null?
|
boolean |
isNullUnchecked(int internalPosition) |
void |
writeBytesTo(int position,
int offset,
int length,
BlockBuilder blockBuilder)
Appends the byte sequences at
offset in the value at position
to blockBuilder. |
void |
writeBytesTo(int position,
int offset,
int length,
io.airlift.slice.SliceOutput sliceOutput)
Appends the byte sequences at
offset in the value at position
to sliceOutput. |
void |
writePositionTo(int position,
BlockBuilder blockBuilder)
Appends the value at
position to blockBuilder and close the entry. |
void |
writePositionTo(int position,
io.airlift.slice.SliceOutput output)
Appends the value at
position to output. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitappendNull, fixedSizeInBytesPerPosition, getApproximateRegionLogicalSizeInBytes, getLoadedBlock, getLogicalSizeInBytes, getPositionCount, getPositions, getRegionLogicalSizeInBytes, getRetainedSizeInBytes, getSizeInBytes, mayHaveNull, retainedBytesForEachPartprotected abstract Block getBlock()
public int getSliceLength(int position)
Blockposition.
This method must be implemented if @{code getSlice} is implemented.getSliceLength in interface Blockpublic byte getByte(int position)
Blockposition.public short getShort(int position)
Blockposition.public int getInt(int position)
Blockposition.public long getLong(int position)
Blockposition.public long getLong(int position,
int offset)
Blockoffset in the value at position.public io.airlift.slice.Slice getSlice(int position,
int offset,
int length)
Blockoffset in the value at position.public Block getBlock(int position)
Blockposition.public boolean bytesEqual(int position,
int offset,
io.airlift.slice.Slice otherSlice,
int otherOffset,
int length)
Blockoffset in the value at position equal
to the byte sequence at otherOffset in otherSlice.
This method must be implemented if @{code getSlice} is implemented.bytesEqual in interface Blockpublic int bytesCompare(int position,
int offset,
int length,
io.airlift.slice.Slice otherSlice,
int otherOffset,
int otherLength)
Blockoffset in the value at position
to the byte sequence at otherOffset in otherSlice.
This method must be implemented if @{code getSlice} is implemented.bytesCompare in interface Blockpublic void writeBytesTo(int position,
int offset,
int length,
BlockBuilder blockBuilder)
Blockoffset in the value at position
to blockBuilder.
This method must be implemented if @{code getSlice} is implemented.writeBytesTo in interface Blockpublic void writeBytesTo(int position,
int offset,
int length,
io.airlift.slice.SliceOutput sliceOutput)
Blockoffset in the value at position
to sliceOutput.
This method must be implemented if @{code getSlice} is implemented.writeBytesTo in interface Blockpublic void writePositionTo(int position,
BlockBuilder blockBuilder)
Blockposition to blockBuilder and close the entry.writePositionTo in interface Blockpublic void writePositionTo(int position,
io.airlift.slice.SliceOutput output)
Blockposition to output.writePositionTo in interface Blockpublic boolean equals(int position,
int offset,
Block otherBlock,
int otherPosition,
int otherOffset,
int length)
Blockoffset in the value at position equal
to the byte sequence at otherOffset in the value at otherPosition
in otherBlock.
This method must be implemented if @{code getSlice} is implemented.public long hash(int position,
int offset,
int length)
Blockoffset in the
value at position.
This method must be implemented if @{code getSlice} is implemented.public int compareTo(int leftPosition,
int leftOffset,
int leftLength,
Block rightBlock,
int rightPosition,
int rightOffset,
int rightLength)
Blockoffset in the value at position
to the byte sequence at otherOffset in the value at otherPosition
in otherBlock.
This method must be implemented if @{code getSlice} is implemented.public Block getSingleValueBlock(int position)
BlockThis method is useful for operators that hold on to a single value without holding on to the entire block.
getSingleValueBlock in interface Blockpublic long getEstimatedDataSizeForStats(int position)
BlockgetEstimatedDataSizeForStats in interface Blockpublic boolean isNull(int position)
Blockpublic String getEncodingName()
BlockgetEncodingName in interface Blockpublic Block copyPositions(int[] positions, int offset, int length)
Blockpositions array
that starts at offset and has length of length.
All specified positions must be valid for this block.
The returned block must be a compact representation of the original block.
copyPositions in interface Blockpublic Block getRegion(int position, int length)
BlockThe region can be a view over this block. If this block is released the region block may also be released. If the region block is released this block may also be released.
public long getRegionSizeInBytes(int position,
int length)
Blockblock.getRegion(position, length).
The method can be expensive. Do not use it outside an implementation of Block.getRegionSizeInBytes in interface Blockpublic long getPositionsSizeInBytes(boolean[] positions,
int usedPositionCount)
Blockblock.getRegionSizeInBytes(position, length)
where you mark all positions for the regions first.getPositionsSizeInBytes in interface Blockpublic Block copyRegion(int position, int length)
BlockThe region returned must be a compact representation of the original block, unless their internal representation will be exactly the same. This method is useful for operators that hold on to a range of values without holding on to the entire block.
copyRegion in interface Blockpublic int getSliceLengthUnchecked(int internalPosition)
UncheckedBlockinternalPosition - getOffsetBase().
This method must be implemented if getSliceUnchecked is implemented.getSliceLengthUnchecked in interface UncheckedBlockpublic byte getByteUnchecked(int internalPosition)
UncheckedBlockinternalPosition - getOffsetBase().getByteUnchecked in interface UncheckedBlockpublic short getShortUnchecked(int internalPosition)
UncheckedBlockinternalPosition - getOffsetBase().getShortUnchecked in interface UncheckedBlockpublic int getIntUnchecked(int internalPosition)
UncheckedBlockinternalPosition - getOffsetBase().getIntUnchecked in interface UncheckedBlockpublic long getLongUnchecked(int internalPosition)
UncheckedBlockinternalPosition - getOffsetBase().getLongUnchecked in interface UncheckedBlockpublic long getLongUnchecked(int internalPosition,
int offset)
UncheckedBlockoffset in the value at internalPosition - getOffsetBase().getLongUnchecked in interface UncheckedBlockpublic io.airlift.slice.Slice getSliceUnchecked(int internalPosition,
int offset,
int length)
UncheckedBlockoffset at internalPosition - getOffsetBase().getSliceUnchecked in interface UncheckedBlockpublic Block getBlockUnchecked(int internalPosition)
UncheckedBlockinternalPosition - getOffsetBase().getBlockUnchecked in interface UncheckedBlockpublic int getOffsetBase()
getOffsetBase in interface UncheckedBlockpublic boolean isNullUnchecked(int internalPosition)
isNullUnchecked in interface UncheckedBlockinternalPosition - getOffsetBase() is nullCopyright © 2012–2022. All rights reserved.