Class AbstractImporterFactory

java.lang.Object
org.voltdb.importer.AbstractImporterFactory
All Implemented Interfaces:
org.osgi.framework.BundleActivator

public abstract class AbstractImporterFactory extends Object implements org.osgi.framework.BundleActivator
Factory class that importer bundles should extend to make the importer available for use within VoltDB server. If the importer is made available using an OSGi bundle, this will register itself as a service using BundleActivator.start implementation.
Author:
manjujames
  • Constructor Details

    • AbstractImporterFactory

      public AbstractImporterFactory()
  • Method Details

    • start

      public final void start(org.osgi.framework.BundleContext context) throws Exception
      Registers this as an OSGi service. At startup, the server will look for this factory service within the configured importer bundles.
      Specified by:
      start in interface org.osgi.framework.BundleActivator
      Throws:
      Exception
    • stop

      public final void stop(org.osgi.framework.BundleContext context) throws Exception
      Specified by:
      stop in interface org.osgi.framework.BundleActivator
      Throws:
      Exception
    • setImportServerAdapter

      public final void setImportServerAdapter(org.voltdb.importer.ImporterServerAdapter importServerAdapter)
      Passes in the adapter class that the importers may use to execute procedures.
      Parameters:
      importServerAdapter - which adapter is used for invoking procedures from importer.
    • createImporter

      public final AbstractImporter createImporter(ImporterConfig config)
      Method that is used by the importer framework classes to create an importer instance and wire it correctly for use within the server.
      Parameters:
      config - configuration information required to create an importer instance
      Returns:
      importer instance created for the given configuration
    • getTypeName

      public abstract String getTypeName()
      A unique name identifying the type of this importer. This must be unique within the server.
      Returns:
      unique name identifying the type of this importer
    • createImporterConfigurations

      public abstract Map<URI,ImporterConfig> createImporterConfigurations(Properties props, org.voltdb.importer.formatter.FormatterBuilder formatterBuilder)
      From a given set of properties, creates ImporterConfig for every resource ID configured.
      Parameters:
      props - importer configuration properties; typically defined in deployment file.
      formatterBuilder - the formatter builder
      Returns:
      Map of resourceIDs to ImporterConfig as configured using the input properties
    • isImporterRunEveryWhere

      public abstract boolean isImporterRunEveryWhere()
      Returns true if an importer instance must be run on every site for every resource. Returns false if the resources must be distributed between available sites.
      Returns:
      Returns true if importer needs to be run in distributed fashion on all nodes. This also means the importer is asked for URIs to distribute.