cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject cassandra git commit: Remove maybeUpdateRowCache in favor of the equivalent invalidateCachedPartition
Date Thu, 14 Jan 2016 10:51:24 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk 5090afc7a -> 367dfd505


Remove maybeUpdateRowCache in favor of the equivalent invalidateCachedPartition

patch by slebresne; reviewed by jbellis for CASSANDRA-10396


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

Branch: refs/heads/trunk
Commit: 367dfd50558d2c5d09e778e3c2b2ba247302f707
Parents: 5090afc
Author: Sylvain Lebresne <sylvain@datastax.com>
Authored: Wed Jan 13 15:41:02 2016 +0100
Committer: Sylvain Lebresne <sylvain@datastax.com>
Committed: Thu Jan 14 11:49:53 2016 +0100

----------------------------------------------------------------------
 CHANGES.txt                                          |  1 +
 .../org/apache/cassandra/db/ColumnFamilyStore.java   | 15 +++------------
 2 files changed, 4 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/367dfd50/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 5acd12e..b2df9f7 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.4
+ * Simplify row cache invalidation code (CASSANDRA-10396)
  * Support user-defined compaction through nodetool (CASSANDRA-10660)
  * Stripe view locks by key and table ID to reduce contention (CASSANDRA-10981)
  * Add nodetool gettimeout and settimeout commands (CASSANDRA-10953)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/367dfd50/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
index 6eefb5f..af36164 100644
--- a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
+++ b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
@@ -1201,15 +1201,6 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
         return String.format("%.2f/%.2f", onHeap, offHeap);
     }
 
-    public void maybeUpdateRowCache(DecoratedKey key)
-    {
-        if (!isRowCacheEnabled())
-            return;
-
-        RowCacheKey cacheKey = new RowCacheKey(metadata.ksAndCFName, key);
-        invalidateCachedPartition(cacheKey);
-    }
-
     /**
      * Insert/Update the column family for this key.
      * Caller is responsible for acquiring Keyspace.switchLock
@@ -1224,7 +1215,7 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
         Memtable mt = data.getMemtableFor(opGroup, replayPosition);
         long timeDelta = mt.put(update, indexer, opGroup);
         DecoratedKey key = update.partitionKey();
-        maybeUpdateRowCache(key);
+        invalidateCachedPartition(key);
         metric.samplers.get(Sampler.WRITES).addSample(key.getKey(), key.hashCode(), 1);
         metric.writeLatency.addNano(System.nanoTime() - start);
         if(timeDelta < Long.MAX_VALUE)
@@ -1875,8 +1866,8 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
 
     public void invalidateCachedPartition(DecoratedKey key)
     {
-        if (!Schema.instance.hasCF(metadata.ksAndCFName))
-            return; //2i don't cache rows
+        if (!isRowCacheEnabled())
+            return;
 
         invalidateCachedPartition(new RowCacheKey(metadata.ksAndCFName, key));
     }


Mime
View raw message