From df9be030db9642b0560305a7265e8f42570f2607 Mon Sep 17 00:00:00 2001 From: fjy Date: Mon, 10 Nov 2014 14:09:00 -0800 Subject: [PATCH] remove more legacy code --- .../main/java/io/druid/segment/IndexIO.java | 21 +++---------------- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/processing/src/main/java/io/druid/segment/IndexIO.java b/processing/src/main/java/io/druid/segment/IndexIO.java index 7158c836245..270e9cf896c 100644 --- a/processing/src/main/java/io/druid/segment/IndexIO.java +++ b/processing/src/main/java/io/druid/segment/IndexIO.java @@ -150,18 +150,8 @@ public class IndexIO bitmapSerdeFactory = injector.getInstance(BitmapSerdeFactory.class); } - private static volatile IndexIOHandler handler = null; - - @Deprecated - public static MMappedIndex mapDir(final File inDir) throws IOException - { - init(); - return handler.mapDir(inDir); - } - public static QueryableIndex loadIndex(File inDir) throws IOException { - init(); final int version = SegmentUtils.getVersionFromDir(inDir); final IndexLoader loader = indexLoaders.get(version); @@ -172,13 +162,6 @@ public class IndexIO throw new ISE("Unknown index version[%s]", version); } } - - private static void init() - { - if (handler == null) { - handler = new DefaultIndexIOHandler(); - } - } public static int getVersionFromDir(File inDir) throws IOException { @@ -659,10 +642,12 @@ public class IndexIO static class LegacyIndexLoader implements IndexLoader { + private static final IndexIOHandler legacyHandler = new DefaultIndexIOHandler(); + @Override public QueryableIndex load(File inDir) throws IOException { - MMappedIndex index = IndexIO.mapDir(inDir); + MMappedIndex index = legacyHandler.mapDir(inDir); Map columns = Maps.newHashMap();