use of org.voltdb.importer.formatter.FormatterBuilder in project voltdb by VoltDB.
the class ImportProcessor method addProcessorConfig.
private void addProcessorConfig(ImportConfiguration config, Map<String, AbstractImporterFactory> importerModules) {
Properties properties = config.getmoduleProperties();
String module = properties.getProperty(ImportDataProcessor.IMPORT_MODULE);
assert (module != null);
String[] attrs = module.split("\\|");
String bundleJar = attrs[1];
FormatterBuilder formatterBuilder = config.getFormatterBuilder();
try {
ImporterWrapper wrapper = m_importers.get(bundleJar);
if (wrapper == null) {
AbstractImporterFactory importFactory = importerModules.get(bundleJar);
wrapper = new ImporterWrapper(importFactory);
String name = wrapper.getImporterType();
if (name == null || name.trim().isEmpty()) {
throw new RuntimeException("Importer must implement and return a valid unique name.");
}
m_importers.put(bundleJar, wrapper);
}
wrapper.configure(properties, formatterBuilder);
} catch (Throwable t) {
m_logger.error("Failed to configure import handler for " + bundleJar, t);
Throwables.propagate(t);
}
}
Aggregations