cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1002723 - in /cassandra/trunk: ./ interface/thrift/gen-java/org/apache/cassandra/thrift/ src/java/org/apache/cassandra/db/ src/java/org/apache/cassandra/service/ test/unit/org/apache/cassandra/db/
Date Wed, 29 Sep 2010 16:33:46 GMT
Author: jbellis
Date: Wed Sep 29 16:33:46 2010
New Revision: 1002723

URL: http://svn.apache.org/viewvc?rev=1002723&view=rev
Log:
merge from 0.6

Modified:
    cassandra/trunk/   (props changed)
    cassandra/trunk/CHANGES.txt
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java 
 (props changed)
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java   (props
changed)
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java
  (props changed)
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java
  (props changed)
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java
  (props changed)
    cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
    cassandra/trunk/src/java/org/apache/cassandra/service/GCInspector.java
    cassandra/trunk/test/unit/org/apache/cassandra/db/CompactionsPurgeTest.java

Propchange: cassandra/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep 29 16:33:46 2010
@@ -1,4 +1,4 @@
-/cassandra/branches/cassandra-0.6:922689-1002469
+/cassandra/branches/cassandra-0.6:922689-1002717
 /cassandra/trunk:978791
 /incubator/cassandra/branches/cassandra-0.3:774578-796573
 /incubator/cassandra/branches/cassandra-0.4:810145-834239,834349-834350

Modified: cassandra/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/trunk/CHANGES.txt?rev=1002723&r1=1002722&r2=1002723&view=diff
==============================================================================
--- cassandra/trunk/CHANGES.txt (original)
+++ cassandra/trunk/CHANGES.txt Wed Sep 29 16:33:46 2010
@@ -109,6 +109,7 @@ dev
  * make removetoken work like decommission (CASSANDRA-1216)
  * make cli comparator-aware and improve quote rules (CASSANDRA-1523,-1524)
  * make nodetool compact and cleanup blocking (CASSANDRA-1449)
+ * add memtable, cache information to GCInspector logs (CASSANDRA-1558)
 
 
 0.7-beta1

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep 29 16:33:46 2010
@@ -1,4 +1,4 @@
-/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:922689-1002469
+/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:922689-1002717
 /cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:978791
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/Cassandra.java:774578-796573
 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/Cassandra.java:810145-834239,834349-834350

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep 29 16:33:46 2010
@@ -1,4 +1,4 @@
-/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:922689-1002469
+/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:922689-1002717
 /cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:978791
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/column_t.java:774578-792198
 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/Column.java:810145-834239,834349-834350

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep 29 16:33:46 2010
@@ -1,4 +1,4 @@
-/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:922689-1002469
+/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:922689-1002717
 /cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:978791
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/InvalidRequestException.java:774578-796573
 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/InvalidRequestException.java:810145-834239,834349-834350

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep 29 16:33:46 2010
@@ -1,4 +1,4 @@
-/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:922689-1002469
+/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:922689-1002717
 /cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:978791
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/NotFoundException.java:774578-796573
 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/NotFoundException.java:810145-834239,834349-834350

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep 29 16:33:46 2010
@@ -1,4 +1,4 @@
-/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:922689-1002469
+/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:922689-1002717
 /cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:978791
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/superColumn_t.java:774578-792198
 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/SuperColumn.java:810145-834239,834349-834350

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java?rev=1002723&r1=1002722&r2=1002723&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java Wed Sep 29 16:33:46
2010
@@ -1446,11 +1446,26 @@ public class ColumnFamilyStore implement
         ssTables.getRowCache().clear();
     }
 
-    public int getKeyCacheSize()
+    public int getRowCacheCapacity()
+    {
+        return ssTables.getRowCache().getCapacity();
+    }
+
+    public int getKeyCacheCapacity()
     {
         return ssTables.getKeyCache().getCapacity();
     }
 
