Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#109] Exploratory work for providing map interface on top of datalevin #200

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ieugen
Copy link
Contributor

@ieugen ieugen commented Apr 1, 2023

This is exploratory work.
So far it can live outside datalevin.

Once it's fully implemented, I think it should be part of datalevin because it can be plugged in into existing API's that support Map.

It can also provide a way for users to use datalevin with an API that is familiar with them - java.util.Map (opinion).
Will see how it evolves over time, planning to use it in some private code.

It can also serve as an example on how to implement some functionality on top of datalevin.
For example, I don't know yet how to implement clear, size, values methods on top of LMDB/datalevin.

Fixes #109

@ieugen
Copy link
Contributor Author

ieugen commented May 13, 2023

I have added code to test the map implementation using guava collection test.
I have added a single test for now that has a lot of failures caused by features not implemented yet.

For guava test cases CollectionSize/ANY we get:

 {:was-successful false, :run-count 661, :fail+error 563, :error-count 508, :failure-count 55}

There are a lot of more tests to run and for more data-types.
Right now we test for Map of String keys and String values .

                       MapFeature/GENERAL_PURPOSE,
                       MapFeature/ALLOWS_NULL_KEYS,
                       MapFeature/ALLOWS_NULL_VALUES,
                       MapFeature/ALLOWS_NULL_ENTRY_QUERIES,
                       CollectionFeature/SUPPORTS_ITERATOR_REMOVE

Things are shaping up nicely @huahaiy :)
Perhaps we can test some of datalevin iterators implementation using guava testlib.

* implemented AutoCloseable close
* implemented Map clear, size, containsValue, isEmpty
* We need more infrastructure to test this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide map interface for kv store - clojure.lang.IPersistentMap or java.util.Map ?!
1 participant