Oak icon indicating copy to clipboard operation
Oak copied to clipboard

OakHash API

Open sanastas opened this issue 4 years ago • 1 comments

Add design and implementation of new OakHash API. API only, without the underlying HashMap. Probably the merge can go into a separate branch.

Similar to OakMap, OakHash should be extending ConcurrentHashMap, but must also support Zero-Copy API methods. Most likely new ZeroCopyHash should extand or be similar to ZeroCopyMap. And OakHash should return ZeroCopyHash, having all interfaces.

For more explanations feel free to add questions in this issue.

sanastas avatar Mar 02 '21 09:03 sanastas

OakMap implements (the majority of) ConcurrentNavigableMap<K, V>, respectively new OakHash should implement ConcurrentHashMap<K,V> also possibly not fully.

However, via

/* ------ Zero-Copy API methods  ------ */

    public ZeroCopyMap<K, V> zc() {
        return new OakZeroCopyMap<>(this);
    }

OakMap supports the ZeroCopyMap interface of itself. Also respectively, the new ZeroCopyHash is required and needs to be tailored.

sanastas avatar Apr 20 '21 07:04 sanastas