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

JAMES-3266 Offer an option to disable ElasticSearch in Distributed James product #3425

Closed
wants to merge 5 commits into from

Conversation

chibenwa
Copy link
Member

@chibenwa chibenwa commented Jun 4, 2020

No description provided.

@chibenwa chibenwa added the POC Proof of Concept. Feedback is welcomed but don't expect high code quality... label Jun 4, 2020
@chibenwa chibenwa added this to the Polish 2020-06 milestone Jun 4, 2020
@chibenwa chibenwa self-assigned this Jun 4, 2020
@chibenwa
Copy link
Member Author

chibenwa commented Jun 4, 2020

test this please

@chibenwa
Copy link
Member Author

chibenwa commented Jun 5, 2020


[24c824870006ef81b1843e13306d8a7a30bbd047] [ERROR]   ESReporterTest.timeMetricsShouldBeReportedWhenImapCommandsReceived:129 » ConditionTimeout
[24c824870006ef81b1843e13306d8a7a30bbd047] [ERROR]   ESReporterTest.timeMetricsShouldBeReportedWhenJmapRequestsReceived:151 » ConditionTimeout

@ieugen
Copy link

ieugen commented Jun 23, 2020

We are working on documentation and every feature should be documented.
Could you please add some documentation on how to use this feature?

Some questions and hints, take them or leave them:

  • The documentation should be about how to configure IMAP, IMAP search in James
  • Is this feature meant for an administrator or a developer?
  • What are the steps that I have to take to OPT-IN or OPT-OUT of this feature
  • You could focus just on this one and we will add the others in time.

@chibenwa
Copy link
Member Author

This is meaningful, I'll handle these documentation topics.

@rouazana rouazana changed the title POC Offer an option to disable ElasticSearch in Distributed James pro… Offer an option to disable ElasticSearch in Distributed James product Jun 23, 2020
@chibenwa
Copy link
Member Author

Unrelated

test this please

1 similar comment
@chibenwa
Copy link
Member Author

Unrelated

test this please

@chibenwa chibenwa changed the title Offer an option to disable ElasticSearch in Distributed James product JAMES-3266 Offer an option to disable ElasticSearch in Distributed James product Jun 24, 2020
@chibenwa chibenwa removed the POC Proof of Concept. Feedback is welcomed but don't expect high code quality... label Jun 24, 2020
@chibenwa
Copy link
Member Author

[76fd1a1] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project james-server-mailets-integration-testing: There was a timeout or other error in the fork -> [Help 1]

test this please

Copy link

@mbaechler mbaechler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this PR deserves some more love before integrating it.

import com.github.fge.lambdas.Throwing;

