Sha256: d8bf815f84037fe76096c626031aabe5ac7db0c176b1b1df36e2bce9cf18bcdf

Contents?: true

Size: 1.72 KB

Versions: 30

Compression:

Stored size: 1.72 KB

Contents

package org.embulk.<%= embulk_category %>;

import java.util.List;
import org.embulk.config.CommitReport;
import org.embulk.config.Config;
import org.embulk.config.ConfigDefault;
import org.embulk.config.ConfigDiff;
import org.embulk.config.ConfigSource;
import org.embulk.config.Task;
import org.embulk.config.TaskSource;
import org.embulk.spi.Exec;
import org.embulk.spi.FileInputPlugin;
import org.embulk.spi.TransactionalFileInput;

public class <%= java_class_name %>
        implements FileInputPlugin
{
    public interface PluginTask
            extends Task
    {
        @Config("property1")
        public String getProperty1();

        @Config("property2")
        @ConfigDefault("0")
        public int getProperty2();
    }

    @Override
    public ConfigDiff transaction(ConfigSource config, FileInputPlugin.Control control)
    {
        PluginTask task = config.loadConfig(PluginTask.class);

        // taskCount is usually number of input files
        int taskCount = 1;  // number of run() method calls

        return resume(task.dump(), taskCount, control);
    }

    @Override
    public ConfigDiff resume(TaskSource taskSource,
            int taskCount,
            FileInputPlugin.Control control)
    {
        control.run(taskSource, taskCount);
        return Exec.newConfigDiff();
    }

    @Override
    public void cleanup(TaskSource taskSource,
            int taskCount,
            List<CommitReport> successCommitReports)
    {
    }

    @Override
    public TransactionalFileInput open(TaskSource taskSource, int taskIndex)
    {
        PluginTask task = taskSource.loadTask(PluginTask.class);

        // TODO
        throw new UnsupportedOperationException("The 'open' method needs to be implemented");
    }
}

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
embulk-0.6.16 lib/embulk/data/new/java/file_input.java.erb
embulk-0.6.15 lib/embulk/data/new/java/file_input.java.erb
embulk-0.6.14 lib/embulk/data/new/java/file_input.java.erb
embulk-0.6.13 lib/embulk/data/new/java/file_input.java.erb
embulk-0.6.12 lib/embulk/data/new/java/file_input.java.erb
embulk-0.6.11 lib/embulk/data/new/java/file_input.java.erb
embulk-0.6.10 lib/embulk/data/new/java/file_input.java.erb
embulk-0.6.9 lib/embulk/data/new/java/file_input.java.erb
embulk-0.6.8 lib/embulk/data/new/java/file_input.java.erb
embulk-0.6.7 lib/embulk/data/new/java/file_input.java.erb
embulk-0.6.6 lib/embulk/data/new/java/file_input.java.erb
embulk-0.6.5 lib/embulk/data/new/java/file_input.java.erb
embulk-0.6.4 lib/embulk/data/new/java/file_input.java.erb
embulk-0.6.3 lib/embulk/data/new/java/file_input.java.erb
embulk-0.6.2 lib/embulk/data/new/java/file_input.java.erb
embulk-0.6.1 lib/embulk/data/new/java/file_input.java.erb
embulk-0.6.0 lib/embulk/data/new/java/file_input.java.erb
embulk-0.5.5 lib/embulk/data/new/java/file_input.java.erb
embulk-0.5.4 lib/embulk/data/new/java/file_input.java.erb
embulk-0.5.3 lib/embulk/data/new/java/file_input.java.erb