MapDB list type?

997 Views Asked by At

I am using mapdb 3.0.7

I see various hash map and tree map storage types here.

But I have a use case that needs a List<String> to be persisted to mapdb.

Does this version of mapDB even support this?

2

There are 2 best solutions below

0
Nicholas DiPiazza On BEST ANSWER

MapDB does have a HashSet object which seems like all we have to work with.

See http://www.mapdb.org/javadoc/latest/mapdb/org/mapdb/DB.HashSetMaker.html

I don't think there is any List data structure in mapdb 3.x

1
Aleksey Ulasevich On

I am using mapdb 3.0.8:

DB db = DBMaker.fileDB(new File("base.mapdb")).closeOnJvmShutdown().make();
List<String> list = db.indexTreeList("some_list", Serializer.STRING).createOrOpen();