cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brandonwilli...@apache.org
Subject [12/20] git commit: Track metrics at a keyspace level
Date Fri, 13 Jun 2014 12:54:01 GMT
Track metrics at a keyspace level

Patch by brandonwilliams, reviewed by yukim for CASSANDRA-6539


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

Branch: refs/heads/cassandra-2.1
Commit: 6eda57c1b612346d7936f6749b684882ec46d68e
Parents: 4e0656b
Author: Brandon Williams <brandonwilliams@apache.org>
Authored: Thu Jun 12 18:42:21 2014 -0500
Committer: Brandon Williams <brandonwilliams@apache.org>
Committed: Fri Jun 13 07:48:51 2014 -0500

----------------------------------------------------------------------
 CHANGES.txt                                    | 1 +
 src/java/org/apache/cassandra/db/Keyspace.java | 4 ++++
 2 files changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/6eda57c1/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 199a0ea..147a096 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -20,6 +20,7 @@ Merged from 2.0:
  * Fix infinite loop on exception while streaming (CASSANDRA-7330)
 Merged from 1.2:
 1.2.17
+ * Track metrics at a keyspace level (CASSANDRA-6539)
  * Add replace_address_first_boot flag to only replace if not bootstrapped (CASSANDRA-7356)
  * Enable keepalive for native protocol (CASSANDRA-7380)
  * Check internal addresses for seeds (CASSANDRA-6523)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6eda57c1/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 ae9d9ef..1c89cc4 100644
--- a/src/java/org/apache/cassandra/db/Keyspace.java
+++ b/src/java/org/apache/cassandra/db/Keyspace.java
@@ -50,6 +50,7 @@ import org.apache.cassandra.service.StorageService;
 import org.apache.cassandra.service.pager.QueryPagers;
 import org.apache.cassandra.tracing.Tracing;
 import org.apache.cassandra.utils.concurrent.OpOrder;
+import org.apache.cassandra.metrics.KeyspaceMetrics;
 
 /**
  * It represents a Keyspace.
@@ -75,6 +76,7 @@ public class Keyspace
     /* ColumnFamilyStore per column family */
     private final ConcurrentMap<UUID, ColumnFamilyStore> columnFamilyStores = new ConcurrentHashMap<UUID,
ColumnFamilyStore>();
     private volatile AbstractReplicationStrategy replicationStrategy;
+    public final KeyspaceMetrics metric;
     public static final Function<String,Keyspace> keyspaceTransformer = new Function<String,
Keyspace>()
     {
         public Keyspace apply(String keyspaceName)
@@ -141,6 +143,7 @@ public class Keyspace
             {
                 for (ColumnFamilyStore cfs : t.getColumnFamilyStores())
                     t.unloadCf(cfs);
+                t.metric.release();
             }
             return t;
         }
@@ -273,6 +276,7 @@ public class Keyspace
             logger.debug("Initializing {}.{}", getName(), cfm.cfName);
             initCf(cfm.cfId, cfm.cfName, loadSSTables);
         }
+        this.metric = new KeyspaceMetrics(this);
     }
 
     public void createReplicationStrategy(KSMetaData ksm)


Mime
View raw message