jankotek/JDBM3 — Issue #3: Error on calculateStatistics(). NPE on calculateStatistics() after close().
Author: terry239
Created: 2012-02-03 08:09:50+00:00
State: open

int size = 100000;
int commitSize = 100000;
DB build = new DBMaker("test.hash.dbm").setMRUCacheSize(100).build();
Map hashMap = build.createHashMap("hashMap");
for (int i = 0; i < size; i++) {
hashMap.put(i + "asdddfdgf" + i + "sddfdfsf" + i, "dsfgfg.dfcdfsgfg");
if (i % commitSize == 0) {
build.commit();
}
}
build.commit();
build.calculateStatistics()
build.close();

java.lang.Error: double get for block -1
at net.kotek.jdbm.RecordFile.get(RecordFile.java:138)
at net.kotek.jdbm.PageManager.getNext(PageManager.java:163)
at net.kotek.jdbm.DBStore.calculateStatistics(DBStore.java:678)
at net.kotek.jdbm.DBCache.calculateStatistics(DBCache.java:360)
at util.JDBMTest.testH(JDBMTest.java:52)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at com.intellij.junit3.JUnit3IdeaTestRunner.doRun(JUnit3IdeaTestRunner.java:139)
at com.intellij.junit3.JUnit3IdeaTestRunner.startRunnerWithArgs(JUnit3IdeaTestRunner.java:52)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:202)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)

int size = 100000;
int commitSize = 100000;
DB build = new DBMaker("test.hash.dbm").setMRUCacheSize(100).build();
Map hashMap = build.createHashMap("hashMap");
for (int i = 0; i < size; i++) {
hashMap.put(i + "asdddfdgf" + i + "sddfdfsf" + i, "dsfgfg.dfcdfsgfg");
if (i % commitSize == 0) {
build.commit();
}
}
build.commit();
build.close();

build.calculateStatistics()

java.lang.NullPointerException
at net.kotek.jdbm.DBCache.calculateStatistics(DBCache.java:360)