You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by pa...@apache.org on 2016/12/20 14:18:56 UTC
cassandra git commit: ninja #12905: reinstate Keyspace.apply(mutation,
writeCommitlog, updateIndexes, isClReplay, isDeferrable) for compatibility
Repository: cassandra
Updated Branches:
refs/heads/cassandra-3.0 194354d29 -> 13e939624
ninja #12905: reinstate Keyspace.apply(mutation, writeCommitlog, updateIndexes, isClReplay, isDeferrable) for compatibility
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/13e93962
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/13e93962
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/13e93962
Branch: refs/heads/cassandra-3.0
Commit: 13e939624d21eaf6e16d60b28636125e817ab286
Parents: 194354d
Author: Paulo Motta <pa...@gmail.com>
Authored: Mon Dec 19 18:15:55 2016 -0200
Committer: Paulo Motta <pa...@apache.org>
Committed: Tue Dec 20 12:13:36 2016 -0200
----------------------------------------------------------------------
src/java/org/apache/cassandra/db/Keyspace.java | 39 ++++++++++++++++-----
1 file changed, 30 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/13e93962/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 3715995..217cf54 100644
--- a/src/java/org/apache/cassandra/db/Keyspace.java
+++ b/src/java/org/apache/cassandra/db/Keyspace.java
@@ -381,7 +381,13 @@ public class Keyspace
public CompletableFuture<?> applyFuture(Mutation mutation, boolean writeCommitLog, boolean updateIndexes)
{
- return apply(mutation, writeCommitLog, updateIndexes, true, true, null);
+ return applyInternal(mutation, writeCommitLog, updateIndexes, true, true, null);
+ }
+
+ public CompletableFuture<?> applyFuture(Mutation mutation, boolean writeCommitLog, boolean updateIndexes, boolean isDroppable,
+ boolean isDeferrable)
+ {
+ return applyInternal(mutation, writeCommitLog, updateIndexes, isDroppable, isDeferrable, null);
}
public void apply(Mutation mutation, boolean writeCommitLog, boolean updateIndexes)
@@ -412,7 +418,22 @@ public class Keyspace
boolean updateIndexes,
boolean isDroppable)
{
- apply(mutation, writeCommitLog, updateIndexes, isDroppable, false, null);
+ applyInternal(mutation, writeCommitLog, updateIndexes, isDroppable, false, null);
+ }
+
+ /**
+ * Compatibility method that keeps <bold>isClReplay</bold> flag.
+ * @deprecated Use {@link this#applyFuture(Mutation, boolean, boolean, boolean, boolean)} instead
+ */
+ @Deprecated
+ public CompletableFuture<?> apply(final Mutation mutation,
+ final boolean writeCommitLog,
+ boolean updateIndexes,
+ boolean isClReplay,
+ boolean isDeferrable,
+ CompletableFuture<?> future)
+ {
+ return applyInternal(mutation, writeCommitLog, updateIndexes, !isClReplay, isDeferrable, future);
}
/**
@@ -425,12 +446,12 @@ public class Keyspace
* @param isDroppable true if this should throw WriteTimeoutException if it does not acquire lock within write_request_timeout_in_ms
* @param isDeferrable true if caller is not waiting for future to complete, so that future may be deferred
*/
- private CompletableFuture<?> apply(final Mutation mutation,
- final boolean writeCommitLog,
- boolean updateIndexes,
- boolean isDroppable,
- boolean isDeferrable,
- CompletableFuture<?> future)
+ private CompletableFuture<?> applyInternal(final Mutation mutation,
+ final boolean writeCommitLog,
+ boolean updateIndexes,
+ boolean isDroppable,
+ boolean isDeferrable,
+ CompletableFuture<?> future)
{
if (TEST_FAIL_WRITES && metadata.name.equals(TEST_FAIL_WRITES_KS))
throw new RuntimeException("Testing write failures");
@@ -476,7 +497,7 @@ public class Keyspace
// we will re-apply ourself to the queue and try again later
final CompletableFuture<?> mark = future;
StageManager.getStage(Stage.MUTATION).execute(() ->
- apply(mutation, writeCommitLog, true, isDroppable, true, mark)
+ applyInternal(mutation, writeCommitLog, true, isDroppable, true, mark)
);
return future;