| Constructor and Description |
|---|
LazyBlock(int positionCount,
LazyBlockLoader<LazyBlock> loader) |
| Modifier and Type | Method and Description |
|---|---|
void |
assureLoaded()
Assures that all data for the block is in memory.
|
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(List<Integer> positions)
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. |
Block |
getBlock() |
byte |
getByte(int position,
int offset)
Gets a byte at
offset in the value at position. |
double |
getDouble(int position,
int offset)
Gets a little endian double at
offset in the value at position. |
BlockEncoding |
getEncoding()
Get the encoding for this block.
|
float |
getFloat(int position,
int offset)
Gets a little endian float at
offset in the value at position. |
int |
getInt(int position,
int offset)
Gets a little endian int at
offset in the value at position. |
int |
getLength(int position)
Gets the length of the value at the
position. |
long |
getLong(int position,
int offset)
Gets a little endian long at
offset in the value at position. |
<T> T |
getObject(int position,
Class<T> clazz)
Gets an object in the value at
position. |
int |
getPositionCount()
Returns the number of positions in this block.
|
Block |
getRegion(int positionOffset,
int length)
Returns a block starting at the specified position and extends for the
specified length.
|
int |
getRetainedSizeInBytes()
Returns the retained size of this block in memory.
|
short |
getShort(int position,
int offset)
Gets a little endian short at
offset in the value at position. |
Block |
getSingleValueBlock(int position)
Gets the value at the specified position as a single element block.
|
int |
getSizeInBytes()
Returns the logical size of this block in memory.
|
io.airlift.slice.Slice |
getSlice(int position,
int offset,
int length)
Gets a slice at
offset in the value at position. |
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?
|
void |
setBlock(Block block) |
void |
writeBytesTo(int position,
int offset,
int length,
BlockBuilder blockBuilder)
Appends the byte sequences at
offset in the value at position
to blockBuilder. |
void |
writePositionTo(int position,
BlockBuilder blockBuilder)
Appends the value at
position to blockBuilder. |
public LazyBlock(int positionCount,
LazyBlockLoader<LazyBlock> loader)
public int getPositionCount()
BlockgetPositionCount in interface Blockpublic int getLength(int position)
Blockposition.public byte getByte(int position,
int offset)
Blockoffset in the value at position.public short getShort(int position,
int offset)
Blockoffset in the value at position.public int getInt(int position,
int offset)
Blockoffset in the value at position.public long getLong(int position,
int offset)
Blockoffset in the value at position.public float getFloat(int position,
int offset)
Blockoffset in the value at position.public double getDouble(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 <T> T getObject(int position,
Class<T> clazz)
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.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.bytesCompare in interface Blockpublic void writeBytesTo(int position,
int offset,
int length,
BlockBuilder blockBuilder)
Blockoffset in the value at position
to blockBuilder.writeBytesTo in interface Blockpublic void writePositionTo(int position,
BlockBuilder blockBuilder)
Blockposition to blockBuilder.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.public long hash(int position,
int offset,
int length)
Blockoffset in the
value at position.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.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 int getSizeInBytes()
BlockgetSizeInBytes in interface Blockpublic int getRetainedSizeInBytes()
BlockgetRetainedSizeInBytes in interface Blockpublic BlockEncoding getEncoding()
BlockgetEncoding in interface Blockpublic Block copyPositions(List<Integer> positions)
BlockThe returned block must be a compact representation of the original block.
copyPositions in interface Blockpublic Block getRegion(int positionOffset, 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 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 boolean isNull(int position)
Blockpublic Block getBlock()
public void setBlock(Block block)
public void assureLoaded()
BlockThis allows streaming data sources to skip sections that are not accessed in a query.
assureLoaded in interface BlockCopyright © 2012-2016. All Rights Reserved.