Sha256: 4330bfc56650ee7467de6067f03112e0a9af114b806ad2095cee17bf071d012f

Contents?: true

Size: 1.96 KB

Versions: 16

Compression:

Stored size: 1.96 KB

Contents

package org.embulk.exec;

import org.slf4j.ILoggerFactory;
import com.google.common.base.Preconditions;
import com.google.inject.Module;
import com.google.inject.name.Names;
import com.google.inject.Binder;
import com.google.inject.Scopes;
import com.fasterxml.jackson.module.guice.ObjectMapperModule;
import com.fasterxml.jackson.datatype.guava.GuavaModule;
import com.fasterxml.jackson.datatype.joda.JodaModule;
import org.embulk.config.ModelManager;
import org.embulk.spi.time.DateTimeZoneSerDe;
import org.embulk.spi.time.TimestampSerDe;
import org.embulk.spi.ParserPlugin;
import org.embulk.spi.ExecutorPlugin;
import org.embulk.spi.BufferAllocator;
import org.embulk.spi.util.CharsetSerDe;
import static org.embulk.plugin.InjectedPluginSource.registerPluginTo;

public class ExecModule
        implements Module
{
    @Override
    public void configure(Binder binder)
    {
        Preconditions.checkNotNull(binder, "binder is null.");

        binder.bind(ILoggerFactory.class).toProvider(LoggerProvider.class);
        binder.bind(ModelManager.class).in(Scopes.SINGLETON);
        binder.bind(BufferAllocator.class).to(PooledBufferAllocator.class).in(Scopes.SINGLETON);

        // GuessExecutor
        registerPluginTo(binder, ParserPlugin.class, "system_guess", GuessExecutor.GuessParserPlugin.class);
        registerPluginTo(binder, ParserPlugin.class, "system_sampling", SamplingParserPlugin.class);

        // LocalExecutorPlugin
        binder.bind(LocalThreadExecutor.class).in(Scopes.SINGLETON);
        registerPluginTo(binder, ExecutorPlugin.class, "local", LocalExecutorPlugin.class);

        // serde
        ObjectMapperModule mapper = new ObjectMapperModule();
        DateTimeZoneSerDe.configure(mapper);
        TimestampSerDe.configure(mapper);
        CharsetSerDe.configure(mapper);
        mapper.registerModule(new GuavaModule());  // jackson-datatype-guava
        mapper.registerModule(new JodaModule());  // jackson-datatype-joda
        mapper.configure(binder);
    }
}

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
embulk-0.6.15 embulk-core/src/main/java/org/embulk/exec/ExecModule.java
embulk-0.6.14 embulk-core/src/main/java/org/embulk/exec/ExecModule.java
embulk-0.6.13 embulk-core/src/main/java/org/embulk/exec/ExecModule.java
embulk-0.6.12 embulk-core/src/main/java/org/embulk/exec/ExecModule.java
embulk-0.6.11 embulk-core/src/main/java/org/embulk/exec/ExecModule.java
embulk-0.6.10 embulk-core/src/main/java/org/embulk/exec/ExecModule.java
embulk-0.6.9 embulk-core/src/main/java/org/embulk/exec/ExecModule.java
embulk-0.6.8 embulk-core/src/main/java/org/embulk/exec/ExecModule.java
embulk-0.6.7 embulk-core/src/main/java/org/embulk/exec/ExecModule.java
embulk-0.6.6 embulk-core/src/main/java/org/embulk/exec/ExecModule.java
embulk-0.6.5 embulk-core/src/main/java/org/embulk/exec/ExecModule.java
embulk-0.6.4 embulk-core/src/main/java/org/embulk/exec/ExecModule.java
embulk-0.6.3 embulk-core/src/main/java/org/embulk/exec/ExecModule.java
embulk-0.6.2 embulk-core/src/main/java/org/embulk/exec/ExecModule.java
embulk-0.6.1 embulk-core/src/main/java/org/embulk/exec/ExecModule.java
embulk-0.6.0 embulk-core/src/main/java/org/embulk/exec/ExecModule.java