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 Details

    • getTableDefinition

      public io.deephaven.shadow.enterprise.com.illumon.iris.db.tables.TableDefinition getTableDefinition()
      Description copied from interface: ImportTableWriterFactory
      Get the table definition associated with the table that will be written.
      Specified by:
      getTableDefinition in interface ImportTableWriterFactory
      Returns:
      the table definition.
    • getComputedColumnPartition

      @Nullable public @Nullable String getComputedColumnPartition(@Nullable @Nullable String inputColumnPartition)
      Description copied from interface: ImportTableWriterFactory
      The 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 return null indicating that there is no valid column partition.
      Specified by:
      getComputedColumnPartition in interface ImportTableWriterFactory
      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: ImportTableWriterFactory
      Returns the LocalAppendableTable for given column partition value.
      Specified by:
      getLocalAppendableTable in interface ImportTableWriterFactory
      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 LocalAppendableTable for column partition value.
    • getTableWriter

      public io.deephaven.shadow.enterprise.com.illumon.iris.binarystore.TableWriter getTableWriter(String inputColumnPartitionValue, boolean forceAppend)
      Description copied from interface: ImportTableWriterFactory
      Get a TableWriter for the table and specified partition, optionally appending.
      Specified by:
      getTableWriter in interface ImportTableWriterFactory
      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

      @Nullable public @Nullable Optional<String> getSinglePartitionColumnPartitionValue()
      Description copied from interface: ImportTableWriterFactory
      Get the column partition value for a single-partition import.
      Specified by:
      getSinglePartitionColumnPartitionValue in interface ImportTableWriterFactory
      Returns:
      an Optional with 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) Table for a single partition value, given the stored per-partition value that was accumulated during the import.
      Parameters:
      partitionValue - the computed column-partition value
      resource - the per-partition resource for that partition
      Returns:
      the raw table for the partition, without the partitioning column populated
    • getPreviewTable

      public Table getPreviewTable()
      Generates and returns the generated Table including the partitioning column. The import must have already been run.
      Returns:
      The generated preview table