use of org.apache.hop.core.LogProgressMonitor in project hop by apache.
the class HopImport method run.
@Override
public void run() {
try {
log = new LogChannel("HopImport");
if (listPluginTypes != null && listPluginTypes) {
printPluginTypes();
return;
}
if (!validateOptions()) {
cmd.usage(System.err);
return;
}
hopImport = loadImportPlugin();
if (hopImport == null) {
return;
}
log.logDetailed("Start of Hop Import");
// Set the options...
//
hopImport.setValidateInputFolder(inputFolderName);
hopImport.setValidateOutputFolder(outputFolderName);
hopImport.setKettlePropertiesFilename(kettlePropertiesFilename);
hopImport.setJdbcPropertiesFilename(jdbcPropertiesFilename);
hopImport.setSharedXmlFilename(sharedXmlFilename);
if (skippingExistingTargetFiles != null) {
log.logBasic("Import is " + (skippingExistingTargetFiles ? "" : "not ") + "skipping existing target files");
hopImport.setSkippingExistingTargetFiles(skippingExistingTargetFiles);
}
if (skippingHiddenFilesAndFolders != null) {
log.logBasic("Import is " + (skippingHiddenFilesAndFolders ? "" : "not ") + "skipping hidden files and folders");
hopImport.setSkippingHiddenFilesAndFolders(skippingHiddenFilesAndFolders);
}
if (skippingFolders != null) {
log.logBasic("Import is " + (skippingFolders ? "" : "not ") + "skipping sub-folders");
hopImport.setSkippingFolders(skippingFolders);
}
hopImport.setTargetConfigFilename(targetConfigFilename);
// Allow plugins to modify the elements loaded so far, before a pipeline or workflow is even
// loaded
//
ExtensionPointHandler.callExtensionPoint(log, variables, HopExtensionPoint.HopImportStart.id, this);
// Handle the options of the configuration plugins
//
Map<String, Object> mixins = cmd.getMixins();
for (String key : mixins.keySet()) {
Object mixin = mixins.get(key);
if (mixin instanceof IConfigOptions) {
IConfigOptions configOptions = (IConfigOptions) mixin;
configOptions.handleOption(log, this, variables);
}
}
// Text version of a progress monitor...
//
IProgressMonitor monitor = new LogProgressMonitor(log);
// Run the import...
//
hopImport.runImport(monitor);
// Print the report...
//
log.logBasic(Const.CR);
log.logBasic(hopImport.getImportReport());
ExtensionPointHandler.callExtensionPoint(log, variables, HopExtensionPoint.HopImportEnd.id, this);
} catch (Exception e) {
throw new ExecutionException(cmd, "There was an error during import", e);
}
}
Aggregations