public class MapBlock extends AbstractMapBlock
AbstractMapBlock.HashTableskeyBlockHashCode, keyBlockNativeEquals, keyNativeHashCode, keyType| Modifier and Type | Method and Description |
|---|---|
static MapBlock |
createMapBlockInternal(int startOffset,
int positionCount,
Optional<boolean[]> mapIsNull,
int[] offsets,
Block keyBlock,
Block valueBlock,
AbstractMapBlock.HashTables hashTables,
Type keyType,
MethodHandle keyBlockNativeEquals,
MethodHandle keyNativeHashCode,
MethodHandle keyBlockHashCode)
Create a map block directly without per element validations.
|
protected void |
ensureHashTableLoaded() |
static MapBlock |
fromKeyValueBlock(Optional<boolean[]> mapIsNull,
int[] offsets,
Block keyBlock,
Block valueBlock,
MapType mapType,
MethodHandle keyBlockNativeEquals,
MethodHandle keyNativeHashCode,
MethodHandle keyBlockHashCode)
Create a map block directly from columnar nulls, keys, values, and offsets into the keys and values.
|
protected AbstractMapBlock.HashTables |
getHashTables() |
Block |
getLoadedBlock()
Returns a block that assures all data is in memory.
|
protected boolean[] |
getMapIsNull() |
protected int |
getOffsetBase()
offset is entry-based, not position-based.
|
protected int[] |
getOffsets()
offset is entry-based, not position-based.
|
int |
getPositionCount()
Returns the number of positions in this block.
|
protected Block |
getRawKeyBlock() |
protected Block |
getRawValueBlock() |
long |
getRetainedSizeInBytes()
Returns the retained size of this block in memory, including over-allocations.
|
long |
getSizeInBytes()
Returns the size of this block as if it was compacted, ignoring any over-allocations.
|
void |
retainedBytesForEachPart(BiConsumer<Object,Long> consumer)
consumer visits each of the internal data container and accepts the size for it. |
String |
toString() |
copyPositions, copyRegion, getEncodingName, getEstimatedDataSizeForStats, getObject, getPositionsSizeInBytes, getRegion, getRegionSizeInBytes, getSingleValueBlock, isHashTablesPresent, isNull, mayHaveNull, writePositionToclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitbytesCompare, bytesEqual, compareTo, equals, getByte, getInt, getLogicalSizeInBytes, getLong, getLong, getPositions, getShort, getSlice, getSliceLength, hash, writeBytesTopublic static MapBlock fromKeyValueBlock(Optional<boolean[]> mapIsNull, int[] offsets, Block keyBlock, Block valueBlock, MapType mapType, MethodHandle keyBlockNativeEquals, MethodHandle keyNativeHashCode, MethodHandle keyBlockHashCode)
mapType - key type KkeyBlockNativeEquals - equality between key stack type and a block+position; signature is (K, Block, int)booleankeyNativeHashCode - hash of a key stack type; signature is (K)longpublic static MapBlock createMapBlockInternal(int startOffset, int positionCount, Optional<boolean[]> mapIsNull, int[] offsets, Block keyBlock, Block valueBlock, AbstractMapBlock.HashTables hashTables, Type keyType, MethodHandle keyBlockNativeEquals, MethodHandle keyNativeHashCode, MethodHandle keyBlockHashCode)
Internal use by this package and com.facebook.presto.spi.Type only.
keyType - key type KkeyBlockNativeEquals - equality between key stack type and a block+position; signature is (K, Block, int)booleankeyNativeHashCode - hash of a key stack type; signature is (K)longprotected Block getRawKeyBlock()
getRawKeyBlock in class AbstractMapBlockprotected Block getRawValueBlock()
getRawValueBlock in class AbstractMapBlockprotected AbstractMapBlock.HashTables getHashTables()
getHashTables in class AbstractMapBlockprotected int[] getOffsets()
AbstractMapBlockgetOffsets in class AbstractMapBlockprotected int getOffsetBase()
AbstractMapBlockgetOffsetBase in class AbstractMapBlock@Nullable protected boolean[] getMapIsNull()
getMapIsNull in class AbstractMapBlockpublic int getPositionCount()
Blockpublic long getSizeInBytes()
Blockpublic long getRetainedSizeInBytes()
Blockpublic void retainedBytesForEachPart(BiConsumer<Object,Long> consumer)
Blockconsumer visits each of the internal data container and accepts the size for it.
This method can be helpful in cases such as memory counting for internal data structure.
Also, the method should be non-recursive, only visit the elements at the top level,
and specifically should not call retainedBytesForEachPart on nested blocks
consumer should be called at least once with the current block and
must include the instance size of the current blockpublic Block getLoadedBlock()
BlockThis allows streaming data sources to skip sections that are not accessed in a query.
protected void ensureHashTableLoaded()
ensureHashTableLoaded in class AbstractMapBlockCopyright © 2012–2019. All rights reserved.