remove more legacy code

This commit is contained in:
fjy 2014-11-10 14:09:00 -08:00
parent 72c355e8ae
commit df9be030db
1 changed files with 3 additions and 18 deletions

View File

@ -150,18 +150,8 @@ public class IndexIO
bitmapSerdeFactory = injector.getInstance(BitmapSerdeFactory.class); 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 public static QueryableIndex loadIndex(File inDir) throws IOException
{ {
init();
final int version = SegmentUtils.getVersionFromDir(inDir); final int version = SegmentUtils.getVersionFromDir(inDir);
final IndexLoader loader = indexLoaders.get(version); final IndexLoader loader = indexLoaders.get(version);
@ -173,13 +163,6 @@ public class IndexIO
} }
} }
private static void init()
{
if (handler == null) {
handler = new DefaultIndexIOHandler();
}
}
public static int getVersionFromDir(File inDir) throws IOException public static int getVersionFromDir(File inDir) throws IOException
{ {
File versionFile = new File(inDir, "version.bin"); File versionFile = new File(inDir, "version.bin");
@ -659,10 +642,12 @@ public class IndexIO
static class LegacyIndexLoader implements IndexLoader static class LegacyIndexLoader implements IndexLoader
{ {
private static final IndexIOHandler legacyHandler = new DefaultIndexIOHandler();
@Override @Override
public QueryableIndex load(File inDir) throws IOException public QueryableIndex load(File inDir) throws IOException
{ {
MMappedIndex index = IndexIO.mapDir(inDir); MMappedIndex index = legacyHandler.mapDir(inDir);
Map<String, Column> columns = Maps.newHashMap(); Map<String, Column> columns = Maps.newHashMap();