Package com.illumon.iris.importers
Interface ImportTableWriterFactory
- All Known Implementing Classes:
AppendingImportTableWriterFactory,DirectoryImportTableFactory,ImportTableWriterFactoryBase,MultiPartitionImportTableWriterFactory,PreviewTableImportTableWriterFactory,SinglePartitionImportTableFactory
public interface ImportTableWriterFactory
A Factory to generate
TableWriters for use with various importers.-
Method Summary
Modifier and TypeMethodDescriptiondefault StringgetComputedColumnPartition(String inputColumnPartition) The method is invoked to determine the partition value to which the current row of data needs to be associated.default LocalAppendableTablegetLocalAppendableTable(String columnPartitionValue, boolean forceAppend) Returns theLocalAppendableTablefor given column partition value.Get the table definition associated with the table that will be written.getTableDestination(String columnPartitionValue) Get aFilerepresenting the path where the table will be written.default TableWritergetTableWriter(String columnPartitionValue) Get aTableWriterthat will replace the specified column partition.getTableWriter(String columnPartitionValue, boolean append) Get aTableWriterfor the table and specified partition, optionally appending.
-
Method Details
-
getTableDefinition
TableDefinition getTableDefinition()Get the table definition associated with the table that will be written.- Returns:
- the table definition.
-
getTableWriter
Get aTableWriterfor the table and specified partition, optionally appending.- Parameters:
columnPartitionValue- the column partition to use. Some implementations allow nulls.append- if the table should be appended or replaced.- Returns:
- an appropriate
TableWriter
-
getTableDestination
Get aFilerepresenting the path where the table will be written.- Parameters:
columnPartitionValue- the column partition to find the destination for- Returns:
- a file at the path the table will be written.
-
getLocalAppendableTable
@NotNull default LocalAppendableTable getLocalAppendableTable(String columnPartitionValue, boolean forceAppend) Returns theLocalAppendableTablefor given column partition value.- Parameters:
columnPartitionValue- 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
Get aTableWriterthat will replace the specified column partition. This is the same as callinggetTableWriter(String, boolean)withfalse.- Parameters:
columnPartitionValue- the column partition- Returns:
- an appropriate
TableWriter
-
getComputedColumnPartition
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 returnnullindicating that there is no valid column partition.- Parameters:
inputColumnPartition- the requested input partition- Returns:
- the computed column partition
-