Package com.illumon.iris.importers
Class AppendingImportTableWriterFactory
java.lang.Object
com.illumon.iris.importers.AppendingImportTableWriterFactory
- All Implemented Interfaces:
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
ConstructorsConstructorDescriptionAppendingImportTableWriterFactory(ImportTableWriterFactory tableWriterFactory) -
Method Summary
Modifier and TypeMethodDescriptiongetLocalAppendableTable(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.getTableWriter(String columnPartitionValue, boolean append) 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 com.illumon.iris.importers.ImportTableWriterFactory
getComputedColumnPartition, getTableWriter
-
Constructor Details
-
AppendingImportTableWriterFactory
-
-
Method Details
-
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.
-
getTableDestination
Description copied from interface:ImportTableWriterFactoryGet aFilerepresenting the path where the table will be written.- Specified by:
getTableDestinationin interfaceImportTableWriterFactory- Parameters:
columnPartitionValue- the column partition to find the destination for- Returns:
- a file at the path the table will be written.
-
getLocalAppendableTable
@NotNull public LocalAppendableTable getLocalAppendableTable(String columnPartitionValue, boolean forceAppend) Description copied from interface:ImportTableWriterFactoryReturns theLocalAppendableTablefor given column partition value.- Specified by:
getLocalAppendableTablein interfaceImportTableWriterFactory- 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
Description copied from interface:ImportTableWriterFactoryGet aTableWriterfor the table and specified partition, optionally appending.- Specified by:
getTableWriterin 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
-