Class BaseImporter<IAT extends StandardImporterArguments>

java.lang.Object
com.illumon.iris.importers.BaseImporter<IAT>
Type Parameters:
IAT - The actual class that extends StandardImporterArguments
Direct Known Subclasses:
BinaryStoreImporter, ExampleImporter

public abstract class BaseImporter<IAT extends StandardImporterArguments>
extends Object
Abstract base class for importers. Handles most of the boilerplate. Implementing classes will need to implement processData(), and will most likely want to extend StandardImporterArguments. processData() will acquire data from a source and feed it to the TableWriter via TableWriter.getSetter. set() and TableWriter.writeRow().
  • Field Details

    • log

      protected final com.fishlib.io.logger.Logger log
  • Constructor Details

    • BaseImporter

      protected BaseImporter​(@NotNull com.fishlib.io.logger.Logger log, @NotNull IAT arguments)
      Construct the BaseImporter.
      Parameters:
      log - use this Logger for feedback
      arguments - importer arguments defining the import run
  • Method Details

    • getImporterArguments

      protected IAT getImporterArguments()
      Get the importer arguments, in the actual parameterized type.
      Returns:
      the parsed importer arguments
    • getTableWriter

      protected TableWriter getTableWriter()
      Accessor for TableWriter.
      Returns:
      the TableWriter
    • getTableDefinition

      protected TableDefinition getTableDefinition()
      Accessor for table definition
      Returns:
      the TableDefinition
    • processData

      protected abstract void processData()
      Import the data - e.g. read the rows from the data source. The Overriding class does the actual import using arguments, tableWriter, and tableListenerFactory
    • finishImport

      protected void finishImport()
      Wrap up the import process. Close the tableWriter and any other finalization tasks. Implementors should not need to override this.
    • doImport

      protected void doImport()
      Execute the steps for an import to a specific location. Implementors should not need to override this.