For one of our projects, I'm using MapDB as a persistent Key/Value store. I'm using HTreeMap backed by a file and would like to know how I can enable compaction in the background.
final DB mapDB = DBMaker.fileDB(...).transactionEnable().executorEnable().closeOnJvmShutdown().make();
final HTreeMap<> itemsMap = mapDB.hashMap(..., Serializer.STRING,
custom_serializer).expireExecutor(
Executors.newScheduledThreadPool(3)).expireCompactThreshold(
0.4).counterEnable().createOrOpen();
The code is not exactly same as above, but similar. Can someone let me know what I'm missing? I don't see the file getting compacted at all. What is that I'm missing?
Regards, -C