mapdb
mapdb copied to clipboard
Data in FileDB will not expired, so that the usage of disk space can't be limited
I have a similar issue. Even for memory DB expire does not work for 3.0.8:
@Test
public void testExpiration() throws InterruptedException {
HTreeMap<String, String> map = (HTreeMap<String, String>) DBMaker
// .fileDB("map").fileDeleteAfterClose()
.memoryDB()
.make().hashMap("map")
.expireAfterCreate(10)
.createOrOpen();
map.put("a", "b");
Thread.sleep(4000);
assertNull(map.get("a"));
map.close();
}