cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [2/5] git commit: use metadata.cfId instead of re-looking it up for each cache update
Date Wed, 15 Feb 2012 23:35:10 GMT
use metadata.cfId instead of re-looking it up for each cache update


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

Branch: refs/heads/cassandra-1.1
Commit: 33199c6ca21e7cceb358a971bfe047af22354768
Parents: b0c0fae
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Wed Feb 15 17:33:20 2012 -0600
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Wed Feb 15 17:34:10 2012 -0600

----------------------------------------------------------------------
 .../org/apache/cassandra/db/ColumnFamilyStore.java |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/33199c6c/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 e4e3204..92ae676 100644
--- a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
+++ b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
@@ -694,11 +694,10 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
 
     public void updateRowCache(DecoratedKey key, ColumnFamily columnFamily)
     {
-        Integer cfId = Schema.instance.getId(table.name, this.columnFamily);
-        if (cfId == null)
+        if (metadata.cfId == null)
             return; // secondary index
 
-        RowCacheKey cacheKey = new RowCacheKey(cfId, key);
+        RowCacheKey cacheKey = new RowCacheKey(metadata.cfId, key);
 
         if (CacheService.instance.rowCache.isPutCopying())
         {
@@ -1480,11 +1479,10 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
 
     public ColumnFamily getRawCachedRow(DecoratedKey key)
     {
-        Integer cfId = Schema.instance.getId(table.name, this.columnFamily);
-        if (cfId == null)
+        if (metadata.cfId == null)
             return null; // secondary index
 
-        return getRawCachedRow(new RowCacheKey(cfId, key));
+        return getRawCachedRow(new RowCacheKey(metadata.cfId, key));
     }
 
     public ColumnFamily getRawCachedRow(RowCacheKey key)


Mime
View raw message