From d8338fc51dc5c4ba7d91006a8e46f41a8fd2179f Mon Sep 17 00:00:00 2001 From: nishantmonu51 Date: Wed, 4 Jun 2014 16:40:06 +0530 Subject: [PATCH] fix backwards compatibility --- .../main/java/io/druid/cli/CliInternalHadoopIndexer.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/services/src/main/java/io/druid/cli/CliInternalHadoopIndexer.java b/services/src/main/java/io/druid/cli/CliInternalHadoopIndexer.java index b4aa070f8db..7e88cabb2a5 100644 --- a/services/src/main/java/io/druid/cli/CliInternalHadoopIndexer.java +++ b/services/src/main/java/io/druid/cli/CliInternalHadoopIndexer.java @@ -27,11 +27,11 @@ import io.airlift.command.Command; import io.druid.indexer.HadoopDruidDetermineConfigurationJob; import io.druid.indexer.HadoopDruidIndexerConfig; import io.druid.indexer.HadoopDruidIndexerJob; +import io.druid.indexer.HadoopIngestionSpec; import io.druid.indexer.JobHelper; import io.druid.indexer.Jobby; import java.io.File; -import java.util.ArrayList; import java.util.List; /** @@ -65,11 +65,13 @@ public class CliInternalHadoopIndexer implements Runnable public HadoopDruidIndexerConfig getHadoopDruidIndexerConfig() { try { + HadoopIngestionSpec spec; if (argumentSpec.startsWith("{")) { - return HadoopDruidIndexerConfig.fromString(argumentSpec); + spec = HadoopDruidIndexerConfig.jsonMapper.readValue(argumentSpec, HadoopIngestionSpec.class); } else { - return HadoopDruidIndexerConfig.fromFile(new File(argumentSpec)); + spec = HadoopDruidIndexerConfig.jsonMapper.readValue(new File(argumentSpec), HadoopIngestionSpec.class); } + return HadoopDruidIndexerConfig.fromSchema(spec); } catch (Exception e) { throw Throwables.propagate(e);