public abstract class AbstractMapBlock extends Object implements Block
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractMapBlock.HashTables |
| Modifier and Type | Field and Description |
|---|---|
protected MethodHandle |
keyBlockHashCode |
protected MethodHandle |
keyBlockNativeEquals |
protected MethodHandle |
keyNativeHashCode |
protected Type |
keyType |
| Constructor and Description |
|---|
AbstractMapBlock(Type keyType,
MethodHandle keyNativeHashCode,
MethodHandle keyBlockNativeEquals,
MethodHandle keyBlockHashCode) |
| Modifier and Type | Method and Description |
|---|---|
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.
|
protected abstract void |
ensureHashTableLoaded() |
String |
getEncodingName()
Get the encoding for this block.
|
long |
getEstimatedDataSizeForStats(int position)
Returns the estimated in memory data size for stats of position.
|
protected abstract AbstractMapBlock.HashTables |
getHashTables() |
protected abstract boolean[] |
getMapIsNull() |
<T> T |
getObject(int position,
Class<T> clazz)
Gets an object in the value at
position. |
protected abstract int |
getOffsetBase()
offset is entry-based, not position-based.
|
protected abstract int[] |
getOffsets()
offset is entry-based, not position-based.
|
long |
getPositionsSizeInBytes(boolean[] positions)
Returns the size of of all positions marked true in the positions array.
|
protected abstract Block |
getRawKeyBlock() |
protected abstract Block |
getRawValueBlock() |
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). |
Block |
getSingleValueBlock(int position)
Gets the value at the specified position as a single element block.
|
boolean |
isHashTablesPresent() |
boolean |
isNull(int position)
Is the specified position null?
|
boolean |
mayHaveNull()
Is it possible the block may have a null value? If false, the block can not contain
a null, but if true, the block may or may not have a null.
|
void |
writePositionTo(int position,
BlockBuilder blockBuilder)
Appends the value at
position to blockBuilder and close the entry. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbytesCompare, bytesEqual, compareTo, equals, getByte, getInt, getLoadedBlock, getLogicalSizeInBytes, getLong, getLong, getPositionCount, getPositions, getRetainedSizeInBytes, getShort, getSizeInBytes, getSlice, getSliceLength, hash, retainedBytesForEachPart, writeBytesToprotected final Type keyType
protected final MethodHandle keyNativeHashCode
protected final MethodHandle keyBlockNativeEquals
protected final MethodHandle keyBlockHashCode
public AbstractMapBlock(Type keyType, MethodHandle keyNativeHashCode, MethodHandle keyBlockNativeEquals, MethodHandle keyBlockHashCode)
protected abstract Block getRawKeyBlock()
protected abstract Block getRawValueBlock()
protected abstract AbstractMapBlock.HashTables getHashTables()
protected abstract int[] getOffsets()
protected abstract int getOffsetBase()
@Nullable protected abstract boolean[] getMapIsNull()
protected abstract void ensureHashTableLoaded()
public 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)
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 <T> T getObject(int position,
Class<T> clazz)
Blockposition.public void writePositionTo(int position,
BlockBuilder blockBuilder)
Blockposition to blockBuilder and close the entry.writePositionTo in interface Blockpublic 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 mayHaveNull()
BlockmayHaveNull in interface Blockpublic boolean isNull(int position)
Blockpublic boolean isHashTablesPresent()
Copyright © 2012–2019. All rights reserved.