public class MapBlock extends AbstractMapBlock implements Block
AbstractMapBlock.HashTableslogicalSizeInBytes| 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)
Create a map block directly without per element validations.
|
protected void |
ensureHashTableLoaded(MethodHandle keyBlockHashCode) |
boolean |
equals(Object obj) |
static MapBlock |
fromKeyValueBlock(int positionCount,
Optional<boolean[]> mapIsNull,
int[] offsets,
Block keyBlock,
Block valueBlock)
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() |
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.
|
Block |
getSingleValueBlock(int position)
Gets the value at the specified position as a single element block.
|
long |
getSizeInBytes()
Returns the size of this block as if it was compacted, ignoring any over-allocations.
|
int |
hashCode() |
void |
retainedBytesForEachPart(ObjLongConsumer<Object> consumer)
consumer visits each of the internal data container and accepts the size for it. |
String |
toString() |
appendNull, copyPositions, copyRegion, fixedSizeInBytesPerPosition, getApproximateRegionLogicalSizeInBytes, getBlock, getBlockUnchecked, getEncodingName, getEstimatedDataSizeForStats, getLogicalSizeInBytes, getPositionsSizeInBytes, getRegion, getRegionLogicalSizeInBytes, getRegionSizeInBytes, getSingleValueBlockInternal, isHashTablesPresent, isNull, isNullUnchecked, mayHaveNull, writePositionTo, writePositionToclone, finalize, getClass, notify, notifyAll, wait, wait, waitappendNull, bytesCompare, bytesEqual, compareTo, copyPositions, copyRegion, equals, fixedSizeInBytesPerPosition, getApproximateRegionLogicalSizeInBytes, getBlock, getByte, getEncodingName, getEstimatedDataSizeForStats, getInt, getLogicalSizeInBytes, getLong, getLong, getPositions, getPositionsSizeInBytes, getRegion, getRegionLogicalSizeInBytes, getRegionSizeInBytes, getShort, getSlice, getSliceLength, hash, isNull, mayHaveNull, writeBytesTo, writeBytesTo, writePositionTo, writePositionTogetBlockUnchecked, getByteUnchecked, getIntUnchecked, getLongUnchecked, getLongUnchecked, getShortUnchecked, getSliceLengthUnchecked, getSliceUnchecked, isNullUncheckedpublic static MapBlock fromKeyValueBlock(int positionCount, Optional<boolean[]> mapIsNull, int[] offsets, Block keyBlock, Block valueBlock)
public static MapBlock createMapBlockInternal(int startOffset, int positionCount, Optional<boolean[]> mapIsNull, int[] offsets, Block keyBlock, Block valueBlock, AbstractMapBlock.HashTables hashTables)
Internal use by this package and com.facebook.presto.spi.Type only.
protected Block getRawKeyBlock()
getRawKeyBlock in class AbstractMapBlockprotected Block getRawValueBlock()
getRawValueBlock in class AbstractMapBlockprotected AbstractMapBlock.HashTables getHashTables()
getHashTables in class AbstractMapBlockprotected int[] getOffsets()
AbstractMapBlockgetOffsets in class AbstractMapBlockpublic int getOffsetBase()
AbstractMapBlockgetOffsetBase in interface UncheckedBlockgetOffsetBase in class AbstractMapBlock@Nullable protected boolean[] getMapIsNull()
getMapIsNull in class AbstractMapBlockpublic int getPositionCount()
BlockgetPositionCount in interface Blockpublic long getSizeInBytes()
BlockgetSizeInBytes 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 getRetainedSizeInBytes()
BlockgetRetainedSizeInBytes in interface Blockpublic void retainedBytesForEachPart(ObjLongConsumer<Object> 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 blockretainedBytesForEachPart in interface Blockpublic Block getLoadedBlock()
BlockThis allows streaming data sources to skip sections that are not accessed in a query.
getLoadedBlock in interface Blockprotected void ensureHashTableLoaded(MethodHandle keyBlockHashCode)
ensureHashTableLoaded in class AbstractMapBlockCopyright © 2012–2022. All rights reserved.