You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by bt...@apache.org on 2021/04/08 03:57:02 UTC
[james-project] 12/12: JAMES-3435 test for mailbox.read.strong.cst
This is an automated email from the ASF dual-hosted git repository.
btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git
commit 4619763a6641a5621991ac28e2ce7b0cc38e1f49
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Mon Mar 29 09:33:06 2021 +0700
JAMES-3435 test for mailbox.read.strong.cst
---
.../init/configuration/CassandraConfiguration.java | 6 +++++-
.../mail/CassandraMailboxMapperGenericTest.java | 23 ++++++++++++++++++++++
2 files changed, 28 insertions(+), 1 deletion(-)
diff --git a/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/configuration/CassandraConfiguration.java b/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/configuration/CassandraConfiguration.java
index 41284c7..0519b13 100644
--- a/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/configuration/CassandraConfiguration.java
+++ b/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/configuration/CassandraConfiguration.java
@@ -535,8 +535,10 @@ public class CassandraConfiguration {
&& Objects.equals(this.fetchNextPageInAdvanceRow, that.fetchNextPageInAdvanceRow)
&& Objects.equals(this.blobPartSize, that.blobPartSize)
&& Objects.equals(this.attachmentV2MigrationReadTimeout, that.attachmentV2MigrationReadTimeout)
+ && Objects.equals(this.mailboxReadStrongConsistency, that.mailboxReadStrongConsistency)
&& Objects.equals(this.messageAttachmentIdsReadTimeout, that.messageAttachmentIdsReadTimeout)
&& Objects.equals(this.messageReadStrongConsistency, that.messageReadStrongConsistency)
+ && Objects.equals(this.messageWriteStrongConsistency, that.messageWriteStrongConsistency)
&& Objects.equals(this.consistencyLevelRegular, that.consistencyLevelRegular)
&& Objects.equals(this.consistencyLevelLightweightTransaction, that.consistencyLevelLightweightTransaction);
}
@@ -550,7 +552,7 @@ public class CassandraConfiguration {
mailboxCountersReadRepairChanceOneHundred, mailboxCountersReadRepairChanceMax,
blobPartSize, attachmentV2MigrationReadTimeout, messageAttachmentIdsReadTimeout,
consistencyLevelRegular, consistencyLevelLightweightTransaction, mailboxReadRepair,
- messageReadStrongConsistency);
+ messageReadStrongConsistency, mailboxReadStrongConsistency, messageWriteStrongConsistency);
}
@Override
@@ -571,6 +573,8 @@ public class CassandraConfiguration {
.add("attachmentV2MigrationReadTimeout", attachmentV2MigrationReadTimeout)
.add("messageAttachmentIdsReadTimeout", messageAttachmentIdsReadTimeout)
.add("messageReadStrongConsistency", messageReadStrongConsistency)
+ .add("messageWriteStrongConsistency", messageWriteStrongConsistency)
+ .add("mailboxReadStrongConsistency", mailboxReadStrongConsistency)
.add("consistencyLevelRegular", consistencyLevelRegular)
.add("consistencyLevelLightweightTransaction", consistencyLevelLightweightTransaction)
.toString();
diff --git a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxMapperGenericTest.java b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxMapperGenericTest.java
index 04ca6aa..b5177db 100644
--- a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxMapperGenericTest.java
+++ b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxMapperGenericTest.java
@@ -21,12 +21,14 @@ package org.apache.james.mailbox.cassandra.mail;
import org.apache.james.backends.cassandra.CassandraClusterExtension;
import org.apache.james.backends.cassandra.components.CassandraModule;
+import org.apache.james.backends.cassandra.init.configuration.CassandraConfiguration;
import org.apache.james.backends.cassandra.versions.CassandraSchemaVersionDAO;
import org.apache.james.backends.cassandra.versions.CassandraSchemaVersionModule;
import org.apache.james.backends.cassandra.versions.SchemaVersion;
import org.apache.james.blob.cassandra.CassandraBlobModule;
import org.apache.james.eventsourcing.eventstore.cassandra.CassandraEventStoreModule;
import org.apache.james.mailbox.cassandra.ids.CassandraId;
+import org.apache.james.mailbox.cassandra.ids.CassandraMessageId;
import org.apache.james.mailbox.cassandra.mail.utils.GuiceUtils;
import org.apache.james.mailbox.cassandra.modules.CassandraAclModule;
import org.apache.james.mailbox.cassandra.modules.CassandraMailboxModule;
@@ -98,4 +100,25 @@ class CassandraMailboxMapperGenericTest {
return CassandraId.timeBased();
}
}
+
+ @Nested
+ class V10RelaxedConsistency extends MailboxMapperTest {
+ @Override
+ protected MailboxMapper createMailboxMapper() {
+ new CassandraSchemaVersionDAO(cassandraCluster.getCassandraCluster().getConf())
+ .updateVersion(new SchemaVersion(10))
+ .block();
+ return GuiceUtils.testInjector(cassandraCluster.getCassandraCluster().getConf(),
+ cassandraCluster.getCassandraCluster().getTypesProvider(), new CassandraMessageId.Factory(),
+ CassandraConfiguration.builder()
+ .mailboxReadStrongConsistency(false)
+ .build())
+ .getInstance(CassandraMailboxMapper.class);
+ }
+
+ @Override
+ protected MailboxId generateId() {
+ return CassandraId.timeBased();
+ }
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org