Package com.illumon.iris.importers.util
Class CsvImport
java.lang.Object
com.illumon.iris.importers.util.ImportBase
com.illumon.iris.importers.util.CsvImport
public class CsvImport extends ImportBase
Tools for programmatically executing CSV batch imports.
-
Field Summary
Fields Modifier and Type Field Description static com.fishlib.io.logger.Logger
log
Fields inherited from class com.illumon.iris.importers.util.ImportBase
destinationDirectory, destinationPartitions, namespace, outputMode, schemaService, table
-
Method Summary
Modifier and Type Method Description static CsvImportBuilder
builder(String namespace, String table)
Deprecated.usefromFiles(String, String)
instead.static CsvImportBuilder
fromFiles(String namespace, String table)
Creates a newCsvImportBuilder
to configure an CSV importer that pulls data from a set of files on disk.static CsvImportBuilder
fromStream(String namespace, String table, InputStream stream)
Creates a newCsvImportBuilder
to configure an CSV importer that pulls data from a specific InputStream.long
run()
Executes a CSV batch import as configured for theCsvImport
object.Methods inherited from class com.illumon.iris.importers.util.ImportBase
getFileList, getImportTableWriterFactory, getSourceFiles
-
Field Details
-
log
public static final com.fishlib.io.logger.Logger log
-
-
Method Details
-
builder
@Deprecated @ScriptApi public static CsvImportBuilder builder(@NotNull String namespace, @NotNull String table)Deprecated.usefromFiles(String, String)
instead.Creates a newCsvImportBuilder
to configure an CSV importer that pulls data from a set of files on disk.- Parameters:
namespace
- The String name of the namespace into which data will be imported.table
- The String name of the table into which data will be imported.- Returns:
- A new
CsvImportBuilder
.
-
fromFiles
@ScriptApi public static CsvImportBuilder fromFiles(@NotNull String namespace, @NotNull String table)Creates a newCsvImportBuilder
to configure an CSV importer that pulls data from a set of files on disk.- Parameters:
namespace
- The String name of the namespace into which data will be imported.table
- The String name of the table into which data will be imported.- Returns:
- A new
CsvImportBuilder
.
-
fromStream
@ScriptApi public static CsvImportBuilder fromStream(@NotNull String namespace, @NotNull String table, @NotNull InputStream stream)Creates a newCsvImportBuilder
to configure an CSV importer that pulls data from a specific InputStream.- Parameters:
namespace
- The String name of the namespace into which data will be imported.table
- The String name of the table into which data will be imported.- Returns:
- A new
CsvImportBuilder
.
-
run
Executes a CSV batch import as configured for theCsvImport
object.- Specified by:
run
in classImportBase
- Returns:
- A long of the number of rows imported.
- Throws:
IOException
- If the import cannot be executed or fails during processing.
-