mapdb icon indicating copy to clipboard operation
mapdb copied to clipboard

"ArrayIndexOutOfBoundsException: Index 26 out of bounds for length 26" on calling getSize()

Open KrishnaST opened this issue 4 years ago • 2 comments

Mapdb Version : 3.0.8

DB db  = DBMaker.fileDB(new File("ini/advicedb.db")).make();
HTreeMap<?, ?> map = db.hashMap("myMap").open();
System.out.println(map.getSize());

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 26 out of bounds for length 26
	at org.mapdb.DataInput2$ByteArray.unpackLongArray(DataInput2.java:200)
	at org.mapdb.IndexTreeListJava$1.deserialize(IndexTreeListJava.java:64)
	at org.mapdb.IndexTreeListJava$1.deserialize(IndexTreeListJava.java:16)
	at org.mapdb.StoreDirectAbstract.deserialize(StoreDirectAbstract.kt:229)
	at org.mapdb.StoreDirect.get(StoreDirect.kt:546)
	at org.mapdb.IndexTreeListJava.treeFold(IndexTreeListJava.java:594)
	at org.mapdb.IndexTreeListJava.treeFold(IndexTreeListJava.java:604)
	at org.mapdb.IndexTreeListJava.treeFold(IndexTreeListJava.java:604)
	at org.mapdb.IndexTreeLongLongMap.forEachKeyValue(IndexTreeLongLongMap.kt:452)
	at org.mapdb.HTreeMap.sizeLong(HTreeMap.kt:712)
	at org.mapdb.HTreeMap.getSize(HTreeMap.kt:701)
	at com.sil.maximus.matm.Test.main(Test.java:16)


KrishnaST avatar Oct 10 '21 10:10 KrishnaST

I am able to retrieve data while iterating over map. How do i retrieve rest of data?

KrishnaST avatar Oct 10 '21 10:10 KrishnaST

possible duplicate https://github.com/jankotek/mapdb/issues/948#issue-459451524

KrishnaST avatar Oct 10 '21 12:10 KrishnaST