fix backwards compatibility

This commit is contained in:
nishantmonu51 2014-06-04 16:40:06 +05:30
parent f7c4d6a24a
commit d8338fc51d
1 changed files with 5 additions and 3 deletions

View File

@ -27,11 +27,11 @@ import io.airlift.command.Command;
import io.druid.indexer.HadoopDruidDetermineConfigurationJob; import io.druid.indexer.HadoopDruidDetermineConfigurationJob;
import io.druid.indexer.HadoopDruidIndexerConfig; import io.druid.indexer.HadoopDruidIndexerConfig;
import io.druid.indexer.HadoopDruidIndexerJob; import io.druid.indexer.HadoopDruidIndexerJob;
import io.druid.indexer.HadoopIngestionSpec;
import io.druid.indexer.JobHelper; import io.druid.indexer.JobHelper;
import io.druid.indexer.Jobby; import io.druid.indexer.Jobby;
import java.io.File; import java.io.File;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
@ -65,11 +65,13 @@ public class CliInternalHadoopIndexer implements Runnable
public HadoopDruidIndexerConfig getHadoopDruidIndexerConfig() public HadoopDruidIndexerConfig getHadoopDruidIndexerConfig()
{ {
try { try {
HadoopIngestionSpec spec;
if (argumentSpec.startsWith("{")) { if (argumentSpec.startsWith("{")) {
return HadoopDruidIndexerConfig.fromString(argumentSpec); spec = HadoopDruidIndexerConfig.jsonMapper.readValue(argumentSpec, HadoopIngestionSpec.class);
} else { } else {
return HadoopDruidIndexerConfig.fromFile(new File(argumentSpec)); spec = HadoopDruidIndexerConfig.jsonMapper.readValue(new File(argumentSpec), HadoopIngestionSpec.class);
} }
return HadoopDruidIndexerConfig.fromSchema(spec);
} }
catch (Exception e) { catch (Exception e) {
throw Throwables.propagate(e); throw Throwables.propagate(e);