Source:
public OffheapIncrementalIndex( IncrementalIndexSchema incrementalIndexSchema, boolean deserializeComplexMetrics, boolean reportParseExceptions, boolean sortFacts, long maxOffheapSize ) { super(incrementalIndexSchema, deserializeComplexMetrics, reportParseExceptions, sortFacts); tmpDirLocation = Files.createTempDir(); try { File mapDbFile = File.createTempFile("druid-offheap-index-mapdb", "", tmpDirLocation); File aggsBBFile = File.createTempFile("druid-offheap-index-aggs", "", tmpDirLocation); AtomicLong availableTotalSpace = new AtomicLong(maxOffheapSize); final DBMaker dbMaker = new MyDBMaker(mapDbFile, 24, 29, availableTotalSpace) .deleteFilesAfterClose() .commitFileSyncDisable() .cacheSize(1024) .transactionDisable() .mmapFileEnable(); this.factsDb = dbMaker.make(); if (sortFacts) { TimeAndDimsBTreeKeySerializer timeAndDimsSerializer = new TimeAndDimsBTreeKeySerializer(this); this.facts = factsDb.createTreeMap("__facts" + UUID.randomUUID()) .keySerializer(timeAndDimsSerializer) .comparator(timeAndDimsSerializer.getComparator()) .valueSerializer(Serializer.INTEGER) .make(); } else { this.facts = factsDb.createHashMap("__facts" + UUID.randomUUID()) .keySerializer(TimeAndDimsSerializer.INSTANCE) .valueSerializer(Serializer.INTEGER) .make(); } this.aggBBFactory = new DiskBBFactory(aggsBBFile, 29, availableTotalSpace); ByteBuffer bb = this.aggBBFactory.allocateBB(); if (bb.capacity() < aggsTotalSize) { throw new IAE("bufferPool buffers capacity must be >= [%s]", aggsTotalSize); } aggBuffers.add(bb); } catch(Exception ex) { FileUtils.deleteQuietly(tmpDirLocation); throw Throwables.propagate(ex); } }

Target:
public OffheapIncrementalIndex( IncrementalIndexSchema incrementalIndexSchema, boolean deserializeComplexMetrics, boolean reportParseExceptions, boolean sortFacts, long maxOffheapSize ) { super(incrementalIndexSchema, deserializeComplexMetrics, reportParseExceptions, sortFacts); try { tmpDirLocation = Files.createTempDirectory("druid-offheap-index").toFile(); File mapDbFile = File.createTempFile("mapdb", "", tmpDirLocation); File aggsBBFile = File.createTempFile("aggs", "", tmpDirLocation); AtomicLong availableTotalSpace = new AtomicLong(maxOffheapSize); final DBMaker dbMaker = new MyDBMaker(mapDbFile, 24, 27, availableTotalSpace) .deleteFilesAfterClose() .commitFileSyncDisable() .cacheSize(1024) .transactionDisable() .mmapFileEnable(); this.factsDb = dbMaker.make(); if (sortFacts) { TimeAndDimsBTreeKeySerializer timeAndDimsSerializer = new TimeAndDimsBTreeKeySerializer(this); this.facts = factsDb.createTreeMap("__facts" + UUID.randomUUID()) .keySerializer(timeAndDimsSerializer) .comparator(timeAndDimsSerializer.getComparator()) .valueSerializer(Serializer.INTEGER) .make(); } else { this.facts = factsDb.createHashMap("__facts" + UUID.randomUUID()) .keySerializer(TimeAndDimsSerializer.INSTANCE) .valueSerializer(Serializer.INTEGER) .make(); } this.aggBBFactory = new DiskBBFactory(aggsBBFile, 27, availableTotalSpace); ByteBuffer bb = this.aggBBFactory.allocateBB(); if (bb.capacity() < aggsTotalSize) { throw new IAE("bufferPool buffers capacity must be >= [%s]", aggsTotalSize); } aggBuffers.add(bb); } catch (Exception ex) { FileUtils.deleteQuietly(tmpDirLocation); throw Throwables.propagate(ex); } }