Package com.illumon.iris.importers
Class ImportTableWriterFactoryBase
java.lang.Object
com.illumon.iris.importers.ImportTableWriterFactoryBase
- All Implemented Interfaces:
ImportTableWriterFactory
- Direct Known Subclasses:
DirectoryImportTableFactory
,MultiPartitionImportTableWriterFactory
,SinglePartitionImportTableFactory
public abstract class ImportTableWriterFactoryBase
extends Object
implements ImportTableWriterFactory
A base for table writer factories with common utility code to validate and prepare table destination directories,
and create the table writers.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final String
protected final ImportOutputMode
protected final TableDefinition
protected final String
protected final TableDefinition
-
Method Summary
Modifier and TypeMethodDescriptiongetLocalAppendableTable
(String columnPartitionValue, boolean forceAppend) The method validates the destination against theImportOutputMode
included for the CsvImport unless forceAppend is true.Note this returns the full table definition including partitioning columns.protected TableWriter
getTableWriter
(File destinationDirectory, boolean forceAppend) getTableWriter
(String columnPartitionValue, boolean forceAppend) Get aTableWriter
for the table and specified partition, optionally appending.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.illumon.iris.importers.ImportTableWriterFactory
getComputedColumnPartition, getTableDestination, getTableWriter
-
Field Details
-
namespace
-
tableName
-
tableDefinition
-
writableTableDefinition
-
outputMode
-
-
Method Details
-
getTableDefinition
Note this returns the full table definition including partitioning columns.- Specified by:
getTableDefinition
in interfaceImportTableWriterFactory
- Returns:
- the table definition.
-
getLocalAppendableTable
@NotNull public LocalAppendableTable getLocalAppendableTable(String columnPartitionValue, boolean forceAppend) The method validates the destination against theImportOutputMode
included for the CsvImport unless forceAppend is true. Creates a newLocalAppendableTable
instance to return.- Specified by:
getLocalAppendableTable
in interfaceImportTableWriterFactory
- Parameters:
columnPartitionValue
- the column partition to use. Some implementations allow nulls.forceAppend
- when true will useImportOutputMode.APPEND
when initializing the instance ofLocalAppendableTable
being returned. A value of false will use theImportOutputMode
provided as part of the import call- Returns:
- A new
LocalAppendableTable
using the destination retrieved using the provided column partition value and resolvedImportOutputMode
-
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.forceAppend
- if the table should be appended or replaced.- Returns:
- an appropriate
TableWriter
-
getTableWriter
-