diff --git a/.travis.yml b/.travis.yml index 7d631bf..ff47de7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: java jdk: - - oraclejdk8 + - openjdk8 services: - docker diff --git a/src/main/java/org/embulk/output/elasticsearch/ElasticsearchOutputPluginDelegate.java b/src/main/java/org/embulk/output/elasticsearch/ElasticsearchOutputPluginDelegate.java index 524ac0a..fa3c7fd 100644 --- a/src/main/java/org/embulk/output/elasticsearch/ElasticsearchOutputPluginDelegate.java +++ b/src/main/java/org/embulk/output/elasticsearch/ElasticsearchOutputPluginDelegate.java @@ -12,13 +12,11 @@ import org.embulk.config.ConfigDefault; import org.embulk.config.ConfigDiff; import org.embulk.config.ConfigException; -import org.embulk.config.ConfigSource; import org.embulk.config.Task; import org.embulk.config.TaskReport; import org.embulk.spi.Exec; import org.embulk.spi.Schema; import org.embulk.spi.time.TimestampFormatter; -import org.joda.time.DateTimeZone; import org.slf4j.Logger; import java.util.List; @@ -226,22 +224,10 @@ public void validateOutputTask(PluginTask task, Schema embulkSchema, int taskCou } } - private static interface FormatterIntlTask extends Task, TimestampFormatter.Task {} - private static interface FormatterIntlColumnOption extends Task, TimestampFormatter.TimestampColumnOption {} - @Override // Overridden from |ServiceRequestMapperBuildable| public JacksonServiceRequestMapper buildServiceRequestMapper(PluginTask task) { - // TODO: Switch to a newer TimestampFormatter constructor after a reasonable interval. - // Traditional constructor is used here for compatibility. - final ConfigSource configSource = Exec.newConfigSource(); - configSource.set("format", "%Y-%m-%dT%H:%M:%S.%3N%z"); - configSource.set("timezone", DateTimeZone.forID(task.getTimeZone())); - TimestampFormatter formatter = TimestampFormatter.of( - Exec.newConfigSource().loadConfig(FormatterIntlTask.class), - com.google.common.base.Optional.fromNullable(configSource.loadConfig(FormatterIntlColumnOption.class)) - ); - + TimestampFormatter formatter = TimestampFormatter.of("%Y-%m-%dT%H:%M:%S.%3N%z", task.getTimeZone()); return JacksonServiceRequestMapper.builder() .add(new JacksonAllInObjectScope(formatter, task.getFillNullForEmptyColumn()), new JacksonTopLevelValueLocator("record")) .build();