cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xe...@apache.org
Subject git commit: respect not only row cache capacity but caching mode when trying to read data patch by Yuki Morishita; reviewed by Pavel Yaskevich for CASSANDRA-3812
Date Mon, 30 Jan 2012 23:44:32 GMT
Updated Branches:
  refs/heads/trunk d4f205157 -> 3d55a2b03


respect not only row cache capacity but caching mode when trying to read data
patch by Yuki Morishita; reviewed by Pavel Yaskevich for CASSANDRA-3812


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

Branch: refs/heads/trunk
Commit: 3d55a2b033ee7c7333230af5ef7c83b44bd8c8f7
Parents: d4f2051
Author: Pavel Yaskevich <xedin@apache.org>
Authored: Tue Jan 31 02:37:59 2012 +0200
Committer: Pavel Yaskevich <xedin@apache.org>
Committed: Tue Jan 31 02:43:22 2012 +0200

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


http://git-wip-us.apache.org/repos/asf/cassandra/blob/3d55a2b0/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index eec1583..e1fca0c 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -62,6 +62,8 @@
  * Avoids over-paging during get_count (CASSANDRA-3798)
  * Add new command to rebuild a node without (repair) merkle tree calculations
    (CASSANDRA-3483)
+ * respect not only row cache capacity but caching mode when
+   trying to read data (CASSANDRA-3812)
 
 
 1.0.8

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3d55a2b0/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 6ec9c51..65d7c60 100644
--- a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
+++ b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
@@ -1046,9 +1046,8 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
     public ColumnFamily cacheRow(Integer cfId, DecoratedKey decoratedKey)
     {
         CFMetaData.Caching caching = metadata.getCaching();
-
-        if (caching == CFMetaData.Caching.NONE || caching == CFMetaData.Caching.KEYS_ONLY)
-            return null;
+        assert caching == CFMetaData.Caching.ALL || caching == CFMetaData.Caching.ROWS_ONLY
+                : String.format("Row cache is not enabled on column family [" + getColumnFamilyName()
+ "]");
 
         RowCacheKey key = new RowCacheKey(cfId, decoratedKey);
 
@@ -1078,7 +1077,10 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
         long start = System.nanoTime();
         try
         {
-            if (CacheService.instance.rowCache.getCapacity() == 0)
+            CFMetaData.Caching caching = metadata.getCaching();
+            if (caching == CFMetaData.Caching.NONE
+                || caching == CFMetaData.Caching.KEYS_ONLY
+                || CacheService.instance.rowCache.getCapacity() == 0)
             {
                 ColumnFamily cf = getTopLevelColumns(filter, gcBefore, false);
 


Mime
View raw message