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.GetContext
Nested 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
ConstructorDescriptionChunkHolderPageInt
(long mask, long firstRow, @org.jetbrains.annotations.NotNull int[] storage) -
Method Summary
Modifier and TypeMethodDescriptionfinal void
acceptAppend
(@NotNull IntChunk<ATTR> slice, int expectedCurrentSize) Accept an appended slice of data to the currently-visible range for this page.final void
fillChunkAppend
(@NotNull ChunkSource.FillContext context, @NotNull WritableChunk<? super ATTR> destination, @NotNull RowSequence rowSequence) Appends the values referenced byorderKeys
ontodestination
.final long
final int
get
(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 ChunkType
Get the most suitableChunkType
for 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 long
mask()
This mask is applied toRowSequences
which 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 long
maxRow
(long rowKey) ThemaxRow
is the greatest possible row key which may be referenced in this ChunkSource.final int
size()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.deephaven.engine.table.impl.DefaultChunkSource
getChunkByFilling, makeGetContext
Methods inherited from interface io.deephaven.engine.table.impl.DefaultChunkSource.SupportsContiguousGet
getChunk
Methods inherited from interface io.deephaven.engine.table.FillContextMaker
makeFillContext
Methods inherited from interface io.deephaven.engine.table.GetContextMaker
makeGetContext
Methods inherited from interface io.deephaven.engine.page.Page
advanceToNextPage, advanceToNextPage, advanceToNextPageAndGetPositionDistance, firstRow, getRowOffset
Methods inherited from interface io.deephaven.engine.page.Page.WithDefaults
fillChunk, fillChunkAppend
Methods 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:ChunkSource
Get the most suitableChunkType
for use with this ChunkSource.- Specified by:
getChunkType
in interfaceChunkSource<ATTR extends Any>
- Returns:
- The ChunkType
-
firstRowOffset
public final long firstRowOffset()- Specified by:
firstRowOffset
in 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:PagingChunkSource
The
maxRow
is 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
PagingChunkSource
exits for each page reference. That is, there is only onePagingChunkSource
forRowSequences
with the same bits outside ofPagingChunkSource.mask()
.It is also possible to pack multiple, non-overlapping
PagingChunkSources
into the same page reference. In this case, one typically will want to overridemaxRow
. An example such implementation isChunkPage
.- Specified by:
maxRow
in 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:PagingChunkSource
This mask is applied toRowSequences
which 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 allowsPagingChunkSources
to be cached and reused even if they are properly relocated in key space.- Specified by:
mask
in 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:ChunkSource
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
. 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 intermediaryRowSequence
object.- Specified by:
getChunk
in interfaceChunkSource<ATTR extends Any>
- Specified by:
getChunk
in interfaceDefaultChunkSource<ATTR extends Any>
- Specified by:
getChunk
in 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.WithDefaults
Appends the values referenced byorderKeys
ontodestination
.orderKeys
are assumed to be entirely contained on thisPage
.- Specified by:
fillChunkAppend
in 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 ofslice
transfers 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
-