+    public int getRowCacheSize()
+    {
+        return ssTables.getRowCache().getSize();
+    }
+
+    public int getKeyCacheSize()
+    {
+        return ssTables.getKeyCache().getSize();
+    }
+
     public static Iterable<ColumnFamilyStore> all()
     {
         Iterable<ColumnFamilyStore>[] stores = new Iterable[DatabaseDescriptor.getTables().size()];

Modified: cassandra/trunk/src/java/org/apache/cassandra/service/GCInspector.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/service/GCInspector.java?rev=1002723&r1=1002722&r2=1002723&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/service/GCInspector.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/service/GCInspector.java Wed Sep 29 16:33:46
2010
@@ -27,7 +27,8 @@ import java.lang.reflect.InvocationTarge
 import java.lang.reflect.Method;
 import java.util.*;
 import org.apache.cassandra.concurrent.IExecutorMBean;
-import org.apache.cassandra.db.CompactionManagerMBean;
+import org.apache.cassandra.db.ColumnFamilyStore;
+import org.apache.cassandra.db.CompactionManager;
 
 import java.lang.management.MemoryUsage;
 import java.lang.management.ManagementFactory;
@@ -133,7 +134,7 @@ public class GCInspector
             {
                 try
                 {
-                    logThreadPoolStats();
+                    logStats();
                 }
                 catch (MalformedObjectNameException e)
                 {
@@ -143,22 +144,31 @@ public class GCInspector
         }
     }
 
-    private void logThreadPoolStats() throws MalformedObjectNameException
+    private void logStats() throws MalformedObjectNameException
     {
-        ObjectName query = new ObjectName("org.apache.cassandra.concurrent:type=*");
-        Iterator<ObjectName> tpiter = server.queryNames(query, null).iterator();
+        // everything from o.a.c.concurrent
         logger.info(String.format("%-25s%10s%10s", "Pool Name", "Active", "Pending"));
-        while(tpiter.hasNext())
+        for (ObjectName objectName : server.queryNames(new ObjectName("org.apache.cassandra.concurrent:type=*"),
null))
         {
-            ObjectName objectName = tpiter.next();
             String poolName = objectName.getKeyProperty("type");
             IExecutorMBean threadPoolProxy = JMX.newMBeanProxy(server, objectName, IExecutorMBean.class);
-            logger.info(String.format("%-25s%10d%10d", poolName, threadPoolProxy.getActiveCount(),
threadPoolProxy.getPendingTasks()));
+            logger.info(String.format("%-25s%10s%10s",
+                                      poolName, threadPoolProxy.getActiveCount(), threadPoolProxy.getPendingTasks()));
+        }
+        // one offs
+        logger.info(String.format("%-25s%10s%10s",
+                                  "CompactionManager", "n/a", CompactionManager.instance.getPendingTasks()));
+
+        // per-CF stats
+        logger.info(String.format("%-25s%20s%20s%20s", "ColumnFamily", "Memtable ops,data",
"Row cache size/cap", "Key cache size/cap"));
+        for (ColumnFamilyStore cfs : ColumnFamilyStore.all())
+        {
+            logger.info(String.format("%-25s%20s%20s%20s",
+                                      cfs.table.name + "." + cfs.columnFamily,
+                                      cfs.getMemtableColumnsCount() + "," + cfs.getMemtableDataSize(),
+                                      cfs.getRowCacheSize() + "/" + cfs.getRowCacheCapacity(),
+                                      cfs.getKeyCacheSize() + "/" + cfs.getKeyCacheCapacity()));
         }
-        // one off for compaction
-        ObjectName cm = new ObjectName("org.apache.cassandra.db:type=CompactionManager");
-        CompactionManagerMBean cmProxy = JMX.newMBeanProxy(server, cm, CompactionManagerMBean.class);
-        logger.info(String.format("%-25s%10s%10s", "CompactionManager", "n/a", cmProxy.getPendingTasks()));
     }
     
     

Modified: cassandra/trunk/test/unit/org/apache/cassandra/db/CompactionsPurgeTest.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/test/unit/org/apache/cassandra/db/CompactionsPurgeTest.java?rev=1002723&r1=1002722&r2=1002723&view=diff
==============================================================================
--- cassandra/trunk/test/unit/org/apache/cassandra/db/CompactionsPurgeTest.java (original)
+++ cassandra/trunk/test/unit/org/apache/cassandra/db/CompactionsPurgeTest.java Wed Sep 29
16:33:46 2010
@@ -198,7 +198,7 @@ public class CompactionsPurgeTest extend
         ColumnFamilyStore store = table.getColumnFamilyStore(cfName);
 
         // KeyCache should start at size 1 if we're caching X% of zero data.
-        int keyCacheSize = store.getKeyCacheSize();
+        int keyCacheSize = store.getKeyCacheCapacity();
         assert keyCacheSize == 1 : keyCacheSize;
 
         DecoratedKey key1 = Util.dk("key1");
@@ -223,12 +223,12 @@ public class CompactionsPurgeTest extend
 
         // After a flush, the cache should expand to be X% of indices * INDEX_INTERVAL.
         store.forceBlockingFlush();
-        keyCacheSize = store.getKeyCacheSize();
+        keyCacheSize = store.getKeyCacheCapacity();
         assert keyCacheSize == expectedCacheSize : keyCacheSize;
 
         // After a compaction, the cache should expand to be X% of zero data.
         CompactionManager.instance.submitMajor(store, 0, Integer.MAX_VALUE).get();
-        keyCacheSize = store.getKeyCacheSize();
+        keyCacheSize = store.getKeyCacheCapacity();
         assert keyCacheSize == 1 : keyCacheSize;
     }
 }



Mime
View raw message