Class DownsampleChunkContext
java.lang.Object
io.deephaven.clientsupport.plotdownsampling.DownsampleChunkContext
- All Implemented Interfaces:
AutoCloseable
Provides chunks for given sources so that downsampling can walk several columns at once, allowing GetContext
instances to be lazily created as needed, and all tracked together so they can all be closed with a single call.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addYColumnsOfInterest
(int[] yCols) Indicates that any of these Y columns will actually be used, and should be pre-populated if not yet presentvoid
close()
getXValues
(RowSequence keys, boolean usePrev) Requests a chunk from the X column source, using the internally tracked GetContextgetYValues
(int[] yCols, RowSequence keys, boolean usePrev) Requests an array of chunks from the given Y column sources, using the internally tracked GetContexts.getYValues
(int yColIndex, RowSequence keys, boolean usePrev) Requests a chunk of data from the specified Y column source, using the internally tracked GetContexts.
-
Method Details
-
addYColumnsOfInterest
public void addYColumnsOfInterest(int[] yCols) Indicates that any of these Y columns will actually be used, and should be pre-populated if not yet present- Parameters:
yCols
- an array of indexes into the original yColumnSources constructor parameter
-
getXValues
Requests a chunk from the X column source, using the internally tracked GetContext- Parameters:
keys
- the keys in the column that values are needed forusePrev
- whether or not previous values should be fetched- Returns:
- a LongChunk containing the values specified
-
getYValues
Requests an array of chunks from the given Y column sources, using the internally tracked GetContexts. This assumes that addYColumnsOfInterest has been called on at least the columns indicated in yCols. Do not retain or reuse the array, this DownsampleChunkContext will reuse it.- Parameters:
yCols
- the indexes of the columns from the original yColumnSources to get data fromkeys
- the keys in the columns that values are needed forusePrev
- whether or not previous values should be fetched- Returns:
- an array containing the data in the specified rows. The array will be the same size as the original yColumnSources, with only the indexes in yCols populated.
-
getYValues
Requests a chunk of data from the specified Y column source, using the internally tracked GetContexts.- Parameters:
yColIndex
- the index of the column from the original yColumnSources to get data fromkeys
- the keys in the column that values are needed forusePrev
- whether or not previous values should be fetched- Returns:
- a chunk containing the values specified
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-