Class AppendableInstantColumnSink

java.lang.Object
io.deephaven.importers.csv.sink.BaseAppendableColumnSink<Instant,Instant[]>
io.deephaven.importers.csv.sink.AppendableInstantColumnSink
All Implemented Interfaces:
LogOutputAppendable, io.deephaven.csv.sinks.Sink<Instant[]>, io.deephaven.csv.sinks.Source<Instant[]>, PartitionUpdatesObserver, RowUpdateObservable, AppendableColumnSink<Instant,Instant[]>, AppendableSink<Instant,Instant[]>

public class AppendableInstantColumnSink extends BaseAppendableColumnSink<Instant,Instant[]>
This class is the Instant column sink implementation to be supplied from the sink factory call for DHC CSV Parser. This wraps the Disk writer (LocalAppendableColumn) so the parsed input is written to disk.
  • Method Details

    • nullFlagsToValues

      public void nullFlagsToValues(Instant @NotNull [] values, boolean[] isNull, int size)
      Description copied from interface: AppendableSink
      The method allows the appropriate null values to be populated in the chunk.
      Parameters:
      values - The chunk to populate null values if 'isNull' param is true for the index
      isNull - Indicates if the cell should be null value
      size - The size of the values array that should be persisted
    • writeToLocal

      public void writeToLocal(Instant @NotNull [] values, int size, long destEnd)
      Description copied from interface: AppendableSink
      The method will save the values chunk to disk.
      Parameters:
      values - The current chunk ready to be persisted
      size - The size of the values array that should be persisted
      destEnd - The exclusive end index of the destination range.
    • publishToCustomSetter

      public void publishToCustomSetter(Instant @NotNull [] values, boolean[] isNull, int size)
      Description copied from interface: AppendableSink
      The method will publish the values chunk to CustomSetterSinkDataProcessor if it is present and applicable
      Parameters:
      values - The current chunk ready to be persisted
      isNull - A boolean array, with the same range of valid elements. A "true" value at position i means that src[i] should be ignored and the element should be considered as the "null value".
      size - The size of the values array that should be persisted
    • updateRowChunk

      public void updateRowChunk(int size, long destEnd)
      Description copied from interface: AppendableSink
      Allows columns not in csv source file to apply updates to next chunk of rows. For example constant column values are not part of the csv source file, they will receive current row chunk details by registering with a row that is in csv source file.
      Parameters:
      size - The current chunk length
      destEnd - The exclusive end index of the destination range.
    • updateCustomSetterData

      public void updateCustomSetterData(int size, long destEnd)
      Description copied from interface: AppendableSink
      Allows custom setter columns to process updates to next chunk of rows. These are the steps that are expected to be done in implementing classes
      1. Pull data from CustomSetterSinkDataProcessor.getAllColumnDataMap(String)
      2. loop across individual row and invoke BaseCsvFieldWriter.processValues(Map, int, long)
      3. Pull and populate columns value array at the index using processed value from BaseCsvFieldWriter.getSetterValue()
      4. invoke appropriate type based add call, with singleValue flag set to false
      Parameters:
      size - The current chunk length
      destEnd - The exclusive end index of the destination range.
    • addToAppendableColumn

      protected void addToAppendableColumn(@NotNull @NotNull io.deephaven.shadow.enterprise.com.illumon.iris.db.tables.appendable.local.LocalAppendableColumn<Instant> appendableColumn, Instant @NotNull [] values, int chunkStartIndex, int chunkSize, boolean isSingleValue)
      Description copied from class: BaseAppendableColumnSink
      Writes to disk the contents of values array from chunkStartIndex to chunkSize in the appendable column of a particular partition
      Specified by:
      addToAppendableColumn in class BaseAppendableColumnSink<Instant,Instant[]>
      Parameters:
      appendableColumn - The LocalAppendableColumn of the current partition
      values - The array whose contents need to be written to disk for this column and partition
      chunkStartIndex - The start index in the values array
      chunkSize - The length of data from the start index that need to be written to disk
      isSingleValue - This indicates that entire chunk needs to be updated using a single value which is the constant value
    • add

      public void add(@NotNull @NotNull Instant[] values, int startIndex, int length, long destEnd, boolean isSingleValue)
      Description copied from interface: AppendableColumnSink
      The wrapper method around the BaseAppendableColumn.add(Object[], int, int) The method should make sure the received values are persisted to the right partitions when the table schema supports partitions. To allow for this, the persisting of values may be blocked until the partition column is processed for the same chunk. In addition, if other columns have registered an interest in receiving current chunk details then that information should be published as the first operation.
      Parameters:
      values - The values to be persisted in the chunk
      startIndex - The start index at which to persist
      length - The length of the values that should be persisted as part of this chunk
      destEnd - The total no of rows processed up to the end of this chunk
      isSingleValue - If all the values for the update are the same constant value