Package io.deephaven.importers
Class PreviewImportTableWriterFactoryBase<RESOURCE_TYPE>
java.lang.Object
io.deephaven.importers.PreviewImportTableWriterFactoryBase<RESOURCE_TYPE>
- Type Parameters:
RESOURCE_TYPE- the type of value stored per column-partition entry (e.g. a writer or a file location)
- All Implemented Interfaces:
ImportTableWriterFactory
- Direct Known Subclasses:
PreviewImportTableWriterFactoryInMemory,PreviewImportTableWriterFactoryLocalAppendable
public abstract class PreviewImportTableWriterFactoryBase<RESOURCE_TYPE>
extends Object
implements ImportTableWriterFactory
Base implementation of
ImportTableWriterFactory for preview functionality.-
Method Summary
Modifier and TypeMethodDescription@Nullable StringgetComputedColumnPartition(@Nullable String inputColumnPartition) The method is invoked to determine the partition value to which the current row of data needs to be associated.@NotNull io.deephaven.shadow.enterprise.com.illumon.iris.db.tables.appendable.local.LocalAppendableTablegetLocalAppendableTable(String partitionValue, boolean forceAppend) Returns theLocalAppendableTablefor given column partition value.Generates and returns the generatedTableincluding the partitioning column.protected abstract TablegetRawTable(@NotNull String partitionValue, RESOURCE_TYPE resource) Returns the raw (un-partitioned)Tablefor a single partition value, given the stored per-partition value that was accumulated during the import.Get the column partition value for a single-partition import.io.deephaven.shadow.enterprise.com.illumon.iris.db.tables.TableDefinitionGet the table definition associated with the table that will be written.io.deephaven.shadow.enterprise.com.illumon.iris.binarystore.TableWritergetTableWriter(String inputColumnPartitionValue, boolean forceAppend) Get aTableWriterfor the table and specified partition, optionally appending.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.deephaven.importers.ImportTableWriterFactory
getTableDestination
-
Method Details
-
getTableDefinition
public io.deephaven.shadow.enterprise.com.illumon.iris.db.tables.TableDefinition getTableDefinition()Description copied from interface:ImportTableWriterFactoryGet the table definition associated with the table that will be written.- Specified by:
getTableDefinitionin interfaceImportTableWriterFactory- Returns:
- the table definition.
-
getComputedColumnPartition
@Nullable public @Nullable String getComputedColumnPartition(@Nullable @Nullable String inputColumnPartition) Description copied from interface:ImportTableWriterFactoryThe method is invoked to determine the partition value to which the current row of data needs to be associated. So in the case where user wants a single partition value for the import this should return that value. In other cases this may simply return the passed in value, however, it is possible to returnnullindicating that there is no valid column partition.- Specified by:
getComputedColumnPartitionin interfaceImportTableWriterFactory- Parameters:
inputColumnPartition- the requested input partition- Returns:
- the computed column partition
-
getLocalAppendableTable
@NotNull public @NotNull io.deephaven.shadow.enterprise.com.illumon.iris.db.tables.appendable.local.LocalAppendableTable getLocalAppendableTable(String partitionValue, boolean forceAppend) Description copied from interface:ImportTableWriterFactoryReturns theLocalAppendableTablefor given column partition value.- Specified by:
getLocalAppendableTablein interfaceImportTableWriterFactory- Parameters:
partitionValue- the column partition to use. Some implementations allow nulls.forceAppend- When true, the LocalAppendableTable will be initialized to append to any existing data. When false, append/replace/fail behavior is implementation defined.- Returns:
- Returned appropriate
LocalAppendableTablefor column partition value.
-
getTableWriter
public io.deephaven.shadow.enterprise.com.illumon.iris.binarystore.TableWriter getTableWriter(String inputColumnPartitionValue, boolean forceAppend) Description copied from interface:ImportTableWriterFactoryGet aTableWriterfor the table and specified partition, optionally appending.- Specified by:
getTableWriterin interfaceImportTableWriterFactory- Parameters:
inputColumnPartitionValue- the column partition to use. Some implementations allow nulls.forceAppend- if the table should be appended or replaced.- Returns:
- an appropriate
TableWriter
-
getSinglePartitionColumnPartitionValue
Description copied from interface:ImportTableWriterFactoryGet the column partition value for a single-partition import.- Specified by:
getSinglePartitionColumnPartitionValuein interfaceImportTableWriterFactory- Returns:
- an
Optionalwith the column partition value, or an empty optional if it's not a single-partition import
-
getRawTable
protected abstract Table getRawTable(@NotNull @NotNull String partitionValue, @NotNull RESOURCE_TYPE resource) Returns the raw (un-partitioned)Tablefor a single partition value, given the stored per-partition value that was accumulated during the import.- Parameters:
partitionValue- the computed column-partition valueresource- the per-partition resource for that partition- Returns:
- the raw table for the partition, without the partitioning column populated
-
getPreviewTable
Generates and returns the generatedTableincluding the partitioning column. The import must have already been run.- Returns:
- The generated preview table
-