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

Cassandra implement for CustomIdentityDAO #4424

Closed
quantranhong1999 opened this issue Nov 8, 2021 · 7 comments · Fixed by apache/james-project#747
Closed

Cassandra implement for CustomIdentityDAO #4424

quantranhong1999 opened this issue Nov 8, 2021 · 7 comments · Fixed by apache/james-project#747
Assignees
Milestone

Comments

@quantranhong1999
Copy link
Member

quantranhong1999 commented Nov 8, 2021

Why

This is Cassandra's implementation for CustomIdentityDAO.

Requires

How

  • Create a user defined type for email address: email_address(name TEXT, email TEXT)
  • Create CassandraIdentityModule with table structure:
PK user TEXT
CK identity_id UUID
C name TEXT
C email TEXT
C replyTo set<email_address>
C bcc frozen set<email_address>
C textSignature TEXT
C htmlSignature TEXT
C mayDelete BOOLEAN
  • Create CassandraCustomIdentityDAO that implement CustomIdentityDAO

DoD

Write test implement the contract and pass all test cases

@quantranhong1999 quantranhong1999 added this to the Sprint #16 milestone Nov 8, 2021
@chibenwa
Copy link
Member

chibenwa commented Nov 9, 2021

set<TEXT> => frozen<set<TEXT>> we do not need to update individual elements, let's not pay the (expensive) cost of mutable collections in Cassandra...

@chibenwa
Copy link
Member

chibenwa commented Nov 9, 2021

Mono<Identity> selectOne(Username username, IdentityId id); ?

@chibenwa
Copy link
Member

chibenwa commented Nov 9, 2021

Also we should avoid leaking Mono/Flux usage in API interfaces. Please favor Publisher.

@quantranhong1999 quantranhong1999 changed the title Cassandra implement for IdentityRepository Cassandra implement for CustomIdentityDAO Nov 11, 2021
@quantranhong1999
Copy link
Member Author

I changed to

C replyTo frozen map(<TEXT>, <TEXT>)
C bcc frozen map(<TEXT>, <TEXT>)

cause EmailAddress contains 2 fields

@chibenwa
Copy link
Member

cause EmailAddress contains 2 fields

Please use a (frozen) user defined type instead (set of a user defined type if need be.)

@quantranhong1999
Copy link
Member Author

Please use a (frozen) user defined type instead (set of a user defined type if need be.)

Can you tell me more about this? I am having class and can not inspect the code for more information now :')

@chibenwa
Copy link
Member

Sure.

    1. You need to build a type using CassandraModule. Eg: CassandraMailboxModule
    1. Use the (frozen) type in your table definition. Note that you can do (frozen) collections of (frozen) types. Eg: CassandraMailboxModule still...
    1. You can work with your user defined type using CassandraTypesProvider class. A good example of this could be CassandraMailboxDAO + MailboxBaseTupleUtil.

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 a pull request may close this issue.

2 participants