Package io.deephaven.importers.csv.sink
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[]>
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.
-
Field Summary
Fields inherited from class io.deephaven.importers.csv.sink.BaseAppendableColumnSink
baseFieldWriter, columnDataTransformer, columnMap, columnName, constantValue, customSetterCol, DEFAULT_PARTITION_COL, evictedPartitions, isColumnInSchema, isColumnInSource, isPartitionCol, schemaHasPartitionCol, sinkDataProcessor, updateObserver, ZERO_LENGTH_WRAPPER_ARRAY -
Method Summary
Modifier and TypeMethodDescriptionvoidThe wrapper method around theBaseAppendableColumn.add(Object[], int, int)The method should make sure the received values are persisted to the right partitions when the table schema supports partitions.protected voidaddToAppendableColumn(@NotNull io.deephaven.shadow.enterprise.com.illumon.iris.db.tables.appendable.local.LocalAppendableColumn<Instant> appendableColumn, Instant @NotNull [] values, int chunkStartIndex, int chunkSize, boolean isSingleValue) Writes to disk the contents of values array from chunkStartIndex to chunkSize in the appendable column of a particular partitionvoidnullFlagsToValues(Instant @NotNull [] values, boolean[] isNull, int size) The method allows the appropriate null values to be populated in the chunk.voidpublishToCustomSetter(Instant @NotNull [] values, boolean[] isNull, int size) The method will publish the values chunk toCustomSetterSinkDataProcessorif it is present and applicablevoidupdateCustomSetterData(int size, long destEnd) Allows custom setter columns to process updates to next chunk of rows.voidupdateRowChunk(int size, long destEnd) Allows columns not in csv source file to apply updates to next chunk of rows.voidwriteToLocal(Instant @NotNull [] values, int size, long destEnd) The method will save the values chunk to disk.Methods inherited from class io.deephaven.importers.csv.sink.BaseAppendableColumnSink
addAppendableColumn, append, awaitAdvance, evict, flush, getColumnDataTransformer, getColumnName, getConstantValue, getCsvSourceColumnName, getCustomSinkDataProcessor, getStringBuilderIncludingBasicSinkAttributes, isColumnInSchema, isColumnInSource, isConstantColumn, isCustomSetterColumn, isNotConsideredPartSourceFileMapping, isPartitionCol, onPartitionParserUpdate, processingComplete, processingFailed, publishRowUpdate, read, registerRowUpdateObserver, setColumnIsInSinkHolder, setRowUpdatePhaser, supportsTransformations, toString, updateLocalAppendableColumn, validateForProcessingErrorsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.deephaven.importers.csv.sink.AppendableColumnSink
addBooleans, addBytes, addChars, addDoubles, addFloats, addInts, addLongs, addShorts, isColumnOnlyInSchemaMethods inherited from interface io.deephaven.importers.csv.sink.AppendableSink
getUnderlying, updateNonSourceColRowChunk, write
-
Method Details
-
nullFlagsToValues
Description copied from interface:AppendableSinkThe 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 indexisNull- Indicates if the cell should be null valuesize- The size of the values array that should be persisted
-
writeToLocal
Description copied from interface:AppendableSinkThe method will save the values chunk to disk.- Parameters:
values- The current chunk ready to be persistedsize- The size of the values array that should be persisteddestEnd- The exclusive end index of the destination range.
-
publishToCustomSetter
Description copied from interface:AppendableSinkThe method will publish the values chunk toCustomSetterSinkDataProcessorif it is present and applicable- Parameters:
values- The current chunk ready to be persistedisNull- A boolean array, with the same range of valid elements. A "true" value at positionimeans thatsrc[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:AppendableSinkAllows 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 lengthdestEnd- The exclusive end index of the destination range.
-
updateCustomSetterData
public void updateCustomSetterData(int size, long destEnd) Description copied from interface:AppendableSinkAllows custom setter columns to process updates to next chunk of rows. These are the steps that are expected to be done in implementing classes- Pull data from
CustomSetterSinkDataProcessor.getAllColumnDataMap(String) - loop across individual row and invoke
BaseCsvFieldWriter.processValues(Map, int, long) - Pull and populate columns value array at the index using processed value from
BaseCsvFieldWriter.getSetterValue() - invoke appropriate type based add call, with singleValue flag set to false
- Parameters:
size- The current chunk lengthdestEnd- The exclusive end index of the destination range.
- Pull data from
-
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:BaseAppendableColumnSinkWrites to disk the contents of values array from chunkStartIndex to chunkSize in the appendable column of a particular partition- Specified by:
addToAppendableColumnin classBaseAppendableColumnSink<Instant,Instant[]> - Parameters:
appendableColumn- The LocalAppendableColumn of the current partitionvalues- The array whose contents need to be written to disk for this column and partitionchunkStartIndex- The start index in the values arraychunkSize- The length of data from the start index that need to be written to diskisSingleValue- 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:AppendableColumnSinkThe wrapper method around theBaseAppendableColumn.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 chunkstartIndex- The start index at which to persistlength- The length of the values that should be persisted as part of this chunkdestEnd- The total no of rows processed up to the end of this chunkisSingleValue- If all the values for the update are the same constant value
-