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

Support for partial ordering/comparableKey in Java #188

Closed
simerplaha opened this issue Feb 3, 2020 · 0 comments
Closed

Support for partial ordering/comparableKey in Java #188

simerplaha opened this issue Feb 3, 2020 · 0 comments
Labels
feature java For Java API

Comments

@simerplaha
Copy link
Owner

simerplaha commented Feb 3, 2020

On Scala side the KeyOrder type requires comparableKey which is used to index partially order keys. This is currently not available in Java. See test SwayDBPartialSetSpec to see how partial ordering is used.

Partial ordering basically allows fetching a key and value by giving it a partial key.

Suppose the type of key is

case class User(username: String, email: Option[String])

and a database entry exists for

User("user1", Some("email@email.com"))

then

db.getKey(User("user1", None))

would return the full key with the email Some("email@email.com") populated.

On Java side Comparator is used (See MapTest) which should be replaced with another interface JavaKeyOrder (similar to Scala's KeyOrder) to allow for comparableKey implementation.

@simerplaha simerplaha added java For Java API feature labels Feb 3, 2020
@simerplaha simerplaha changed the title Support for partial ordering/indexableKey in Java Support for partial ordering/comparableKey in Java Feb 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature java For Java API
Projects
None yet
Development

No branches or pull requests

1 participant