use of org.embulk.spi.FilterPlugin in project embulk by embulk.
the class Executors method process.
public static void process(ExecSession exec, ProcessTask task, int taskIndex, ProcessStateCallback callback) {
InputPlugin inputPlugin = exec.newPlugin(InputPlugin.class, task.getInputPluginType());
List<FilterPlugin> filterPlugins = Filters.newFilterPlugins(exec, task.getFilterPluginTypes());
OutputPlugin outputPlugin = exec.newPlugin(OutputPlugin.class, task.getOutputPluginType());
// TODO assert task.getExecutorSchema().equals task.getOutputSchema()
process(exec, taskIndex, inputPlugin, task.getInputSchema(), task.getInputTaskSource(), filterPlugins, task.getFilterSchemas(), task.getFilterTaskSources(), outputPlugin, task.getOutputSchema(), task.getOutputTaskSource(), callback);
}
use of org.embulk.spi.FilterPlugin in project embulk by embulk.
the class PreviewExecutor method doPreview.
private PreviewResult doPreview(ConfigSource config) {
PreviewTask task = config.loadConfig(PreviewTask.class);
InputPlugin inputPlugin = newInputPlugin(task);
List<FilterPlugin> filterPlugins = newFilterPlugins(task);
if (inputPlugin instanceof FileInputRunner) {
// file input runner
Buffer sample = SamplingParserPlugin.runFileInputSampling((FileInputRunner) inputPlugin, config.getNested("in"), createSampleBufferConfigFromExecConfig(task.getExecConfig()));
FileInputRunner previewRunner = new FileInputRunner(new BufferFileInputPlugin(sample));
return doPreview(task, previewRunner, filterPlugins);
} else {
return doPreview(task, inputPlugin, filterPlugins);
}
}
Aggregations