public class CassandraJamesServerConfiguration implements Configuration {
public static class Builder {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks like a copy/paste of existing code. Why do we have to do that? I don't care about duplicating methods but there's some logic too that could be delegated to another object, right?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I make a simple refactor here, please take a look
nvduc91@1d3078f

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do have a different proposal #3531

@@ -167,7 +160,7 @@
);

public static void main(String[] args) throws Exception {
Configuration configuration = Configuration.builder()
CassandraJamesServerConfiguration configuration = CassandraJamesServerConfiguration.builder()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How CassandraJamesServerConfiguration is different from Configuration?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need an explanation here.

Are you asking for...

Configuration configuration = CassandraJamesServerConfiguration.builder()
    ...

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry but I asked a question that is quite simple: we create a class B that is very similar to what we did with class A so I ask what is the difference between A and B.
You ask me if I want A a = B.builder()....build() but I have no idea, how does it relate to me initial question?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It differs from the module choices offered

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, so we may choose a naming pattern (and maybe some javadoc) that allow to discover which Configuration type one need. Could it be an inner class of the server we want to instantiate? I think that would make it more discoverable.

}

static SearchConfiguration from(Configuration configuration) {
if (configuration.getBoolean("enabled", true)) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This configuration looks really bad to me: to have scanning search we have to go to elasticsearch configuration and disable it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please propose an alternative.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

like that #3425 (comment) ? Did you read my comments before asking ?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i dont understand why i must disabled ES to get scanning?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

either you get scanning, either ES. Scanning is not backed at all by ES.

switch (searchConfiguration.getImplementation()) {
case ElasticSearch:
return ImmutableList.of(
new ElasticSearchClientModule(),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't we have a single module for each implementation?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, we can create a meta module

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we agree on that or not?

import org.junit.jupiter.api.extension.ExtendWith;

@ExtendWith(WithScanningSearchExtension.class)
class WithScanningSearchTest implements JmapJamesServerContract, MailsShouldBeWellReceived, JamesServerContract {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how much time it adds to the testsuite?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not much. Containers are already started, tables populated. Around a minute.

src/site/xdoc/server/config-elasticsearch.xml Outdated Show resolved Hide resolved
@chibenwa chibenwa linked an issue Jun 29, 2020 that may be closed by this pull request
src/site/xdoc/server/config-elasticsearch.xml Outdated Show resolved Hide resolved
src/site/xdoc/server/config-elasticsearch.xml Outdated Show resolved Hide resolved
@chibenwa
Copy link
Member Author

chibenwa commented Jul 3, 2020


[964dc38bcbe1e256c18501705e8044763660c538] [ERROR]   RabbitMQDeletedMessageVaultIntegrationTest>DeletedMessageVaultIntegrationTest.vaultExportShouldExportZipContainsVaultMessagesToShareeWhenImapDeletedMailbox:543 
[964dc38bcbe1e256c18501705e8044763660c538] Expecting zipFile to contains 1 entries but actually contains (0) entries

Co-authored-by: Raphaël Ouazana <rouazana@linagora.com>
Copy link
Member Author

@chibenwa chibenwa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@chibenwa
Copy link
Member Author

chibenwa commented Jul 9, 2020

RabbitMQDeletedMessageVaultIntegrationTest>DeletedMessageVaultIntegrationTest.vaultExportShouldExportZipContainsVaultMessagesToShareeWhenImapDeletedMailbox:543 
[f64e4486b7bf41e2acdd510ea4fcdd850ca27bef] Expecting zipFile to contains 1 entries but actually contains (0) entries

test this please

@rouazana
Copy link

rouazana commented Jul 9, 2020

[f64e4486b7bf41e2acdd510ea4fcdd850ca27bef] [ERROR] Failures: 
[f64e4486b7bf41e2acdd510ea4fcdd850ca27bef] [ERROR]   RecomputeUserFastViewProjectionItemsRequestToTaskTest.postShouldFailUponBadUsername:247 1 expectation failed.
[f64e4486b7bf41e2acdd510ea4fcdd850ca27bef] JSON path details doesn't match.
[f64e4486b7bf41e2acdd510ea4fcdd850ca27bef] Expected: is "The username should not contain multiple domain delimiter."
[f64e4486b7bf41e2acdd510ea4fcdd850ca27bef]   Actual: The username should not contain multiple domain delimiter. Value: bad@bad@bad

strange, master is broken or merge issue?

test this please

@Arsnael
Copy link
Member

Arsnael commented Jul 9, 2020

[f64e4486b7bf41e2acdd510ea4fcdd850ca27bef] [ERROR] Failures: 
[f64e4486b7bf41e2acdd510ea4fcdd850ca27bef] [ERROR]   RecomputeUserFastViewProjectionItemsRequestToTaskTest.postShouldFailUponBadUsername:247 1 expectation failed.
[f64e4486b7bf41e2acdd510ea4fcdd850ca27bef] JSON path details doesn't match.
[f64e4486b7bf41e2acdd510ea4fcdd850ca27bef] Expected: is "The username should not contain multiple domain delimiter."
[f64e4486b7bf41e2acdd510ea4fcdd850ca27bef]   Actual: The username should not contain multiple domain delimiter. Value: bad@bad@bad

strange, master is broken or merge issue?

Possibly a merge issue I think. Let me check

@Arsnael
Copy link
Member

Arsnael commented Jul 9, 2020

=> #3565

@chibenwa
Copy link
Member Author

test this please

@chibenwa chibenwa added the waiting_merge We are about to merge this! label Jul 15, 2020
@Arsnael
Copy link
Member

Arsnael commented Jul 15, 2020

Merged

@Arsnael Arsnael closed this Jul 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting_merge We are about to merge this!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Distributed James: Disable ElasticSearch
6 participants