Package org.voltdb.importer
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal AbstractImporter
createImporter
(int priority, 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.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.abstract String
A unique name identifying the type of this importer.abstract boolean
Returns true if an importer instance must be run on every site for every resource.final void
setImportServerAdapter
(org.voltdb.importer.ImporterServerAdapter importServerAdapter) Passes in the adapter class that the importers may use to execute procedures.final void
start
(org.osgi.framework.BundleContext context) Registers this as an OSGi service.final void
stop
(org.osgi.framework.BundleContext context)
-
Constructor Details
-
AbstractImporterFactory
public AbstractImporterFactory()
-
-
Method Details
-
start
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 interfaceorg.osgi.framework.BundleActivator
- Throws:
Exception
-
stop
- Specified by:
stop
in interfaceorg.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
Method that is used by the importer framework classes to create an importer instance and wire it correctly for use within the server.- Parameters:
priority
- the priority of this importerconfig
- configuration information required to create an importer instance- Returns:
- importer instance created for the given configuration
-
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.
-