jankotek / mapdb

MapDB provides concurrent Maps, Sets and Queues backed by disk storage or off-heap-memory. It is a fast and easy to use embedded Java database engine.
https://mapdb.org
Apache License 2.0
4.89k stars 873 forks source link

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

Open KrishnaST opened 2 years ago

KrishnaST commented 2 years ago

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 commented 2 years ago

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

KrishnaST commented 2 years ago

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