Sha256: 73d67f7cacada3d2f461e18a3ba6f828902a5044c38a9007fcc3096c7e8249de

Contents?: true

Size: 1.74 KB

Versions: 42

Compression:

Stored size: 1.74 KB

Contents

package ${javaPackageName};

import com.google.common.base.Optional;

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.FileInput;
import org.embulk.spi.PageOutput;
import org.embulk.spi.ParserPlugin;
import org.embulk.spi.Schema;
import org.embulk.spi.SchemaConfig;

public class ${javaClassName}
        implements ParserPlugin
{
    public interface PluginTask
            extends Task
    {
        // configuration option 1 (required integer)
        @Config("option1")
        public int getOption1();

        // configuration option 2 (optional string, null is not allowed)
        @Config("option2")
        @ConfigDefault("\"myvalue\"")
        public String getOption2();

        // configuration option 3 (optional string, null is allowed)
        @Config("option3")
        @ConfigDefault("null")
        public Optional<String> getOption3();

        // if you get schema from config or data source
        @Config("columns")
        public SchemaConfig getColumns();
    }

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

        Schema schema = task.getColumns().toSchema();

        control.run(task.dump(), schema);
    }

    @Override
    public void run(TaskSource taskSource, Schema schema,
            FileInput input, PageOutput output)
    {
        PluginTask task = taskSource.loadTask(PluginTask.class);

        // Write your code here :)
        throw new UnsupportedOperationException("${javaClassName}.run method is not implemented yet");
    }
}

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
embulk-0.8.39 lib/embulk/data/new/java/parser.java.vm
embulk-0.8.39-java lib/embulk/data/new/java/parser.java.vm
embulk-0.8.38 lib/embulk/data/new/java/parser.java.vm
embulk-0.8.38-java lib/embulk/data/new/java/parser.java.vm
embulk-0.8.37 lib/embulk/data/new/java/parser.java.vm
embulk-0.8.37-java lib/embulk/data/new/java/parser.java.vm
embulk-0.8.36 lib/embulk/data/new/java/parser.java.vm
embulk-0.8.36-java lib/embulk/data/new/java/parser.java.vm
embulk-0.8.35 lib/embulk/data/new/java/parser.java.vm
embulk-0.8.35-java lib/embulk/data/new/java/parser.java.vm
embulk-0.8.34 lib/embulk/data/new/java/parser.java.vm
embulk-0.8.34-java lib/embulk/data/new/java/parser.java.vm
embulk-0.8.33 lib/embulk/data/new/java/parser.java.vm
embulk-0.8.33-java lib/embulk/data/new/java/parser.java.vm
embulk-0.8.32 lib/embulk/data/new/java/parser.java.vm
embulk-0.8.32-java lib/embulk/data/new/java/parser.java.vm
embulk-0.8.31 lib/embulk/data/new/java/parser.java.vm
embulk-0.8.31-java lib/embulk/data/new/java/parser.java.vm
embulk-0.8.30 lib/embulk/data/new/java/parser.java.vm
embulk-0.8.30-java lib/embulk/data/new/java/parser.java.vm