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();