-
Notifications
You must be signed in to change notification settings - Fork 472
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
JAMES-4071 - Task fix inconsistencies messagedeleted, mailboxRecents #2408
JAMES-4071 - Task fix inconsistencies messagedeleted, mailboxRecents #2408
Conversation
.../org/apache/james/mailbox/cassandra/mail/task/SolveMessageDeletedInconsistenciesService.java
Outdated
Show resolved
Hide resolved
...ava/org/apache/james/mailbox/cassandra/mail/task/SolveMessageDeletedInconsistenciesTask.java
Outdated
Show resolved
Hide resolved
...est/java/org/apache/james/webadmin/integration/rabbitmq/ConsistencyTasksIntegrationTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall good to me but it misses some sorts of tests
506a493
to
c8a0560
Compare
c8a0560
to
0ffef2c
Compare
08:54:41,418 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:3.3.0:check (check-style) on project apache-james-mailbox-cassandra: You have 1 Checkstyle violation. -> [Help 1] |
09:42:22,092 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:3.3.0:check (check-style) on project rabbitmq-webadmin-integration-test: You have 2 Checkstyle violations. -> [Help 1] Please check your checkstyle globally |
.../org/apache/james/mailbox/cassandra/mail/task/SolveMessageDeletedInconsistenciesService.java
Outdated
Show resolved
Hide resolved
.../org/apache/james/mailbox/cassandra/mail/task/SolveMessageDeletedInconsistenciesService.java
Outdated
Show resolved
Hide resolved
...a/org/apache/james/mailbox/cassandra/mail/task/SolveMessageRecentInconsistenciesService.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a general comment I feel uneasy with the amount of code duplication.
I wonder if the verbosity of this PR could be reduced by "sharing" the task layer.
That is:
- Keep 2 RequestToTask as today
- Keep 2 'service' as today
- Find a more generic name for the task like
SolveMailboxFlagDenormalisationTask
- Have a Type enum sayng if SolveMailboxFlagDenormalisationTask shall fix Recent
or
Deleted - Based on this enum field the task can choose the right service
- And the webadmin layer just passes the right value downstream...
I counted, this alone could spare ~260 lines of code.
Perhaps even the service layer could be shared:
- if the two DAO implement the same interface to add, deleteAll entries
- then it would be straight foward to choose the DAO and the messageFilter based on the mode, sparing ~70 lines more
I tried with this way, but got an stuck with Task Serialize // The same issue with |
I do not understand with 1 task you are supposed to get only one dto module? |
yes, |
b5a0574
to
8b558ed
Compare
...ava/org/apache/james/mailbox/cassandra/mail/task/SolveMailboxFlagInconsistenciesService.java
Outdated
Show resolved
Hide resolved
...ava/org/apache/james/mailbox/cassandra/mail/task/SolveMailboxFlagInconsistenciesService.java
Outdated
Show resolved
Hide resolved
...ava/org/apache/james/mailbox/cassandra/mail/task/SolveMailboxFlagInconsistenciesTaskDTO.java
Outdated
Show resolved
Hide resolved
...r/guice/cassandra/src/main/java/org/apache/james/modules/MailboxFlagInconsistencyModule.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
1e791f0
to
e4d3cad
Compare
rebase master & squash fixup |
resolve linagora#5235
Jira: https://issues.apache.org/jira/browse/JAMES-4071