Class DownsampleChunkContext

java.lang.Object
io.deephaven.clientsupport.plotdownsampling.DownsampleChunkContext
All Implemented Interfaces:
AutoCloseable

public class DownsampleChunkContext extends Object implements 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 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

      public LongChunk<Values> getXValues(RowSequence keys, boolean usePrev)
      Requests a chunk from the X column source, using the internally tracked GetContext
      Parameters:
      keys - the keys in the column that values are needed for
      usePrev - whether or not previous values should be fetched
      Returns:
      a LongChunk containing the values specified
    • getYValues

      public Chunk<? extends Values>[] getYValues(int[] yCols, RowSequence keys, boolean usePrev)
      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 from
      keys - the keys in the columns that values are needed for
      usePrev - 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

      public Chunk<? extends Values> getYValues(int yColIndex, RowSequence keys, boolean usePrev)
      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 from
      keys - the keys in the column that values are needed for
      usePrev - whether or not previous values should be fetched
      Returns:
      a chunk containing the values specified
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable