Package com.illumon.iris.importers
Class AppendingImportTableWriterFactory
java.lang.Object
com.illumon.iris.importers.AppendingImportTableWriterFactory
- All Implemented Interfaces:
ImportTableWriterFactory
public class AppendingImportTableWriterFactory extends Object implements ImportTableWriterFactory
A wrapper for table writer factory that forces append mode after a table is requested the 1st time.
This is useful if the factory is used repeatedly with the same partition(s) and we don't want to wipe out the
table after the 1st run.
-
Constructor Summary
Constructors Constructor Description AppendingImportTableWriterFactory(ImportTableWriterFactory tableWriterFactory)
-
Method Summary
Modifier and Type Method Description String
getComputedColumnPartition(String inputColumnPartition)
Get the computed column partition for the requested one.TableDefinition
getTableDefinition()
Get the table definition associated with the table that will be written.File
getTableDestination(String columnPartitionValue)
Get aFile
representing the path where the table will be written.TableWriter
getTableWriter(String columnPartitionValue, boolean append)
Get aTableWriter
for the table and specified partition, optionally appending.
-
Constructor Details
-
Method Details
-
getTableDefinition
Description copied from interface:ImportTableWriterFactory
Get the table definition associated with the table that will be written.- Specified by:
getTableDefinition
in interfaceImportTableWriterFactory
- Returns:
- the table definition.
-
getTableDestination
Description copied from interface:ImportTableWriterFactory
Get aFile
representing the path where the table will be written.- Specified by:
getTableDestination
in interfaceImportTableWriterFactory
- Parameters:
columnPartitionValue
- the column partition to find the destination for- Returns:
- a file at the path the table will be written.
-
getTableWriter
Description copied from interface:ImportTableWriterFactory
Get aTableWriter
for the table and specified partition, optionally appending.- Specified by:
getTableWriter
in interfaceImportTableWriterFactory
- Parameters:
columnPartitionValue
- the column partition to use. Some implementations allow nulls.append
- if the table should be appended or replaced.- Returns:
- an appropriate
TableWriter
-
getComputedColumnPartition
Description copied from interface:ImportTableWriterFactory
Get the computed column partition for the requested one. In Most cases the result will be the same as inputColumnPartition, however it is possible to returnnull
indicating that there is no valid column partition.- Specified by:
getComputedColumnPartition
in interfaceImportTableWriterFactory
- Parameters:
inputColumnPartition
- the requested input partition- Returns:
- the computed column partition
-