Class SingleRowBlock

All Implemented Interfaces:
Block

public class SingleRowBlock extends AbstractSingleRowBlock
  • Method Details

    • getRawFieldBlock

      protected Block getRawFieldBlock(int fieldIndex)
      Specified by:
      getRawFieldBlock in class AbstractSingleRowBlock
    • getPositionCount

      public int getPositionCount()
      Description copied from interface: Block
      Returns the number of positions in this block.
    • fixedSizeInBytesPerPosition

      public OptionalInt fixedSizeInBytesPerPosition()
      Description copied from interface: Block
      Returns the number of bytes (in terms of Block.getSizeInBytes()) required per position that this block contains, assuming that the number of bytes required is a known static quantity and not dependent on any particular specific position. This allows for some complex block wrappings to potentially avoid having to call Block.getPositionsSizeInBytes(boolean[], int) which would require computing the specific positions selected
      Returns:
      The size in bytes, per position, if this block type does not require specific position information to compute its size
    • getSizeInBytes

      public long getSizeInBytes()
      Description copied from interface: Block
      Returns the size of this block as if it was compacted, ignoring any over-allocations and any unloaded nested blocks. For example, in dictionary blocks, this only counts each dictionary entry once, rather than each time a value is referenced.
    • getRetainedSizeInBytes

      public long getRetainedSizeInBytes()
      Description copied from interface: Block
      Returns the retained size of this block in memory, including over-allocations. This method is called from the inner most execution loop and must be fast.
    • retainedBytesForEachPart

      public void retainedBytesForEachPart(ObjLongConsumer<Object> consumer)
      Description copied from interface: Block
      consumer 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 block
    • getEncodingName

      public String getEncodingName()
      Description copied from interface: Block
      Get the encoding for this block.
    • getRowIndex

      public int getRowIndex()
      Specified by:
      getRowIndex in class AbstractSingleRowBlock
    • copyWithAppendedNull

      public Block copyWithAppendedNull()
      Description copied from interface: Block
      Returns a block that contains a copy of the contents of the current block, and an appended null at the end. The original block will not be modified. The purpose of this method is to leverage the contents of a block and the structure of the implementation to efficiently produce a copy of the block with a NULL element inserted - so that it can be used as a dictionary. This method is expected to be invoked on completely built Block instances i.e. not on in-progress block builders.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isLoaded

      public boolean isLoaded()
      Description copied from interface: Block
      Returns true if block data is fully loaded into memory.
    • getLoadedBlock

      public Block getLoadedBlock()
      Description copied from interface: Block
      Returns a fully loaded block that assures all data is in memory. Neither the returned block nor any nested block will be a LazyBlock. The same block will be returned if neither the current block nor any nested blocks are LazyBlock,

      This allows streaming data sources to skip sections that are not accessed in a query.