对于我们的一个项目,我使用 MapDB 作为持久键/值存储。我正在使用由文件支持的 HTreeMap,并且想知道如何在后台启用压缩。
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();
代码与上面不完全相同,但相似。有人可以让我知道我错过了什么吗?我根本没有看到文件被压缩。我错过了什么?
问候,-C