Source:
public QueryableIndex load(File inDir) throws IOException { log.debug("Mapping v9 index[%s]", inDir); long startTime = System.currentTimeMillis(); final int theVersion = Ints.fromByteArray(Files.toByteArray(new File(inDir, "version.bin"))); if (theVersion != V9_VERSION) { throw new IllegalArgumentException(String.format("Expected version[9], got[%s]", theVersion)); } SmooshedFileMapper smooshedFiles = Smoosh.map(inDir); ByteBuffer indexBuffer = smooshedFiles.mapFile("index.drd"); final GenericIndexed<String> cols = GenericIndexed.read(indexBuffer, GenericIndexed.STRING_STRATEGY); final GenericIndexed<String> dims = GenericIndexed.read(indexBuffer, GenericIndexed.STRING_STRATEGY); final Interval dataInterval = new Interval(indexBuffer.getLong(), indexBuffer.getLong()); final BitmapSerdeFactory segmentBitmapSerdeFactory; if (indexBuffer.hasRemaining()) { segmentBitmapSerdeFactory = mapper.readValue(serializerUtils.readString(indexBuffer), BitmapSerdeFactory.class); } else { segmentBitmapSerdeFactory = new BitmapSerde.LegacyBitmapSerdeFactory(); } Map<String, Object> metadata = null; ByteBuffer metadataBB = smooshedFiles.mapFile("metadata.drd"); if (metadataBB != null) { metadata = mapper.readValue( serializerUtils.readBytes(metadataBB, metadataBB.remaining()), new TypeReference<Map<String, Object>>() { } ); } Map<String, Column> columns = Maps.newHashMap(); for (String columnName : cols) { columns.put(columnName, deserializeColumn(mapper, smooshedFiles.mapFile(columnName))); } columns.put(Column.TIME_COLUMN_NAME, deserializeColumn(mapper, smooshedFiles.mapFile("__time"))); final QueryableIndex index = new SimpleQueryableIndex( dataInterval, cols, dims, segmentBitmapSerdeFactory.getBitmapFactory(), columns, smooshedFiles, metadata ); log.debug("Mapped v9 index[%s] in %,d millis", inDir, System.currentTimeMillis() - startTime); return index; }

Target:
public QueryableIndex load(File inDir) throws IOException { log.debug("Mapping v9 index[%s]", inDir); long startTime = System.currentTimeMillis(); final int theVersion = Ints.fromByteArray(Files.toByteArray(new File(inDir, "version.bin"))); if (theVersion != V9_VERSION) { throw new IllegalArgumentException(String.format("Expected version[9], got[%s]", theVersion)); } SmooshedFileMapper smooshedFiles = Smoosh.map(inDir); ByteBuffer indexBuffer = smooshedFiles.mapFile("index.drd"); final GenericIndexed<String> cols = GenericIndexed.read(indexBuffer, GenericIndexed.STRING_STRATEGY); final GenericIndexed<String> dims = GenericIndexed.read(indexBuffer, GenericIndexed.STRING_STRATEGY); final Interval dataInterval = new Interval(indexBuffer.getLong(), indexBuffer.getLong()); final BitmapSerdeFactory segmentBitmapSerdeFactory; if (indexBuffer.hasRemaining()) { segmentBitmapSerdeFactory = mapper.readValue(serializerUtils.readString(indexBuffer), BitmapSerdeFactory.class); } else { segmentBitmapSerdeFactory = new BitmapSerde.LegacyBitmapSerdeFactory(); } Map<String, Object> metadata = null; ByteBuffer metadataBB = smooshedFiles.mapFile("metadata.drd"); if (metadataBB != null) { try { metadata = mapper.readValue( serializerUtils.readBytes(metadataBB, metadataBB.remaining()), new TypeReference<Map<String, Object>>() { } ); } catch (IOException ex) { throw new IOException("Failed to read metadata", ex); } } Map<String, Column> columns = Maps.newHashMap(); for (String columnName : cols) { columns.put(columnName, deserializeColumn(mapper, smooshedFiles.mapFile(columnName))); } columns.put(Column.TIME_COLUMN_NAME, deserializeColumn(mapper, smooshedFiles.mapFile("__time"))); final QueryableIndex index = new SimpleQueryableIndex( dataInterval, cols, dims, segmentBitmapSerdeFactory.getBitmapFactory(), columns, smooshedFiles, metadata ); log.debug("Mapped v9 index[%s] in %,d millis", inDir, System.currentTimeMillis() - startTime); return index; }