james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adup...@apache.org
Subject [21/41] james-project git commit: JAMES-2082 Improve V1ToV2Migration naming
Date Mon, 10 Jul 2017 17:54:33 GMT
JAMES-2082 Improve V1ToV2Migration naming


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/17ed1d46
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/17ed1d46
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/17ed1d46

Branch: refs/heads/master
Commit: 17ed1d46e4d1d2d2604ea4437ba29a3cac4855e7
Parents: e5a1a35
Author: benwa <btellier@linagora.com>
Authored: Fri Jul 7 08:06:29 2017 +0700
Committer: Antoine Duprat <aduprat@linagora.com>
Committed: Mon Jul 10 14:23:57 2017 +0200

----------------------------------------------------------------------
 .../james/mailbox/cassandra/mail/CassandraMessageIdMapper.java   | 2 +-
 .../james/mailbox/cassandra/mail/CassandraMessageMapper.java     | 2 +-
 .../james/mailbox/cassandra/mail/migration/V1ToV2Migration.java  | 2 +-
 .../mailbox/cassandra/mail/migration/V1ToV2MigrationTest.java    | 4 ++--
 4 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/17ed1d46/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageIdMapper.java
----------------------------------------------------------------------
diff --git a/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageIdMapper.java
b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageIdMapper.java
index 1d554f4..479f43f 100644
--- a/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageIdMapper.java
+++ b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageIdMapper.java
@@ -115,7 +115,7 @@ public class CassandraMessageIdMapper implements MessageIdMapper {
             retrieveMessages(FetchType fetchType, ImmutableList<ComposedMessageIdWithMetaData>
composedMessageIds) {
 
         return FluentFutureStream.of(messageDAOV2.retrieveMessages(composedMessageIds, fetchType,
Limit.unlimited()))
-            .thenComposeOnAll(v1ToV2Migration::moveFromV1toV2)
+            .thenComposeOnAll(v1ToV2Migration::getFromV2orElseFromV1AfterMigration)
             .completableFuture();
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/17ed1d46/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageMapper.java
----------------------------------------------------------------------
diff --git a/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageMapper.java
b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageMapper.java
index 9ce7d41..3ed7842 100644
--- a/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageMapper.java
+++ b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageMapper.java
@@ -239,7 +239,7 @@ public class CassandraMessageMapper implements MessageMapper {
         List<ComposedMessageIdWithMetaData> messageIds, FetchType fetchType, Limit
limit) {
 
         return FluentFutureStream.of(messageDAOV2.retrieveMessages(messageIds, fetchType,
limit))
-            .thenComposeOnAll(v1ToV2Migration::moveFromV1toV2)
+            .thenComposeOnAll(v1ToV2Migration::getFromV2orElseFromV1AfterMigration)
             .completableFuture();
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/17ed1d46/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/migration/V1ToV2Migration.java
----------------------------------------------------------------------
diff --git a/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/migration/V1ToV2Migration.java
b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/migration/V1ToV2Migration.java
index 30b93cb..0a4463e 100644
--- a/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/migration/V1ToV2Migration.java
+++ b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/migration/V1ToV2Migration.java
@@ -58,7 +58,7 @@ public class V1ToV2Migration {
     }
 
     public CompletableFuture<Pair<MessageWithoutAttachment, Stream<MessageAttachmentRepresentation>>>
-            moveFromV1toV2(CassandraMessageDAOV2.MessageResult result) {
+            getFromV2orElseFromV1AfterMigration(CassandraMessageDAOV2.MessageResult result)
{
 
         if (result.isFound()) {
             return CompletableFuture.completedFuture(result.message());

http://git-wip-us.apache.org/repos/asf/james-project/blob/17ed1d46/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/migration/V1ToV2MigrationTest.java
----------------------------------------------------------------------
diff --git a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/migration/V1ToV2MigrationTest.java
b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/migration/V1ToV2MigrationTest.java
index 0f1f9d1..96b2f95 100644
--- a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/migration/V1ToV2MigrationTest.java
+++ b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/migration/V1ToV2MigrationTest.java
@@ -140,7 +140,7 @@ public class V1ToV2MigrationTest {
             new PropertyBuilder(), ImmutableList.of());
         messageDAOV1.save(originalMessage).join();
 
-        testee.moveFromV1toV2(CassandraMessageDAOV2.notFound(metaData)).join();
+        testee.getFromV2orElseFromV1AfterMigration(CassandraMessageDAOV2.notFound(metaData)).join();
 
         Optional<CassandraMessageDAOV2.MessageResult> messageResult = messageDAOV2.retrieveMessages(metaDataList,
MessageMapper.FetchType.Full, Limit.unlimited())
             .join()
@@ -162,7 +162,7 @@ public class V1ToV2MigrationTest {
 
         messageDAOV1.save(originalMessage).join();
 
-        testee.moveFromV1toV2(CassandraMessageDAOV2.notFound(metaData)).join();
+        testee.getFromV2orElseFromV1AfterMigration(CassandraMessageDAOV2.notFound(metaData)).join();
 
         Optional<CassandraMessageDAOV2.MessageResult> messageResult = messageDAOV2.retrieveMessages(metaDataList,
MessageMapper.FetchType.Full, Limit.unlimited())
             .join()


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message