Skip to content

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 ieugen marked this pull request as draft April 1, 2023 03:29
@ieugen ieugen force-pushed the 109-map-interface branch from 08e7def to d643881 Compare April 1, 2023 06:07
@ieugen ieugen force-pushed the 109-map-interface branch from d643881 to 34aa184 Compare May 12, 2023 03:13
@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.

ieugen added 4 commits June 16, 2023 14:16
* implemented AutoCloseable close
* implemented Map clear, size, containsValue, isEmpty
* We need more infrastructure to test this
@ieugen ieugen force-pushed the 109-map-interface branch from dc7c141 to 24c427b Compare June 16, 2023 11:17
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