Search in sources :

Example 1 with FilterPlugin

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);
}
Also used : InputPlugin(org.embulk.spi.InputPlugin) FilterPlugin(org.embulk.spi.FilterPlugin) OutputPlugin(org.embulk.spi.OutputPlugin)

Example 2 with FilterPlugin

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);
    }
}
Also used : Buffer(org.embulk.spi.Buffer) InputPlugin(org.embulk.spi.InputPlugin) FilterPlugin(org.embulk.spi.FilterPlugin) FileInputRunner(org.embulk.spi.FileInputRunner)

Aggregations

FilterPlugin (org.embulk.spi.FilterPlugin)2 InputPlugin (org.embulk.spi.InputPlugin)2 Buffer (org.embulk.spi.Buffer)1 FileInputRunner (org.embulk.spi.FileInputRunner)1 OutputPlugin (org.embulk.spi.OutputPlugin)1