cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject [1/9] cassandra git commit: Follow-up CASSANDRA-12905: always return future on Keyspace.applyFuture
Date Wed, 04 Jan 2017 02:26:55 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-3.11 68f7ce440 -> cac7364e7
  refs/heads/cassandra-3.X 3f1a3b2f6 -> 04ee4ccb9
  refs/heads/trunk b137bd977 -> a8a43dd32


Follow-up CASSANDRA-12905: always return future on Keyspace.applyFuture

Before CASSANDRA-12905, applyFuture always returned a future, regardless of whether isDeferrable
was set or not.
This behavior should be maintained for applyFuture calls or compatibility method
Keyspace.apply(mutation, writeCommitlog, updateIndexes, isClReplay, isDeferrable, future).


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/37e124e8
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/37e124e8
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/37e124e8

Branch: refs/heads/cassandra-3.11
Commit: 37e124e81da28b6459c6e150fcd831a6cdab0537
Parents: 617bd23
Author: Paulo Motta <pauloricardomg@gmail.com>
Authored: Tue Jan 3 16:47:15 2017 -0200
Committer: Paulo Motta <paulo@apache.org>
Committed: Wed Jan 4 00:22:48 2017 -0200

----------------------------------------------------------------------
 src/java/org/apache/cassandra/db/Keyspace.java | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/37e124e8/src/java/org/apache/cassandra/db/Keyspace.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/Keyspace.java b/src/java/org/apache/cassandra/db/Keyspace.java
index 217cf54..7349f42 100644
--- a/src/java/org/apache/cassandra/db/Keyspace.java
+++ b/src/java/org/apache/cassandra/db/Keyspace.java
@@ -381,13 +381,13 @@ public class Keyspace
 
     public CompletableFuture<?> applyFuture(Mutation mutation, boolean writeCommitLog,
boolean updateIndexes)
     {
-        return applyInternal(mutation, writeCommitLog, updateIndexes, true, true, null);
+        return applyInternal(mutation, writeCommitLog, updateIndexes, true, true, new CompletableFuture<>());
     }
 
     public CompletableFuture<?> applyFuture(Mutation mutation, boolean writeCommitLog,
boolean updateIndexes, boolean isDroppable,
                                             boolean isDeferrable)
     {
-        return applyInternal(mutation, writeCommitLog, updateIndexes, isDroppable, isDeferrable,
null);
+        return applyInternal(mutation, writeCommitLog, updateIndexes, isDroppable, isDeferrable,
new CompletableFuture<>());
     }
 
     public void apply(Mutation mutation, boolean writeCommitLog, boolean updateIndexes)
@@ -433,7 +433,7 @@ public class Keyspace
                                        boolean isDeferrable,
                                        CompletableFuture<?> future)
     {
-        return applyInternal(mutation, writeCommitLog, updateIndexes, !isClReplay, isDeferrable,
future);
+        return applyInternal(mutation, writeCommitLog, updateIndexes, !isClReplay, isDeferrable,
future != null? future : new CompletableFuture<>());
     }
 
     /**
@@ -458,11 +458,6 @@ public class Keyspace
 
         boolean requiresViewUpdate = updateIndexes && viewManager.updatesAffectView(Collections.singleton(mutation),
false);
 
-        // If apply is not deferrable, no future is required, returns always null
-        if (isDeferrable && future == null) {
-            future = new CompletableFuture<>();
-        }
-
         Lock lock = null;
         if (requiresViewUpdate)
         {


Mime
View raw message