Class ParquetColumnRegionBase<ATTR extends Attributes.Values>

java.lang.Object
com.illumon.iris.db.v2.sources.regioned.ParquetColumnRegionBase<ATTR>
All Implemented Interfaces:
ChunkSource<ATTR>, FillContextMaker, GetContextMaker, Page<ATTR>, PagingChunkSource<ATTR>, ColumnRegion<ATTR>, Releasable
Direct Known Subclasses:
ParquetColumnRegionByte, ParquetColumnRegionChar, ParquetColumnRegionDouble, ParquetColumnRegionFloat, ParquetColumnRegionInt, ParquetColumnRegionLong, ParquetColumnRegionObject, ParquetColumnRegionShort

public abstract class ParquetColumnRegionBase<ATTR extends Attributes.Values> extends Object
  • Method Details

    • firstRowOffset

      public long firstRowOffset()
      Specified by:
      firstRowOffset in interface ColumnRegion<ATTR extends Attributes.Values>
      Specified by:
      firstRowOffset in interface Page<ATTR extends Attributes.Values>
      Returns:
      the first row of this page, after applying the PagingChunkSource.mask(), which refers to the first row of this page.
    • maxRow

      public long maxRow(long row)
      Description copied from interface: PagingChunkSource

      The maxRow is the greatest possible row which may reference this ChunkSource. This method is used by PagingChunkSource.fillChunkAppend(FillContext, WritableChunk, OrderedKeys.Iterator) to determine which of its OrderedKeys are referencing this PagingChunkSource.

      The default implementation assumes that only one PagingChunkSource exits for each page reference. That is, there is only one PagingChunkSource for OrderedKeys with the same bits outside of PagingChunkSource.mask().

      It is also possible to pack multiple, non-overlapping PagingChunkSources into the same page reference. In this case, one typically will want to override maxRow. An example such implementation is ChunkPage.

      Specified by:
      maxRow in interface PagingChunkSource<ATTR extends Attributes.Values>
      Parameters:
      row - Any row contained on this page.
      Returns:
      the maximum last row of this page, located in the same way as row.
    • length

      public final long length()
      Specified by:
      length in interface Page<ATTR extends Attributes.Values>
      Returns:
      the length of this page.
    • getNativeType

      @NotNull public final @NotNull Class<?> getNativeType()
      Specified by:
      getNativeType in interface ChunkSource<ATTR extends Attributes.Values>
    • getChunk

      public Chunk<? extends ATTR> getChunk(@NotNull @NotNull ChunkSource.GetContext context, @NotNull @NotNull OrderedKeys orderedKeys)
      Description copied from interface: ChunkSource
      Returns a chunk of data corresponding to the keys from the given OrderedKeys.
      Specified by:
      getChunk in interface ChunkSource<ATTR extends Attributes.Values>
      Parameters:
      context - A context containing all mutable/state related data used in retrieving the Chunk. In particular, the Context may be used to provide a Chunk data pool
      orderedKeys - An OrderedKeys representing the keys to be fetched
      Returns:
      A chunk of data corresponding to the keys from the given OrderedKeys
    • getChunk

      public Chunk<? extends ATTR> getChunk(@NotNull @NotNull ChunkSource.GetContext context, long firstKey, long lastKey)
      Description copied from interface: ChunkSource
      Same as ChunkSource.getChunk(GetContext, OrderedKeys), except that you pass in the begin and last keys representing the begin and last (inclusive) keys of a single range rather than an OrderedKeys. Typically you want to call this only if you don't have an OrderedKeys, such as during an OrderedKeys.forAllLongRanges(LongRangeConsumer) call. In this case, it allows you to avoid creating an intermediary OrderedKeys object.
      Specified by:
      getChunk in interface ChunkSource<ATTR extends Attributes.Values>
      Parameters:
      context - A context containing all mutable/state related data used in retrieving the Chunk. In particular, the Context may be used to provide a Chunk data pool
      firstKey - The beginning key (inclusive) of the range to fetch in the chunk
      lastKey - The last key (inclusive) of the range to fetch in the chunk
      Returns:
      A chunk of data corresponding to the keys from the given range.
    • fillChunk

      public void fillChunk(@NotNull @NotNull ChunkSource.FillContext context, @NotNull @NotNull WritableChunk<? super ATTR> destination, @NotNull @NotNull OrderedKeys orderedKeys)
      Description copied from interface: ChunkSource
      Populates the given destination chunk with data corresponding to the keys from the given OrderedKeys.
      Specified by:
      fillChunk in interface ChunkSource<ATTR extends Attributes.Values>
      Parameters:
      context - A context containing all mutable/state related data used in retrieving the Chunk.
      destination - The chunk to be populated according to orderedKeys. No assumptions shall be made about the size of the chunk shall be made. The chunk will be populated from position [0,orderedKeys.size()).
      orderedKeys - An OrderedKeys representing the keys to be fetched
    • fillChunkAppend

      public void fillChunkAppend(@NotNull @NotNull ChunkSource.FillContext context, @NotNull @NotNull WritableChunk<? super ATTR> destination, @NotNull OrderedKeys.Iterator orderedKeysIterator)
      Description copied from interface: PagingChunkSource

      Similar to ChunkSource.fillChunk(FillContext, WritableChunk, OrderedKeys), except that the values from the ChunkSource are appended to destination, rather than placed at the beginning.

      The values to fill into destination are specified by orderedKeysIterator, whose OrderedKeys.firstKey() must exist, and must be represented by this PagingChunkSource (modulo {#link @mask}), otherwise results are undefined.

      No more than the elements in orderedKeysIterator, which are on the same page as OrderedKeys.firstKey(), have their values appended to destination, and consumed from orderedKeysIterator. Keys are on the same page when the bits outside of PagingChunkSource.mask() are identical.

      Specified by:
      fillChunkAppend in interface PagingChunkSource<ATTR extends Attributes.Values>
      Parameters:
      context - A context containing all mutable/state related data used in retrieving the Chunk. In particular, the Context may be used to provide a Chunk data pool
      destination - The chunk to append the results to.
      orderedKeysIterator - The iterator to the ordered keys, which contain at least the keys to extract from this ChunkSource. The keys to extract will be at the beginning of iteration order.
    • getChunkPageContaining

      public final ChunkPage<ATTR> getChunkPageContaining(long elementIndex)
    • releaseCachedResources

      @OverridingMethodsMustInvokeSuper public void releaseCachedResources()
      Description copied from interface: Releasable
      Release any resources held for caching purposes. Implementations need not guarantee that they are safe for normal use concurrently with invocations of this method.
      Specified by:
      releaseCachedResources in interface Releasable
    • makeFillContext

      public ChunkSource.FillContext makeFillContext(int chunkCapacity, SharedContext sharedContext)
      Description copied from interface: FillContextMaker
      Allocate a new ChunkSource.FillContext for filling chunks from this FillContextMaker, typically a ChunkSource.
      Specified by:
      makeFillContext in interface FillContextMaker
      Parameters:
      chunkCapacity - The maximum size of any WritableChunk that will be filled with this context
      sharedContext - Shared store of intermediate results.
      Returns:
      A context for use with fill operations
    • makeGetContext

      public ChunkSource.GetContext makeGetContext(int chunkCapacity, SharedContext sharedContext)
      Description copied from interface: GetContextMaker
      Allocate a new ChunkSource.GetContext for retrieving chunks from this GetContextMaker, typically a ChunkSource.
      Specified by:
      makeGetContext in interface GetContextMaker
      Parameters:
      chunkCapacity - The maximum size required for any WritableChunk allocated as part of the result.
      sharedContext - Shared store of intermediate results.
      Returns:
      A context for use with get operations
    • getLocation

      public ParquetFormatColumnLocation<ATTR> getLocation()
      Specified by:
      getLocation in interface ColumnRegion<ATTR extends Attributes.Values>
    • chunkMatch

      public Index chunkMatch(long regionFirstKey, @NotNull @NotNull OrderedKeys keysToFilter, boolean caseInsensitive, boolean invertMatch, @NotNull @NotNull Object[] keys)
      Specified by:
      chunkMatch in interface ColumnRegion<ATTR extends Attributes.Values>