yahoo / Oak

A Scalable Concurrent Key-Value Map for Big Data Analytics
Apache License 2.0
268 stars 48 forks source link

Can I use one OakMapBuilder to create more than one OakMap? #194

Closed fujian-zfj closed 2 years ago

fujian-zfj commented 2 years ago
    OakMapBuilder<Long, AckData> oakMapBuilder = new OakMapBuilder<>(new OakLongComparator(),
        new OakLongSerializer(), new OakAckDataSerializer(), Long.MIN_VALUE).setMemoryCapacity(MEBIBYTE);
    for (int i = 0; i < 1000; i ++) {
        OakMap<Long, AckData> oakMap = oakMapBuilder.buildOrderedMap();
    }

image

And If I use one OakMapBuilder to create more than one OakMap in multi-threaded process, NativeMemoryAllocator will be Instantiated multiple times.

liran-funaro commented 2 years ago

Thanks for finding this issue. PR #196 addresses this issue.