Package io.deephaven.generic.page
Class ChunkHolderPageInt<ATTR extends Any>
java.lang.Object
io.deephaven.generic.page.ChunkHolderPageInt<ATTR>
- All Implemented Interfaces:
Page<ATTR>,Page.WithDefaults<ATTR>,PagingChunkSource<ATTR>,ChunkSource<ATTR>,FillContextMaker,GetContextMaker,DefaultChunkSource<ATTR>,DefaultChunkSource.SupportsContiguousGet<ATTR>
public class ChunkHolderPageInt<ATTR extends Any>
extends Object
implements Page.WithDefaults<ATTR>, DefaultChunkSource.SupportsContiguousGet<ATTR>
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.deephaven.engine.table.ChunkSource
ChunkSource.FillContext, ChunkSource.GetContextNested classes/interfaces inherited from interface io.deephaven.engine.table.impl.DefaultChunkSource
DefaultChunkSource.SupportsContiguousGet<ATTR extends Any>, DefaultChunkSource.WithPrev<ATTR extends Any>Nested classes/interfaces inherited from interface io.deephaven.engine.page.Page
Page.WithDefaults<ATTR extends Any>, Page.WithDefaultsForRepeatingValues<ATTR extends Any> -
Field Summary
Fields inherited from interface io.deephaven.engine.table.ChunkSource
DEFAULT_FILL_INSTANCE, ZERO_LENGTH_CHUNK_SOURCE_ARRAY -
Constructor Summary
ConstructorsConstructorDescriptionChunkHolderPageInt(long mask, long firstRow, @org.jetbrains.annotations.NotNull int[] storage) -
Method Summary
Modifier and TypeMethodDescriptionfinal voidacceptAppend(@NotNull IntChunk<ATTR> slice, int expectedCurrentSize) Accept an appended slice of data to the currently-visible range for this page.final voidfillChunkAppend(@NotNull ChunkSource.FillContext context, @NotNull WritableChunk<? super ATTR> destination, @NotNull RowSequence rowSequence) Appends the values referenced byorderKeysontodestination.final longfinal intget(long rowKey) getChunk(@NotNull ChunkSource.GetContext context, long firstKey, long lastKey) Same asChunkSource.getChunk(GetContext, RowSequence), except that you pass in the begin and last keys representing the begin and last (inclusive) keys of a single range rather than anRowSequence.final ChunkTypeGet the most suitableChunkTypefor use with this ChunkSource.final WritableIntChunk<ATTR>getSliceForAppend(int expectedCurrentSize) Get a writable chunk slice of this page's data storage, starting at the end of the currently-visible range, to be used for appending new data.final longmask()This mask is applied toRowSequenceswhich are passed intoDefaultChunkSource.getChunk(io.deephaven.engine.table.ChunkSource.GetContext, io.deephaven.engine.rowset.RowSequence),ChunkSource.fillChunk(io.deephaven.engine.table.ChunkSource.FillContext, io.deephaven.chunk.WritableChunk<? super ATTR>, io.deephaven.engine.rowset.RowSequence), andPagingChunkSource.fillChunkAppend(FillContext, WritableChunk, RowSequence.Iterator).final longmaxRow(long rowKey) ThemaxRowis the greatest possible row key which may be referenced in this ChunkSource.final intsize()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.deephaven.engine.table.impl.DefaultChunkSource
getChunkByFilling, makeGetContextMethods inherited from interface io.deephaven.engine.table.impl.DefaultChunkSource.SupportsContiguousGet
getChunkMethods inherited from interface io.deephaven.engine.table.FillContextMaker
makeFillContextMethods inherited from interface io.deephaven.engine.table.GetContextMaker
makeGetContextMethods inherited from interface io.deephaven.engine.page.Page
advanceToNextPage, advanceToNextPage, advanceToNextPageAndGetPositionDistance, firstRow, getRowOffsetMethods inherited from interface io.deephaven.engine.page.Page.WithDefaults
fillChunk, fillChunkAppendMethods inherited from interface io.deephaven.engine.page.PagingChunkSource
makeFillContext
-
Constructor Details
-
ChunkHolderPageInt
public ChunkHolderPageInt(long mask, long firstRow, @NotNull @org.jetbrains.annotations.NotNull int[] storage)
-
-
Method Details
-
getChunkType
Description copied from interface:ChunkSourceGet the most suitableChunkTypefor use with this ChunkSource.- Specified by:
getChunkTypein interfaceChunkSource<ATTR extends Any>- Returns:
- The ChunkType
-
firstRowOffset
public final long firstRowOffset()- Specified by:
firstRowOffsetin interfacePage<ATTR extends Any>- Returns:
- the first row of this page, after applying the
PagingChunkSource.mask(), which refers to the first row of this page.
-
maxRow
public final long maxRow(long rowKey) Description copied from interface:PagingChunkSourceThe
maxRowis the greatest possible row key which may be referenced in this ChunkSource. This method is used byPagingChunkSource.fillChunkAppend(FillContext, WritableChunk, RowSequence.Iterator)to determine which of its row keys are supplied by thisPagingChunkSource.The default implementation assumes that only one
PagingChunkSourceexits for each page reference. That is, there is only onePagingChunkSourceforRowSequenceswith the same bits outside ofPagingChunkSource.mask().It is also possible to pack multiple, non-overlapping
PagingChunkSourcesinto the same page reference. In this case, one typically will want to overridemaxRow. An example such implementation isChunkPage.- Specified by:
maxRowin interfacePagingChunkSource<ATTR extends Any>- Parameters:
rowKey- Any row key contained by thisPagingChunkSource- Returns:
- The maximum last row key of the page, located in the same way as
rowKey
-
mask
public final long mask()Description copied from interface:PagingChunkSourceThis mask is applied toRowSequenceswhich are passed intoDefaultChunkSource.getChunk(io.deephaven.engine.table.ChunkSource.GetContext, io.deephaven.engine.rowset.RowSequence),ChunkSource.fillChunk(io.deephaven.engine.table.ChunkSource.FillContext, io.deephaven.chunk.WritableChunk<? super ATTR>, io.deephaven.engine.rowset.RowSequence), andPagingChunkSource.fillChunkAppend(FillContext, WritableChunk, RowSequence.Iterator). This allowsPagingChunkSourcesto be cached and reused even if they are properly relocated in key space.- Specified by:
maskin interfacePagingChunkSource<ATTR extends Any>- Returns:
- The mask for this
PagingChunkSource, which must be a bitmask representing some number of lower order bits of a long.
-
size
public final int size()- Returns:
- The current size of this page
-
get
public final int get(long rowKey) - Parameters:
rowKey- The row key to retrieve the value for- Returns:
- The value at
rowKey
-
getChunk
public final Chunk<? extends ATTR> getChunk(@NotNull @NotNull ChunkSource.GetContext context, long firstKey, long lastKey) Description copied from interface:ChunkSourceSame asChunkSource.getChunk(GetContext, RowSequence), except that you pass in the begin and last keys representing the begin and last (inclusive) keys of a single range rather than anRowSequence. Typically you want to call this only if you don't have anRowSequence, such as during anRowSequence.forAllRowKeyRanges(LongRangeConsumer)call. In this case, it allows you to avoid creating an intermediaryRowSequenceobject.- Specified by:
getChunkin interfaceChunkSource<ATTR extends Any>- Specified by:
getChunkin interfaceDefaultChunkSource<ATTR extends Any>- Specified by:
getChunkin interfaceDefaultChunkSource.SupportsContiguousGet<ATTR extends Any>- 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 poolfirstKey- The beginning key (inclusive) of the range to fetch in the chunklastKey- The last key (inclusive) of the range to fetch in the chunk
-
fillChunkAppend
public final void fillChunkAppend(@NotNull @NotNull ChunkSource.FillContext context, @NotNull @NotNull WritableChunk<? super ATTR> destination, @NotNull @NotNull RowSequence rowSequence) Description copied from interface:Page.WithDefaultsAppends the values referenced byorderKeysontodestination.orderKeysare assumed to be entirely contained on thisPage.- Specified by:
fillChunkAppendin interfacePage.WithDefaults<ATTR extends Any>
-
getSliceForAppend
Get a writable chunk slice of this page's data storage, starting at the end of the currently-visible range, to be used for appending new data.- Parameters:
expectedCurrentSize- The expected current size of the visible data in this page, used to assert correctness- Returns:
- A chunk to fill with new data
-
acceptAppend
Accept an appended slice of data to the currently-visible range for this page. Ownership ofslicetransfers to the callee.- Parameters:
slice- The slice chunk of data, which must have been returned bygetSliceForAppend(int); ownership transfers to the calleeexpectedCurrentSize- The expected current size of the visible data in this page, used to assert correctness
-