[jira] [Commented] (CASSANDRA-7378) Protocol: Autoprepare flag for QUERY and BATCH requests

2014-06-13 Thread Jorge Bay (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7378?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14030355#comment-14030355
 ] 

Jorge Bay commented on CASSANDRA-7378:
--

My main concern is to lower the complexity from the user perspective, but it is 
true that it would add a few bytes extra (there are still 16 bytes from the 
md5) per request, if implemented as I proposed.
If implemented as Tyler proposes, it will save bandwidth and roundtrips but it 
will still require some state management by the driver.

About preparing statements at app startup, it is a possibility but again it 
adds complexity to the user, forcing the user to store the prepared statement 
result (id) at a global scope...

 Protocol: Autoprepare flag for QUERY and BATCH requests
 ---

 Key: CASSANDRA-7378
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7378
 Project: Cassandra
  Issue Type: Improvement
  Components: API
Reporter: Jorge Bay
Priority: Minor

 Currently the flow for executing a prepared statement in the native protocol 
 is:
 - PREPARE request
 - prepared response (queryid)
 - EXECUTE request (using queryid)
   - RESULT response
   - or UNPREPARED error response
 As is today, it is the responsibility of the driver or client to maintain the 
 query id and to send a EXECUTE message using this query id and to expect for 
 UNPREPARED error response in case the query got evicted or the node was 
 restarted.
 With the following implications:
 - Before making a EXECUTE request, there is no way to know if it got evicted.
 - Before sending a PREPARE request, there is no way to know if that query has 
 been already prepared on that host (by another connection), .
 - There isn't anything else the client can do with the prepared id (no much 
 use from the client perspective).
 It would be nice to have a flag in the QUERY and BATCH requests that when 
 set, the Cassandra node will prepare (if not already prepared) and execute 
 the prepared query. This way we could save a few extra roundtrips and make 
 the protocol flow for prepared statements a little more simple.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (CASSANDRA-7378) Protocol: Autoprepare flag for QUERY and BATCH requests

2014-06-13 Thread Robert Stupp (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7378?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14030430#comment-14030430
 ] 

Robert Stupp commented on CASSANDRA-7378:
-

It sound very simple - but in fact it isn't. The Java driver for example holds 
a Map of _pstmt id_ to _pstmt_. The pstmt itself consists of the fields 
{{query}}, {{queryKeyspace}}, {{routingKey}}, {{consistency}}, 
{{serialConsistency}}, {{traceQuery}}, {{retryPolicy}}. These fields make the 
prepared statement unique. If only one field changes, it is _another_ pstmt.
imo it cannot be the protocol's or driver's responsibility to optimize for this 
(compare with JDBC drivers - they don't do that either). And you should not 
make any assumptions how the _pstmt id_ is calculated - the algorithm may 
change due to C* internals.

 Protocol: Autoprepare flag for QUERY and BATCH requests
 ---

 Key: CASSANDRA-7378
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7378
 Project: Cassandra
  Issue Type: Improvement
  Components: API
Reporter: Jorge Bay
Priority: Minor

 Currently the flow for executing a prepared statement in the native protocol 
 is:
 - PREPARE request
 - prepared response (queryid)
 - EXECUTE request (using queryid)
   - RESULT response
   - or UNPREPARED error response
 As is today, it is the responsibility of the driver or client to maintain the 
 query id and to send a EXECUTE message using this query id and to expect for 
 UNPREPARED error response in case the query got evicted or the node was 
 restarted.
 With the following implications:
 - Before making a EXECUTE request, there is no way to know if it got evicted.
 - Before sending a PREPARE request, there is no way to know if that query has 
 been already prepared on that host (by another connection), .
 - There isn't anything else the client can do with the prepared id (no much 
 use from the client perspective).
 It would be nice to have a flag in the QUERY and BATCH requests that when 
 set, the Cassandra node will prepare (if not already prepared) and execute 
 the prepared query. This way we could save a few extra roundtrips and make 
 the protocol flow for prepared statements a little more simple.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[3/8] git commit: Track metrics at a keyspace level

2014-06-13 Thread brandonwilliams
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/7065b1bd
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/7065b1bd
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/7065b1bd

Branch: refs/heads/cassandra-1.2
Commit: 7065b1bdf119e07f2e64735f60ab3e3d036c00de
Parents: d509fe1
Author: Brandon Williams brandonwilli...@apache.org
Authored: Thu Jun 12 18:42:21 2014 -0500
Committer: Brandon Williams brandonwilli...@apache.org
Committed: Thu Jun 12 18:48:11 2014 -0500

--
 CHANGES.txt |   1 +
 src/java/org/apache/cassandra/db/Table.java |   4 +
 .../cassandra/metrics/KeyspaceMetrics.java  | 202 +++
 3 files changed, 207 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/7065b1bd/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index f37eda4..28b5f29 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 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/7065b1bd/src/java/org/apache/cassandra/db/Table.java
--
diff --git a/src/java/org/apache/cassandra/db/Table.java 
b/src/java/org/apache/cassandra/db/Table.java
index e6df982..611fd9a 100644
--- a/src/java/org/apache/cassandra/db/Table.java
+++ b/src/java/org/apache/cassandra/db/Table.java
@@ -42,6 +42,7 @@ import org.apache.cassandra.io.sstable.SSTableReader;
 import org.apache.cassandra.locator.AbstractReplicationStrategy;
 import org.apache.cassandra.service.StorageService;
 import org.apache.cassandra.tracing.Tracing;
+import org.apache.cassandra.metrics.KeyspaceMetrics;
 
 /**
  * It represents a Keyspace.
@@ -74,6 +75,7 @@ public class Table
 private final ConcurrentMapUUID, ColumnFamilyStore columnFamilyStores = 
new ConcurrentHashMapUUID, ColumnFamilyStore();
 private final Object[] indexLocks;
 private volatile AbstractReplicationStrategy replicationStrategy;
+public final KeyspaceMetrics metric;
 public static final FunctionString,Table tableTransformer = new 
FunctionString, Table()
 {
 public Table apply(String tableName)
@@ -132,6 +134,7 @@ public class Table
 {
 for (ColumnFamilyStore cfs : t.getColumnFamilyStores())
 t.unloadCf(cfs);
+t.metric.release();
 }
 return t;
 }
@@ -271,6 +274,7 @@ public class Table
 logger.debug(Initializing {}.{}, name, cfm.cfName);
 initCf(cfm.cfId, cfm.cfName, loadSSTables);
 }
+this.metric = new KeyspaceMetrics(this);
 }
 
 public void createReplicationStrategy(KSMetaData ksm)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7065b1bd/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
--
diff --git a/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java 
b/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
new file mode 100644
index 000..4a0980f
--- /dev/null
+++ b/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
@@ -0,0 +1,202 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * License); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cassandra.metrics;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.yammer.metrics.Metrics;
+import com.yammer.metrics.core.*;
+import com.yammer.metrics.stats.Snapshot;
+
+import org.apache.cassandra.db.ColumnFamilyStore;
+import org.apache.cassandra.db.Keyspace;
+
+/**
+ * Metrics for {@link ColumnFamilyStore}.
+ */
+public class KeyspaceMetrics
+{

[1/8] git commit: Track metrics at a keyspace level

2014-06-13 Thread brandonwilliams
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-1.2 d509fe1a5 - 7065b1bdf
  refs/heads/trunk 85956ae68 - e428ae04c


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/a4504388
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/a4504388
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/a4504388

Branch: refs/heads/trunk
Commit: a4504388a8761b42f4f28604d98ac668ca496d55
Parents: d509fe1
Author: Brandon Williams brandonwilli...@apache.org
Authored: Thu Jun 12 18:42:21 2014 -0500
Committer: Brandon Williams brandonwilli...@apache.org
Committed: Thu Jun 12 18:47:16 2014 -0500

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


http://git-wip-us.apache.org/repos/asf/cassandra/blob/a4504388/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index f37eda4..28b5f29 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 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/a4504388/src/java/org/apache/cassandra/db/Table.java
--
diff --git a/src/java/org/apache/cassandra/db/Table.java 
b/src/java/org/apache/cassandra/db/Table.java
index e6df982..611fd9a 100644
--- a/src/java/org/apache/cassandra/db/Table.java
+++ b/src/java/org/apache/cassandra/db/Table.java
@@ -42,6 +42,7 @@ import org.apache.cassandra.io.sstable.SSTableReader;
 import org.apache.cassandra.locator.AbstractReplicationStrategy;
 import org.apache.cassandra.service.StorageService;
 import org.apache.cassandra.tracing.Tracing;
+import org.apache.cassandra.metrics.KeyspaceMetrics;
 
 /**
  * It represents a Keyspace.
@@ -74,6 +75,7 @@ public class Table
 private final ConcurrentMapUUID, ColumnFamilyStore columnFamilyStores = 
new ConcurrentHashMapUUID, ColumnFamilyStore();
 private final Object[] indexLocks;
 private volatile AbstractReplicationStrategy replicationStrategy;
+public final KeyspaceMetrics metric;
 public static final FunctionString,Table tableTransformer = new 
FunctionString, Table()
 {
 public Table apply(String tableName)
@@ -132,6 +134,7 @@ public class Table
 {
 for (ColumnFamilyStore cfs : t.getColumnFamilyStores())
 t.unloadCf(cfs);
+t.metric.release();
 }
 return t;
 }
@@ -271,6 +274,7 @@ public class Table
 logger.debug(Initializing {}.{}, name, cfm.cfName);
 initCf(cfm.cfId, cfm.cfName, loadSSTables);
 }
+this.metric = new KeyspaceMetrics(this);
 }
 
 public void createReplicationStrategy(KSMetaData ksm)



[5/8] git commit: Merge branch 'cassandra-1.2' into cassandra-2.0

2014-06-13 Thread brandonwilliams
Merge branch 'cassandra-1.2' into cassandra-2.0


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

Branch: refs/heads/trunk
Commit: c8f596ac8dd2b2a1a700b9cdd9738361a7cad126
Parents: 025c07e 7065b1b
Author: Brandon Williams brandonwilli...@apache.org
Authored: Thu Jun 12 18:48:24 2014 -0500
Committer: Brandon Williams brandonwilli...@apache.org
Committed: Thu Jun 12 18:48:24 2014 -0500

--

--




[6/8] git commit: Track metrics at a keyspace level

2014-06-13 Thread brandonwilliams
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/bbd130eb
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/bbd130eb
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/bbd130eb

Branch: refs/heads/trunk
Commit: bbd130ebbf2c1ebfe4f8514dedb20c9dabe4fbd4
Parents: c8f596a
Author: Brandon Williams brandonwilli...@apache.org
Authored: Thu Jun 12 18:49:09 2014 -0500
Committer: Brandon Williams brandonwilli...@apache.org
Committed: Thu Jun 12 18:49:09 2014 -0500

--
 CHANGES.txt |   2 +-
 src/java/org/apache/cassandra/db/Keyspace.java  |   5 +
 .../cassandra/metrics/KeyspaceMetrics.java  | 202 +++
 3 files changed, 208 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/bbd130eb/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index a2a978e..576355c 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -16,7 +16,7 @@
  * Fix infinite loop on exception while streaming (CASSANDRA-7330)
  * Reference sstables before populating key cache (CASSANDRA-7234)
 Merged from 1.2:
-1.2.17
+ * Tracke 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/bbd130eb/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 714956a..d92bea7 100644
--- a/src/java/org/apache/cassandra/db/Keyspace.java
+++ b/src/java/org/apache/cassandra/db/Keyspace.java
@@ -27,6 +27,7 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
 
 import com.google.common.base.Function;
 import com.google.common.collect.Iterables;
+import org.apache.cassandra.metrics.KeyspaceMetrics;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -62,6 +63,8 @@ public class Keyspace
  */
 public static final ReentrantReadWriteLock switchLock = new 
ReentrantReadWriteLock();
 
+public final KeyspaceMetrics metric;
+
 // It is possible to call Keyspace.open without a running daemon, so it 
makes sense to ensure
 // proper directories here as well as in CassandraDaemon.
 static
@@ -133,6 +136,7 @@ public class Keyspace
 {
 for (ColumnFamilyStore cfs : t.getColumnFamilyStores())
 t.unloadCf(cfs);
+t.metric.release();
 }
 return t;
 }
@@ -259,6 +263,7 @@ public class Keyspace
 metadata = Schema.instance.getKSMetaData(keyspaceName);
 assert metadata != null : Unknown keyspace  + keyspaceName;
 createReplicationStrategy(metadata);
+metric = new KeyspaceMetrics(this);
 
 for (CFMetaData cfm : new 
ArrayListCFMetaData(metadata.cfMetaData().values()))
 {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/bbd130eb/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
--
diff --git a/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java 
b/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
new file mode 100644
index 000..4a0980f
--- /dev/null
+++ b/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
@@ -0,0 +1,202 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * License); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cassandra.metrics;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.yammer.metrics.Metrics;
+import com.yammer.metrics.core.*;
+import com.yammer.metrics.stats.Snapshot;
+
+import org.apache.cassandra.db.ColumnFamilyStore;
+import 

[4/8] git commit: Track metrics at a keyspace level

2014-06-13 Thread brandonwilliams
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/7065b1bd
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/7065b1bd
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/7065b1bd

Branch: refs/heads/trunk
Commit: 7065b1bdf119e07f2e64735f60ab3e3d036c00de
Parents: d509fe1
Author: Brandon Williams brandonwilli...@apache.org
Authored: Thu Jun 12 18:42:21 2014 -0500
Committer: Brandon Williams brandonwilli...@apache.org
Committed: Thu Jun 12 18:48:11 2014 -0500

--
 CHANGES.txt |   1 +
 src/java/org/apache/cassandra/db/Table.java |   4 +
 .../cassandra/metrics/KeyspaceMetrics.java  | 202 +++
 3 files changed, 207 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/7065b1bd/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index f37eda4..28b5f29 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 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/7065b1bd/src/java/org/apache/cassandra/db/Table.java
--
diff --git a/src/java/org/apache/cassandra/db/Table.java 
b/src/java/org/apache/cassandra/db/Table.java
index e6df982..611fd9a 100644
--- a/src/java/org/apache/cassandra/db/Table.java
+++ b/src/java/org/apache/cassandra/db/Table.java
@@ -42,6 +42,7 @@ import org.apache.cassandra.io.sstable.SSTableReader;
 import org.apache.cassandra.locator.AbstractReplicationStrategy;
 import org.apache.cassandra.service.StorageService;
 import org.apache.cassandra.tracing.Tracing;
+import org.apache.cassandra.metrics.KeyspaceMetrics;
 
 /**
  * It represents a Keyspace.
@@ -74,6 +75,7 @@ public class Table
 private final ConcurrentMapUUID, ColumnFamilyStore columnFamilyStores = 
new ConcurrentHashMapUUID, ColumnFamilyStore();
 private final Object[] indexLocks;
 private volatile AbstractReplicationStrategy replicationStrategy;
+public final KeyspaceMetrics metric;
 public static final FunctionString,Table tableTransformer = new 
FunctionString, Table()
 {
 public Table apply(String tableName)
@@ -132,6 +134,7 @@ public class Table
 {
 for (ColumnFamilyStore cfs : t.getColumnFamilyStores())
 t.unloadCf(cfs);
+t.metric.release();
 }
 return t;
 }
@@ -271,6 +274,7 @@ public class Table
 logger.debug(Initializing {}.{}, name, cfm.cfName);
 initCf(cfm.cfId, cfm.cfName, loadSSTables);
 }
+this.metric = new KeyspaceMetrics(this);
 }
 
 public void createReplicationStrategy(KSMetaData ksm)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7065b1bd/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
--
diff --git a/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java 
b/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
new file mode 100644
index 000..4a0980f
--- /dev/null
+++ b/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
@@ -0,0 +1,202 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * License); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cassandra.metrics;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.yammer.metrics.Metrics;
+import com.yammer.metrics.core.*;
+import com.yammer.metrics.stats.Snapshot;
+
+import org.apache.cassandra.db.ColumnFamilyStore;
+import org.apache.cassandra.db.Keyspace;
+
+/**
+ * Metrics for {@link ColumnFamilyStore}.
+ */
+public class KeyspaceMetrics
+{
+/** 

[8/8] git commit: Merge branch 'cassandra-2.1' into trunk

2014-06-13 Thread brandonwilliams
Merge branch 'cassandra-2.1' into trunk


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

Branch: refs/heads/trunk
Commit: e428ae04c5f1e3bfba927872772a65dc10559ef2
Parents: 85956ae 5871b26
Author: Brandon Williams brandonwilli...@apache.org
Authored: Fri Jun 13 07:45:02 2014 -0500
Committer: Brandon Williams brandonwilli...@apache.org
Committed: Fri Jun 13 07:45:02 2014 -0500

--
 CHANGES.txt |   2 +-
 src/java/org/apache/cassandra/db/Keyspace.java  |   5 +
 .../cassandra/metrics/KeyspaceMetrics.java  | 267 +++
 3 files changed, 273 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/e428ae04/CHANGES.txt
--



[2/8] git commit: Merge branch 'cassandra-1.2' into cassandra-2.0

2014-06-13 Thread brandonwilliams
Merge branch 'cassandra-1.2' into cassandra-2.0


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

Branch: refs/heads/trunk
Commit: 025c07efd886a048c1c66f653e8411fb1d2912de
Parents: 53c95eb a450438
Author: Brandon Williams brandonwilli...@apache.org
Authored: Thu Jun 12 18:47:27 2014 -0500
Committer: Brandon Williams brandonwilli...@apache.org
Committed: Thu Jun 12 18:47:27 2014 -0500

--

--




[7/8] git commit: Merge branch 'cassandra-2.0' into cassandra-2.1

2014-06-13 Thread brandonwilliams
Merge branch 'cassandra-2.0' into cassandra-2.1

Conflicts:
src/java/org/apache/cassandra/db/Keyspace.java


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

Branch: refs/heads/trunk
Commit: 5871b26b2983b9da7282fa81fd5c726a63e9ce77
Parents: 1e13cbf bbd130e
Author: Brandon Williams brandonwilli...@apache.org
Authored: Thu Jun 12 18:50:28 2014 -0500
Committer: Brandon Williams brandonwilli...@apache.org
Committed: Fri Jun 13 07:42:00 2014 -0500

--
 CHANGES.txt |   2 +-
 src/java/org/apache/cassandra/db/Keyspace.java  |   5 +
 .../cassandra/metrics/KeyspaceMetrics.java  | 267 +++
 3 files changed, 273 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/5871b26b/CHANGES.txt
--
diff --cc CHANGES.txt
index 199a0ea,576355c..4af08dd
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,25 -1,22 +1,25 @@@
 -2.0.9
 +2.1.0
 + * Avoid incremental compaction on Windows (CASSANDRA-7365)
 + * Fix exception when querying a composite-keyed table with a collection index
 +   (CASSANDRA-7372)
 + * Use node's host id in place of counter ids (CASSANDRA-7366)
   * Fix native protocol CAS batches (CASSANDRA-7337)
 + * Reduce likelihood of contention on local paxos locking (CASSANDRA-7359)
 + * Upgrade to Pig 0.12.1 (CASSANDRA-6556)
 + * Make sure we clear out repair sessions from netstats (CASSANDRA-7329)
 + * Don't fail streams on failure detector downs (CASSANDRA-3569)
 + * Add optional keyspace to DROP INDEX statement (CASSANDRA-7314)
 + * Reduce run time for CQL tests (CASSANDRA-7327)
 + * Fix heap size calculation on Windows (CASSANDRA-7352)
 + * RefCount native frames from netty (CASSANDRA-7245)
 + * Use tarball dir instead of /var for default paths (CASSANDRA-7136)
 +Merged from 2.0:
   * Add per-CF range read request latency metrics (CASSANDRA-7338)
   * Fix NPE in StreamTransferTask.createMessageForRetry() (CASSANDRA-7323)
 - * Add conditional CREATE/DROP USER support (CASSANDRA-7264)
 - * Swap local and global default read repair chances (CASSANDRA-7320)
 - * Add missing iso8601 patterns for date strings (CASSANDRA-6973)
 - * Support selecting multiple rows in a partition using IN (CASSANDRA-6875)
 - * cqlsh: always emphasize the partition key in DESC output (CASSANDRA-7274)
 - * Copy compaction options to make sure they are reloaded (CASSANDRA-7290)
 - * Add option to do more aggressive tombstone compactions (CASSANDRA-6563)
 - * Don't try to compact already-compacting files in HHOM (CASSANDRA-7288)
 - * Add authentication support to shuffle (CASSANDRA-6484)
 - * Cqlsh counts non-empty lines for Blank lines warning (CASSANDRA-7325)
   * Make StreamSession#closeSession() idempotent (CASSANDRA-7262)
   * Fix infinite loop on exception while streaming (CASSANDRA-7330)
 - * Reference sstables before populating key cache (CASSANDRA-7234)
  Merged from 1.2:
- 1.2.17
+  * Tracke 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/5871b26b/src/java/org/apache/cassandra/db/Keyspace.java
--
diff --cc src/java/org/apache/cassandra/db/Keyspace.java
index ae9d9ef,d92bea7..9e39952
--- a/src/java/org/apache/cassandra/db/Keyspace.java
+++ b/src/java/org/apache/cassandra/db/Keyspace.java
@@@ -61,6 -55,16 +62,8 @@@ public class Keyspac
  
  private static final Logger logger = 
LoggerFactory.getLogger(Keyspace.class);
  
 -/**
 - * accesses to CFS.memtable should acquire this for thread safety.
 - * CFS.maybeSwitchMemtable should aquire the writeLock; see that method 
for the full explanation.
 - * p/
 - * (Enabling fairness in the RRWL is observed to decrease throughput, so 
we leave it off.)
 - */
 -public static final ReentrantReadWriteLock switchLock = new 
ReentrantReadWriteLock();
 -
+ public final KeyspaceMetrics metric;
+ 
  // It is possible to call Keyspace.open without a running daemon, so it 
makes sense to ensure
  // proper directories here as well as in CassandraDaemon.
  static

http://git-wip-us.apache.org/repos/asf/cassandra/blob/5871b26b/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
--
diff --cc src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
index 

buildbot failure in ASF Buildbot on cassandra-trunk

2014-06-13 Thread buildbot
The Buildbot has detected a new failure on builder cassandra-trunk while 
building cassandra.
Full details are available at:
 http://ci.apache.org/builders/cassandra-trunk/builds/325

Buildbot URL: http://ci.apache.org/

Buildslave for this Build: portunus_ubuntu

Build Reason: scheduler
Build Source Stamp: [branch trunk] e428ae04c5f1e3bfba927872772a65dc10559ef2
Blamelist: Brandon Williams brandonwilli...@apache.org

BUILD FAILED: failed compile

sincerely,
 -The Buildbot





[19/20] git commit: Merge branch 'cassandra-2.0' into cassandra-2.1

2014-06-13 Thread brandonwilliams
Merge branch 'cassandra-2.0' into cassandra-2.1

Conflicts:
src/java/org/apache/cassandra/db/Keyspace.java


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

Branch: refs/heads/trunk
Commit: 30d3623bcbb2d02d2ed24351045b5d657c08d236
Parents: 55c48c2 be79ba5
Author: Brandon Williams brandonwilli...@apache.org
Authored: Fri Jun 13 07:50:41 2014 -0500
Committer: Brandon Williams brandonwilli...@apache.org
Committed: Fri Jun 13 07:50:41 2014 -0500

--
 src/java/org/apache/cassandra/db/Keyspace.java | 2 ++
 1 file changed, 2 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/30d3623b/src/java/org/apache/cassandra/db/Keyspace.java
--
diff --cc src/java/org/apache/cassandra/db/Keyspace.java
index cfae05c,308d8ef..2fe9197
--- a/src/java/org/apache/cassandra/db/Keyspace.java
+++ b/src/java/org/apache/cassandra/db/Keyspace.java
@@@ -63,8 -56,16 +63,10 @@@ public class Keyspac
  
  private static final Logger logger = 
LoggerFactory.getLogger(Keyspace.class);
  
 -/**
 - * accesses to CFS.memtable should acquire this for thread safety.
 - * CFS.maybeSwitchMemtable should aquire the writeLock; see that method 
for the full explanation.
 - * p/
 - * (Enabling fairness in the RRWL is observed to decrease throughput, so 
we leave it off.)
 - */
 -public static final ReentrantReadWriteLock switchLock = new 
ReentrantReadWriteLock();
 +public final KeyspaceMetrics metric;
  
+ public final KeyspaceMetrics metric;
+ 
  // It is possible to call Keyspace.open without a running daemon, so it 
makes sense to ensure
  // proper directories here as well as in CassandraDaemon.
  static



[12/20] git commit: Track metrics at a keyspace level

2014-06-13 Thread brandonwilliams
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 brandonwilli...@apache.org
Authored: Thu Jun 12 18:42:21 2014 -0500
Committer: Brandon Williams brandonwilli...@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 ConcurrentMapUUID, ColumnFamilyStore columnFamilyStores = 
new ConcurrentHashMapUUID, ColumnFamilyStore();
 private volatile AbstractReplicationStrategy replicationStrategy;
+public final KeyspaceMetrics metric;
 public static final FunctionString,Keyspace keyspaceTransformer = new 
FunctionString, 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)



[14/20] git commit: Track metrics at a keyspace level

2014-06-13 Thread brandonwilliams
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/68dd6349
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/68dd6349
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/68dd6349

Branch: refs/heads/cassandra-2.1
Commit: 68dd6349551f5b26b399a80f38624e02bf89a9b4
Parents: 6eda57c
Author: Brandon Williams brandonwilli...@apache.org
Authored: Thu Jun 12 18:42:21 2014 -0500
Committer: Brandon Williams brandonwilli...@apache.org
Committed: Fri Jun 13 07:49:22 2014 -0500

--
 .../cassandra/metrics/KeyspaceMetrics.java  | 202 +++
 1 file changed, 202 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/68dd6349/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
--
diff --git a/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java 
b/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
new file mode 100644
index 000..4a0980f
--- /dev/null
+++ b/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
@@ -0,0 +1,202 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * License); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cassandra.metrics;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.yammer.metrics.Metrics;
+import com.yammer.metrics.core.*;
+import com.yammer.metrics.stats.Snapshot;
+
+import org.apache.cassandra.db.ColumnFamilyStore;
+import org.apache.cassandra.db.Keyspace;
+
+/**
+ * Metrics for {@link ColumnFamilyStore}.
+ */
+public class KeyspaceMetrics
+{
+/** Total amount of data stored in the memtable, including column related 
overhead. */
+public final GaugeLong memtableDataSize;
+/** Total amount of data stored in the memtables (2i and pending flush 
memtables included). */
+public final GaugeLong allMemtablesDataSize;
+/** Total number of columns present in the memtable. */
+public final GaugeLong memtableColumnsCount;
+/** Number of times flush has resulted in the memtable being switched out. 
*/
+public final GaugeLong memtableSwitchCount;
+/** Estimated number of tasks pending for this column family */
+public final GaugeInteger pendingTasks;
+/** Estimate of number of pending compactios for this CF */
+public final GaugeInteger pendingCompactions;
+/** Disk space used by SSTables belonging to this CF */
+public final GaugeLong liveDiskSpaceUsed;
+/** Total disk space used by SSTables belonging to this CF, including 
obsolete ones waiting to be GC'd */
+public final GaugeLong totalDiskSpaceUsed;
+/** Disk space used by bloom filter */
+public final GaugeLong bloomFilterDiskSpaceUsed;
+
+private final MetricNameFactory factory;
+
+/**
+ * Creates metrics for given {@link ColumnFamilyStore}.
+ *
+ * @param ks Keyspace to measure metrics
+ */
+public KeyspaceMetrics(final Keyspace ks)
+{
+factory = new KeyspaceMetricNameFactory(ks);
+
+memtableColumnsCount = 
Metrics.newGauge(factory.createMetricName(MemtableColumnsCount), new 
GaugeLong()
+{
+public Long value()
+{
+long total = 0;
+for (ColumnFamilyStore cf : ks.getColumnFamilyStores())
+{
+total += cf.metric.memtableColumnsCount.value();
+}
+return total;
+}
+});
+memtableDataSize = 
Metrics.newGauge(factory.createMetricName(MemtableDataSize), new GaugeLong()
+{
+public Long value()
+{
+long total = 0;
+for (ColumnFamilyStore cf : ks.getColumnFamilyStores())
+{
+total += cf.metric.memtableDataSize.value();
+}
+return total;
+}
+});
+allMemtablesDataSize = 

[01/20] git commit: return absolute path from resourceToFile patch by Josh McKenzie; reviewed by jbellis for CASSANDRA-7335

2014-06-13 Thread brandonwilliams
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.0 b93f287c8 - be79ba500
  refs/heads/cassandra-2.1 4e0656b0b - 30d3623bc
  refs/heads/trunk e428ae04c - 3aa030593


return absolute path from resourceToFile
patch by Josh McKenzie; reviewed by jbellis for CASSANDRA-7335


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

Branch: refs/heads/trunk
Commit: b93f287c869c1da5158a7961b3ee1281a11a2b9e
Parents: 53c95eb
Author: Jonathan Ellis jbel...@apache.org
Authored: Thu Jun 12 12:00:37 2014 -0500
Committer: Jonathan Ellis jbel...@apache.org
Committed: Thu Jun 12 20:42:39 2014 -0500

--
 src/java/org/apache/cassandra/utils/FBUtilities.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/b93f287c/src/java/org/apache/cassandra/utils/FBUtilities.java
--
diff --git a/src/java/org/apache/cassandra/utils/FBUtilities.java 
b/src/java/org/apache/cassandra/utils/FBUtilities.java
index b8260b2..9f09868 100644
--- a/src/java/org/apache/cassandra/utils/FBUtilities.java
+++ b/src/java/org/apache/cassandra/utils/FBUtilities.java
@@ -340,7 +340,7 @@ public class FBUtilities
 if (scpurl == null)
 throw new ConfigurationException(unable to locate  + filename);
 
-return scpurl.getFile();
+return new File(scpurl.getFile()).getAbsolutePath();
 }
 
 public static File cassandraTriggerDir()



[06/20] git commit: Track metrics at a keyspace level

2014-06-13 Thread brandonwilliams
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/cecd1da3
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/cecd1da3
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/cecd1da3

Branch: refs/heads/cassandra-2.0
Commit: cecd1da318f19139446db526be035fb25e1c5b12
Parents: f1aa49b
Author: Brandon Williams brandonwilli...@apache.org
Authored: Thu Jun 12 18:42:21 2014 -0500
Committer: Brandon Williams brandonwilli...@apache.org
Committed: Fri Jun 13 07:47:12 2014 -0500

--
 src/java/org/apache/cassandra/db/Keyspace.java  |   2 +-
 .../cassandra/metrics/KeyspaceMetrics.java  | 202 +++
 2 files changed, 203 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/cecd1da3/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 9651794..06df066 100644
--- a/src/java/org/apache/cassandra/db/Keyspace.java
+++ b/src/java/org/apache/cassandra/db/Keyspace.java
@@ -76,8 +76,8 @@ public class Keyspace
 /* ColumnFamilyStore per column family */
 private final ConcurrentMapUUID, ColumnFamilyStore columnFamilyStores = 
new ConcurrentHashMapUUID, ColumnFamilyStore();
 private volatile AbstractReplicationStrategy replicationStrategy;
-public static final FunctionString,Keyspace keyspaceTransformer = new 
FunctionString, Keyspace()
 public final KeyspaceMetrics metric;
+public static final FunctionString,Keyspace keyspaceTransformer = new 
FunctionString, Keyspace()
 {
 public Keyspace apply(String keyspaceName)
 {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cecd1da3/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
--
diff --git a/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java 
b/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
new file mode 100644
index 000..4a0980f
--- /dev/null
+++ b/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
@@ -0,0 +1,202 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * License); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cassandra.metrics;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.yammer.metrics.Metrics;
+import com.yammer.metrics.core.*;
+import com.yammer.metrics.stats.Snapshot;
+
+import org.apache.cassandra.db.ColumnFamilyStore;
+import org.apache.cassandra.db.Keyspace;
+
+/**
+ * Metrics for {@link ColumnFamilyStore}.
+ */
+public class KeyspaceMetrics
+{
+/** Total amount of data stored in the memtable, including column related 
overhead. */
+public final GaugeLong memtableDataSize;
+/** Total amount of data stored in the memtables (2i and pending flush 
memtables included). */
+public final GaugeLong allMemtablesDataSize;
+/** Total number of columns present in the memtable. */
+public final GaugeLong memtableColumnsCount;
+/** Number of times flush has resulted in the memtable being switched out. 
*/
+public final GaugeLong memtableSwitchCount;
+/** Estimated number of tasks pending for this column family */
+public final GaugeInteger pendingTasks;
+/** Estimate of number of pending compactios for this CF */
+public final GaugeInteger pendingCompactions;
+/** Disk space used by SSTables belonging to this CF */
+public final GaugeLong liveDiskSpaceUsed;
+/** Total disk space used by SSTables belonging to this CF, including 
obsolete ones waiting to be GC'd */
+public final GaugeLong totalDiskSpaceUsed;
+/** Disk space used by bloom filter */
+public final GaugeLong bloomFilterDiskSpaceUsed;
+
+private final MetricNameFactory factory;
+
+/**
+ * Creates metrics for given {@link ColumnFamilyStore}.
+ *
+ * @param ks Keyspace to measure 

[10/20] git commit: Track metrics at a keyspace level

2014-06-13 Thread brandonwilliams
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/be79ba50
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/be79ba50
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/be79ba50

Branch: refs/heads/cassandra-2.1
Commit: be79ba500e6e63ade6e337374f935e69a691086e
Parents: cecd1da
Author: Brandon Williams brandonwilli...@apache.org
Authored: Thu Jun 12 18:49:09 2014 -0500
Committer: Brandon Williams brandonwilli...@apache.org
Committed: Fri Jun 13 07:47:49 2014 -0500

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


http://git-wip-us.apache.org/repos/asf/cassandra/blob/be79ba50/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index db94066..e3bd64b 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -16,7 +16,6 @@
  * Fix infinite loop on exception while streaming (CASSANDRA-7330)
  * Reference sstables before populating key cache (CASSANDRA-7234)
 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)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/be79ba50/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 06df066..308d8ef 100644
--- a/src/java/org/apache/cassandra/db/Keyspace.java
+++ b/src/java/org/apache/cassandra/db/Keyspace.java
@@ -27,6 +27,7 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
 
 import com.google.common.base.Function;
 import com.google.common.collect.Iterables;
+import org.apache.cassandra.metrics.KeyspaceMetrics;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -63,6 +64,8 @@ public class Keyspace
  */
 public static final ReentrantReadWriteLock switchLock = new 
ReentrantReadWriteLock();
 
+public final KeyspaceMetrics metric;
+
 // It is possible to call Keyspace.open without a running daemon, so it 
makes sense to ensure
 // proper directories here as well as in CassandraDaemon.
 static
@@ -262,6 +265,7 @@ public class Keyspace
 metadata = Schema.instance.getKSMetaData(keyspaceName);
 assert metadata != null : Unknown keyspace  + keyspaceName;
 createReplicationStrategy(metadata);
+metric = new KeyspaceMetrics(this);
 
 for (CFMetaData cfm : new 
ArrayListCFMetaData(metadata.cfMetaData().values()))
 {



[02/20] git commit: Merge branch 'cassandra-2.0' into cassandra-2.1

2014-06-13 Thread brandonwilliams
Merge branch 'cassandra-2.0' into cassandra-2.1


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

Branch: refs/heads/trunk
Commit: 4e0656b0bb67ff0fad2938802bec263b8e6e09aa
Parents: 1e13cbf b93f287
Author: Jonathan Ellis jbel...@apache.org
Authored: Thu Jun 12 20:43:07 2014 -0500
Committer: Jonathan Ellis jbel...@apache.org
Committed: Thu Jun 12 20:43:07 2014 -0500

--

--




[17/20] git commit: Track metrics at a keyspace level

2014-06-13 Thread brandonwilliams
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/55c48c2a
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/55c48c2a
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/55c48c2a

Branch: refs/heads/trunk
Commit: 55c48c2a001ff659722236df5636a45a000fdb46
Parents: 68dd634
Author: Brandon Williams brandonwilli...@apache.org
Authored: Thu Jun 12 18:49:09 2014 -0500
Committer: Brandon Williams brandonwilli...@apache.org
Committed: Fri Jun 13 07:50:06 2014 -0500

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


http://git-wip-us.apache.org/repos/asf/cassandra/blob/55c48c2a/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 147a096..35c02f9 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -19,7 +19,6 @@ Merged from 2.0:
  * Make StreamSession#closeSession() idempotent (CASSANDRA-7262)
  * 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)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/55c48c2a/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 1c89cc4..cfae05c 100644
--- a/src/java/org/apache/cassandra/db/Keyspace.java
+++ b/src/java/org/apache/cassandra/db/Keyspace.java
@@ -32,6 +32,7 @@ import java.util.concurrent.Future;
 
 import com.google.common.base.Function;
 import com.google.common.collect.Iterables;
+import org.apache.cassandra.metrics.KeyspaceMetrics;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -62,6 +63,8 @@ public class Keyspace
 
 private static final Logger logger = 
LoggerFactory.getLogger(Keyspace.class);
 
+public final KeyspaceMetrics metric;
+
 // It is possible to call Keyspace.open without a running daemon, so it 
makes sense to ensure
 // proper directories here as well as in CassandraDaemon.
 static
@@ -270,6 +273,7 @@ public class Keyspace
 metadata = Schema.instance.getKSMetaData(keyspaceName);
 assert metadata != null : Unknown keyspace  + keyspaceName;
 createReplicationStrategy(metadata);
+metric = new KeyspaceMetrics(this);
 
 for (CFMetaData cfm : new 
ArrayListCFMetaData(metadata.cfMetaData().values()))
 {



[20/20] git commit: Merge branch 'cassandra-2.1' into trunk

2014-06-13 Thread brandonwilliams
Merge branch 'cassandra-2.1' into trunk

Conflicts:
CHANGES.txt
src/java/org/apache/cassandra/db/Keyspace.java
src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java


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

Branch: refs/heads/trunk
Commit: 3aa030593a6ad1d8de0704c692dab8e90681c192
Parents: e428ae0 30d3623
Author: Brandon Williams brandonwilli...@apache.org
Authored: Fri Jun 13 07:53:40 2014 -0500
Committer: Brandon Williams brandonwilli...@apache.org
Committed: Fri Jun 13 07:53:40 2014 -0500

--
 CHANGES.txt| 2 +-
 src/java/org/apache/cassandra/db/Keyspace.java | 8 
 src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java | 4 +++-
 3 files changed, 12 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/3aa03059/CHANGES.txt
--

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3aa03059/src/java/org/apache/cassandra/db/Keyspace.java
--
diff --cc src/java/org/apache/cassandra/db/Keyspace.java
index 9e39952,2fe9197..d4ca8e0
--- a/src/java/org/apache/cassandra/db/Keyspace.java
+++ b/src/java/org/apache/cassandra/db/Keyspace.java
@@@ -64,6 -65,8 +65,11 @@@ public class Keyspac
  
  public final KeyspaceMetrics metric;
  
++ HEAD
++===
+ public final KeyspaceMetrics metric;
+ 
++ cassandra-2.1
  // It is possible to call Keyspace.open without a running daemon, so it 
makes sense to ensure
  // proper directories here as well as in CassandraDaemon.
  static

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3aa03059/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
--
diff --cc src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
index b03c32c,4a0980f..6a9cab9
--- a/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
+++ b/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
@@@ -33,17 -33,9 +33,19 @@@ import org.apache.cassandra.db.Keyspace
  public class KeyspaceMetrics
  {
  /** Total amount of data stored in the memtable, including column related 
overhead. */
 -public final GaugeLong memtableDataSize;
 +public final GaugeLong memtableLiveDataSize;
 +/** Total amount of data stored in the memtable that resides on-heap, 
including column related overhead and overwritten rows. */
 +public final GaugeLong memtableOnHeapDataSize;
 +/** Total amount of data stored in the memtable that resides off-heap, 
including column related overhead and overwritten rows. */
 +public final GaugeLong memtableOffHeapDataSize;
 +/** Total amount of data stored in the memtables (2i and pending flush 
memtables included) that resides on-heap. */
 +public final GaugeLong allMemtablesOnHeapDataSize;
 +/** Total amount of data stored in the memtables (2i and pending flush 
memtables included) that resides off-heap. */
 +public final GaugeLong allMemtablesOffHeapDataSize;
 +/** Total amount of live data stored in the memtables (2i and pending 
flush memtables included) that resides off-heap, excluding any data structure 
overhead */
 +public final GaugeLong allMemtablesLiveDataSize;
+ /** Total amount of data stored in the memtables (2i and pending flush 
memtables included). */
+ public final GaugeLong allMemtablesDataSize;
  /** Total number of columns present in the memtable. */
  public final GaugeLong memtableColumnsCount;
  /** Number of times flush has resulted in the memtable being switched 
out. */



[11/20] git commit: Track metrics at a keyspace level

2014-06-13 Thread brandonwilliams
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/be79ba50
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/be79ba50
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/be79ba50

Branch: refs/heads/cassandra-2.0
Commit: be79ba500e6e63ade6e337374f935e69a691086e
Parents: cecd1da
Author: Brandon Williams brandonwilli...@apache.org
Authored: Thu Jun 12 18:49:09 2014 -0500
Committer: Brandon Williams brandonwilli...@apache.org
Committed: Fri Jun 13 07:47:49 2014 -0500

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


http://git-wip-us.apache.org/repos/asf/cassandra/blob/be79ba50/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index db94066..e3bd64b 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -16,7 +16,6 @@
  * Fix infinite loop on exception while streaming (CASSANDRA-7330)
  * Reference sstables before populating key cache (CASSANDRA-7234)
 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)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/be79ba50/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 06df066..308d8ef 100644
--- a/src/java/org/apache/cassandra/db/Keyspace.java
+++ b/src/java/org/apache/cassandra/db/Keyspace.java
@@ -27,6 +27,7 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
 
 import com.google.common.base.Function;
 import com.google.common.collect.Iterables;
+import org.apache.cassandra.metrics.KeyspaceMetrics;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -63,6 +64,8 @@ public class Keyspace
  */
 public static final ReentrantReadWriteLock switchLock = new 
ReentrantReadWriteLock();
 
+public final KeyspaceMetrics metric;
+
 // It is possible to call Keyspace.open without a running daemon, so it 
makes sense to ensure
 // proper directories here as well as in CassandraDaemon.
 static
@@ -262,6 +265,7 @@ public class Keyspace
 metadata = Schema.instance.getKSMetaData(keyspaceName);
 assert metadata != null : Unknown keyspace  + keyspaceName;
 createReplicationStrategy(metadata);
+metric = new KeyspaceMetrics(this);
 
 for (CFMetaData cfm : new 
ArrayListCFMetaData(metadata.cfMetaData().values()))
 {



[08/20] git commit: Track metrics at a keyspace level

2014-06-13 Thread brandonwilliams
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/cecd1da3
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/cecd1da3
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/cecd1da3

Branch: refs/heads/trunk
Commit: cecd1da318f19139446db526be035fb25e1c5b12
Parents: f1aa49b
Author: Brandon Williams brandonwilli...@apache.org
Authored: Thu Jun 12 18:42:21 2014 -0500
Committer: Brandon Williams brandonwilli...@apache.org
Committed: Fri Jun 13 07:47:12 2014 -0500

--
 src/java/org/apache/cassandra/db/Keyspace.java  |   2 +-
 .../cassandra/metrics/KeyspaceMetrics.java  | 202 +++
 2 files changed, 203 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/cecd1da3/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 9651794..06df066 100644
--- a/src/java/org/apache/cassandra/db/Keyspace.java
+++ b/src/java/org/apache/cassandra/db/Keyspace.java
@@ -76,8 +76,8 @@ public class Keyspace
 /* ColumnFamilyStore per column family */
 private final ConcurrentMapUUID, ColumnFamilyStore columnFamilyStores = 
new ConcurrentHashMapUUID, ColumnFamilyStore();
 private volatile AbstractReplicationStrategy replicationStrategy;
-public static final FunctionString,Keyspace keyspaceTransformer = new 
FunctionString, Keyspace()
 public final KeyspaceMetrics metric;
+public static final FunctionString,Keyspace keyspaceTransformer = new 
FunctionString, Keyspace()
 {
 public Keyspace apply(String keyspaceName)
 {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cecd1da3/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
--
diff --git a/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java 
b/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
new file mode 100644
index 000..4a0980f
--- /dev/null
+++ b/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
@@ -0,0 +1,202 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * License); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cassandra.metrics;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.yammer.metrics.Metrics;
+import com.yammer.metrics.core.*;
+import com.yammer.metrics.stats.Snapshot;
+
+import org.apache.cassandra.db.ColumnFamilyStore;
+import org.apache.cassandra.db.Keyspace;
+
+/**
+ * Metrics for {@link ColumnFamilyStore}.
+ */
+public class KeyspaceMetrics
+{
+/** Total amount of data stored in the memtable, including column related 
overhead. */
+public final GaugeLong memtableDataSize;
+/** Total amount of data stored in the memtables (2i and pending flush 
memtables included). */
+public final GaugeLong allMemtablesDataSize;
+/** Total number of columns present in the memtable. */
+public final GaugeLong memtableColumnsCount;
+/** Number of times flush has resulted in the memtable being switched out. 
*/
+public final GaugeLong memtableSwitchCount;
+/** Estimated number of tasks pending for this column family */
+public final GaugeInteger pendingTasks;
+/** Estimate of number of pending compactios for this CF */
+public final GaugeInteger pendingCompactions;
+/** Disk space used by SSTables belonging to this CF */
+public final GaugeLong liveDiskSpaceUsed;
+/** Total disk space used by SSTables belonging to this CF, including 
obsolete ones waiting to be GC'd */
+public final GaugeLong totalDiskSpaceUsed;
+/** Disk space used by bloom filter */
+public final GaugeLong bloomFilterDiskSpaceUsed;
+
+private final MetricNameFactory factory;
+
+/**
+ * Creates metrics for given {@link ColumnFamilyStore}.
+ *
+ * @param ks Keyspace to measure metrics

[03/20] git commit: Track metrics at a keyspace level

2014-06-13 Thread brandonwilliams
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/f1aa49b9
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/f1aa49b9
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/f1aa49b9

Branch: refs/heads/cassandra-2.0
Commit: f1aa49b9f80f532307195932e6bf34f4705e6ccb
Parents: b93f287
Author: Brandon Williams brandonwilli...@apache.org
Authored: Thu Jun 12 18:42:21 2014 -0500
Committer: Brandon Williams brandonwilli...@apache.org
Committed: Fri Jun 13 07:46:20 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/f1aa49b9/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index a2a978e..db94066 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -17,6 +17,7 @@
  * Reference sstables before populating key cache (CASSANDRA-7234)
 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/f1aa49b9/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 714956a..9651794 100644
--- a/src/java/org/apache/cassandra/db/Keyspace.java
+++ b/src/java/org/apache/cassandra/db/Keyspace.java
@@ -43,6 +43,7 @@ import 
org.apache.cassandra.locator.AbstractReplicationStrategy;
 import org.apache.cassandra.service.StorageService;
 import org.apache.cassandra.service.pager.QueryPagers;
 import org.apache.cassandra.tracing.Tracing;
+import org.apache.cassandra.metrics.KeyspaceMetrics;
 
 /**
  * It represents a Keyspace.
@@ -76,6 +77,7 @@ public class Keyspace
 private final ConcurrentMapUUID, ColumnFamilyStore columnFamilyStores = 
new ConcurrentHashMapUUID, ColumnFamilyStore();
 private volatile AbstractReplicationStrategy replicationStrategy;
 public static final FunctionString,Keyspace keyspaceTransformer = new 
FunctionString, Keyspace()
+public final KeyspaceMetrics metric;
 {
 public Keyspace apply(String keyspaceName)
 {
@@ -133,6 +135,7 @@ public class Keyspace
 {
 for (ColumnFamilyStore cfs : t.getColumnFamilyStores())
 t.unloadCf(cfs);
+t.metric.release();
 }
 return t;
 }
@@ -265,6 +268,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)



[15/20] git commit: Track metrics at a keyspace level

2014-06-13 Thread brandonwilliams
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/68dd6349
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/68dd6349
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/68dd6349

Branch: refs/heads/trunk
Commit: 68dd6349551f5b26b399a80f38624e02bf89a9b4
Parents: 6eda57c
Author: Brandon Williams brandonwilli...@apache.org
Authored: Thu Jun 12 18:42:21 2014 -0500
Committer: Brandon Williams brandonwilli...@apache.org
Committed: Fri Jun 13 07:49:22 2014 -0500

--
 .../cassandra/metrics/KeyspaceMetrics.java  | 202 +++
 1 file changed, 202 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/68dd6349/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
--
diff --git a/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java 
b/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
new file mode 100644
index 000..4a0980f
--- /dev/null
+++ b/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
@@ -0,0 +1,202 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * License); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cassandra.metrics;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.yammer.metrics.Metrics;
+import com.yammer.metrics.core.*;
+import com.yammer.metrics.stats.Snapshot;
+
+import org.apache.cassandra.db.ColumnFamilyStore;
+import org.apache.cassandra.db.Keyspace;
+
+/**
+ * Metrics for {@link ColumnFamilyStore}.
+ */
+public class KeyspaceMetrics
+{
+/** Total amount of data stored in the memtable, including column related 
overhead. */
+public final GaugeLong memtableDataSize;
+/** Total amount of data stored in the memtables (2i and pending flush 
memtables included). */
+public final GaugeLong allMemtablesDataSize;
+/** Total number of columns present in the memtable. */
+public final GaugeLong memtableColumnsCount;
+/** Number of times flush has resulted in the memtable being switched out. 
*/
+public final GaugeLong memtableSwitchCount;
+/** Estimated number of tasks pending for this column family */
+public final GaugeInteger pendingTasks;
+/** Estimate of number of pending compactios for this CF */
+public final GaugeInteger pendingCompactions;
+/** Disk space used by SSTables belonging to this CF */
+public final GaugeLong liveDiskSpaceUsed;
+/** Total disk space used by SSTables belonging to this CF, including 
obsolete ones waiting to be GC'd */
+public final GaugeLong totalDiskSpaceUsed;
+/** Disk space used by bloom filter */
+public final GaugeLong bloomFilterDiskSpaceUsed;
+
+private final MetricNameFactory factory;
+
+/**
+ * Creates metrics for given {@link ColumnFamilyStore}.
+ *
+ * @param ks Keyspace to measure metrics
+ */
+public KeyspaceMetrics(final Keyspace ks)
+{
+factory = new KeyspaceMetricNameFactory(ks);
+
+memtableColumnsCount = 
Metrics.newGauge(factory.createMetricName(MemtableColumnsCount), new 
GaugeLong()
+{
+public Long value()
+{
+long total = 0;
+for (ColumnFamilyStore cf : ks.getColumnFamilyStores())
+{
+total += cf.metric.memtableColumnsCount.value();
+}
+return total;
+}
+});
+memtableDataSize = 
Metrics.newGauge(factory.createMetricName(MemtableDataSize), new GaugeLong()
+{
+public Long value()
+{
+long total = 0;
+for (ColumnFamilyStore cf : ks.getColumnFamilyStores())
+{
+total += cf.metric.memtableDataSize.value();
+}
+return total;
+}
+});
+allMemtablesDataSize = 
Metrics.newGauge(factory.createMetricName(AllMemtablesDataSize), new 

[05/20] git commit: Track metrics at a keyspace level

2014-06-13 Thread brandonwilliams
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/f1aa49b9
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/f1aa49b9
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/f1aa49b9

Branch: refs/heads/trunk
Commit: f1aa49b9f80f532307195932e6bf34f4705e6ccb
Parents: b93f287
Author: Brandon Williams brandonwilli...@apache.org
Authored: Thu Jun 12 18:42:21 2014 -0500
Committer: Brandon Williams brandonwilli...@apache.org
Committed: Fri Jun 13 07:46:20 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/f1aa49b9/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index a2a978e..db94066 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -17,6 +17,7 @@
  * Reference sstables before populating key cache (CASSANDRA-7234)
 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/f1aa49b9/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 714956a..9651794 100644
--- a/src/java/org/apache/cassandra/db/Keyspace.java
+++ b/src/java/org/apache/cassandra/db/Keyspace.java
@@ -43,6 +43,7 @@ import 
org.apache.cassandra.locator.AbstractReplicationStrategy;
 import org.apache.cassandra.service.StorageService;
 import org.apache.cassandra.service.pager.QueryPagers;
 import org.apache.cassandra.tracing.Tracing;
+import org.apache.cassandra.metrics.KeyspaceMetrics;
 
 /**
  * It represents a Keyspace.
@@ -76,6 +77,7 @@ public class Keyspace
 private final ConcurrentMapUUID, ColumnFamilyStore columnFamilyStores = 
new ConcurrentHashMapUUID, ColumnFamilyStore();
 private volatile AbstractReplicationStrategy replicationStrategy;
 public static final FunctionString,Keyspace keyspaceTransformer = new 
FunctionString, Keyspace()
+public final KeyspaceMetrics metric;
 {
 public Keyspace apply(String keyspaceName)
 {
@@ -133,6 +135,7 @@ public class Keyspace
 {
 for (ColumnFamilyStore cfs : t.getColumnFamilyStores())
 t.unloadCf(cfs);
+t.metric.release();
 }
 return t;
 }
@@ -265,6 +268,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)



[07/20] git commit: Track metrics at a keyspace level

2014-06-13 Thread brandonwilliams
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/cecd1da3
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/cecd1da3
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/cecd1da3

Branch: refs/heads/cassandra-2.1
Commit: cecd1da318f19139446db526be035fb25e1c5b12
Parents: f1aa49b
Author: Brandon Williams brandonwilli...@apache.org
Authored: Thu Jun 12 18:42:21 2014 -0500
Committer: Brandon Williams brandonwilli...@apache.org
Committed: Fri Jun 13 07:47:12 2014 -0500

--
 src/java/org/apache/cassandra/db/Keyspace.java  |   2 +-
 .../cassandra/metrics/KeyspaceMetrics.java  | 202 +++
 2 files changed, 203 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/cecd1da3/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 9651794..06df066 100644
--- a/src/java/org/apache/cassandra/db/Keyspace.java
+++ b/src/java/org/apache/cassandra/db/Keyspace.java
@@ -76,8 +76,8 @@ public class Keyspace
 /* ColumnFamilyStore per column family */
 private final ConcurrentMapUUID, ColumnFamilyStore columnFamilyStores = 
new ConcurrentHashMapUUID, ColumnFamilyStore();
 private volatile AbstractReplicationStrategy replicationStrategy;
-public static final FunctionString,Keyspace keyspaceTransformer = new 
FunctionString, Keyspace()
 public final KeyspaceMetrics metric;
+public static final FunctionString,Keyspace keyspaceTransformer = new 
FunctionString, Keyspace()
 {
 public Keyspace apply(String keyspaceName)
 {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cecd1da3/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
--
diff --git a/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java 
b/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
new file mode 100644
index 000..4a0980f
--- /dev/null
+++ b/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
@@ -0,0 +1,202 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * License); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cassandra.metrics;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.yammer.metrics.Metrics;
+import com.yammer.metrics.core.*;
+import com.yammer.metrics.stats.Snapshot;
+
+import org.apache.cassandra.db.ColumnFamilyStore;
+import org.apache.cassandra.db.Keyspace;
+
+/**
+ * Metrics for {@link ColumnFamilyStore}.
+ */
+public class KeyspaceMetrics
+{
+/** Total amount of data stored in the memtable, including column related 
overhead. */
+public final GaugeLong memtableDataSize;
+/** Total amount of data stored in the memtables (2i and pending flush 
memtables included). */
+public final GaugeLong allMemtablesDataSize;
+/** Total number of columns present in the memtable. */
+public final GaugeLong memtableColumnsCount;
+/** Number of times flush has resulted in the memtable being switched out. 
*/
+public final GaugeLong memtableSwitchCount;
+/** Estimated number of tasks pending for this column family */
+public final GaugeInteger pendingTasks;
+/** Estimate of number of pending compactios for this CF */
+public final GaugeInteger pendingCompactions;
+/** Disk space used by SSTables belonging to this CF */
+public final GaugeLong liveDiskSpaceUsed;
+/** Total disk space used by SSTables belonging to this CF, including 
obsolete ones waiting to be GC'd */
+public final GaugeLong totalDiskSpaceUsed;
+/** Disk space used by bloom filter */
+public final GaugeLong bloomFilterDiskSpaceUsed;
+
+private final MetricNameFactory factory;
+
+/**
+ * Creates metrics for given {@link ColumnFamilyStore}.
+ *
+ * @param ks Keyspace to measure 

[13/20] git commit: Track metrics at a keyspace level

2014-06-13 Thread brandonwilliams
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/trunk
Commit: 6eda57c1b612346d7936f6749b684882ec46d68e
Parents: 4e0656b
Author: Brandon Williams brandonwilli...@apache.org
Authored: Thu Jun 12 18:42:21 2014 -0500
Committer: Brandon Williams brandonwilli...@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 ConcurrentMapUUID, ColumnFamilyStore columnFamilyStores = 
new ConcurrentHashMapUUID, ColumnFamilyStore();
 private volatile AbstractReplicationStrategy replicationStrategy;
+public final KeyspaceMetrics metric;
 public static final FunctionString,Keyspace keyspaceTransformer = new 
FunctionString, 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)



[16/20] git commit: Track metrics at a keyspace level

2014-06-13 Thread brandonwilliams
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/55c48c2a
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/55c48c2a
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/55c48c2a

Branch: refs/heads/cassandra-2.1
Commit: 55c48c2a001ff659722236df5636a45a000fdb46
Parents: 68dd634
Author: Brandon Williams brandonwilli...@apache.org
Authored: Thu Jun 12 18:49:09 2014 -0500
Committer: Brandon Williams brandonwilli...@apache.org
Committed: Fri Jun 13 07:50:06 2014 -0500

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


http://git-wip-us.apache.org/repos/asf/cassandra/blob/55c48c2a/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 147a096..35c02f9 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -19,7 +19,6 @@ Merged from 2.0:
  * Make StreamSession#closeSession() idempotent (CASSANDRA-7262)
  * 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)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/55c48c2a/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 1c89cc4..cfae05c 100644
--- a/src/java/org/apache/cassandra/db/Keyspace.java
+++ b/src/java/org/apache/cassandra/db/Keyspace.java
@@ -32,6 +32,7 @@ import java.util.concurrent.Future;
 
 import com.google.common.base.Function;
 import com.google.common.collect.Iterables;
+import org.apache.cassandra.metrics.KeyspaceMetrics;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -62,6 +63,8 @@ public class Keyspace
 
 private static final Logger logger = 
LoggerFactory.getLogger(Keyspace.class);
 
+public final KeyspaceMetrics metric;
+
 // It is possible to call Keyspace.open without a running daemon, so it 
makes sense to ensure
 // proper directories here as well as in CassandraDaemon.
 static
@@ -270,6 +273,7 @@ public class Keyspace
 metadata = Schema.instance.getKSMetaData(keyspaceName);
 assert metadata != null : Unknown keyspace  + keyspaceName;
 createReplicationStrategy(metadata);
+metric = new KeyspaceMetrics(this);
 
 for (CFMetaData cfm : new 
ArrayListCFMetaData(metadata.cfMetaData().values()))
 {



[18/20] git commit: Merge branch 'cassandra-2.0' into cassandra-2.1

2014-06-13 Thread brandonwilliams
Merge branch 'cassandra-2.0' into cassandra-2.1

Conflicts:
src/java/org/apache/cassandra/db/Keyspace.java


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

Branch: refs/heads/cassandra-2.1
Commit: 30d3623bcbb2d02d2ed24351045b5d657c08d236
Parents: 55c48c2 be79ba5
Author: Brandon Williams brandonwilli...@apache.org
Authored: Fri Jun 13 07:50:41 2014 -0500
Committer: Brandon Williams brandonwilli...@apache.org
Committed: Fri Jun 13 07:50:41 2014 -0500

--
 src/java/org/apache/cassandra/db/Keyspace.java | 2 ++
 1 file changed, 2 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/30d3623b/src/java/org/apache/cassandra/db/Keyspace.java
--
diff --cc src/java/org/apache/cassandra/db/Keyspace.java
index cfae05c,308d8ef..2fe9197
--- a/src/java/org/apache/cassandra/db/Keyspace.java
+++ b/src/java/org/apache/cassandra/db/Keyspace.java
@@@ -63,8 -56,16 +63,10 @@@ public class Keyspac
  
  private static final Logger logger = 
LoggerFactory.getLogger(Keyspace.class);
  
 -/**
 - * accesses to CFS.memtable should acquire this for thread safety.
 - * CFS.maybeSwitchMemtable should aquire the writeLock; see that method 
for the full explanation.
 - * p/
 - * (Enabling fairness in the RRWL is observed to decrease throughput, so 
we leave it off.)
 - */
 -public static final ReentrantReadWriteLock switchLock = new 
ReentrantReadWriteLock();
 +public final KeyspaceMetrics metric;
  
+ public final KeyspaceMetrics metric;
+ 
  // It is possible to call Keyspace.open without a running daemon, so it 
makes sense to ensure
  // proper directories here as well as in CassandraDaemon.
  static



[09/20] git commit: Track metrics at a keyspace level

2014-06-13 Thread brandonwilliams
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/be79ba50
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/be79ba50
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/be79ba50

Branch: refs/heads/trunk
Commit: be79ba500e6e63ade6e337374f935e69a691086e
Parents: cecd1da
Author: Brandon Williams brandonwilli...@apache.org
Authored: Thu Jun 12 18:49:09 2014 -0500
Committer: Brandon Williams brandonwilli...@apache.org
Committed: Fri Jun 13 07:47:49 2014 -0500

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


http://git-wip-us.apache.org/repos/asf/cassandra/blob/be79ba50/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index db94066..e3bd64b 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -16,7 +16,6 @@
  * Fix infinite loop on exception while streaming (CASSANDRA-7330)
  * Reference sstables before populating key cache (CASSANDRA-7234)
 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)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/be79ba50/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 06df066..308d8ef 100644
--- a/src/java/org/apache/cassandra/db/Keyspace.java
+++ b/src/java/org/apache/cassandra/db/Keyspace.java
@@ -27,6 +27,7 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
 
 import com.google.common.base.Function;
 import com.google.common.collect.Iterables;
+import org.apache.cassandra.metrics.KeyspaceMetrics;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -63,6 +64,8 @@ public class Keyspace
  */
 public static final ReentrantReadWriteLock switchLock = new 
ReentrantReadWriteLock();
 
+public final KeyspaceMetrics metric;
+
 // It is possible to call Keyspace.open without a running daemon, so it 
makes sense to ensure
 // proper directories here as well as in CassandraDaemon.
 static
@@ -262,6 +265,7 @@ public class Keyspace
 metadata = Schema.instance.getKSMetaData(keyspaceName);
 assert metadata != null : Unknown keyspace  + keyspaceName;
 createReplicationStrategy(metadata);
+metric = new KeyspaceMetrics(this);
 
 for (CFMetaData cfm : new 
ArrayListCFMetaData(metadata.cfMetaData().values()))
 {



buildbot failure in ASF Buildbot on cassandra-2.0

2014-06-13 Thread buildbot
The Buildbot has detected a new failure on builder cassandra-2.0 while building 
cassandra.
Full details are available at:
 http://ci.apache.org/builders/cassandra-2.0/builds/75

Buildbot URL: http://ci.apache.org/

Buildslave for this Build: portunus_ubuntu

Build Reason: scheduler
Build Source Stamp: [branch cassandra-2.0] 
be79ba500e6e63ade6e337374f935e69a691086e
Blamelist: Brandon Williams brandonwilli...@apache.org

BUILD FAILED: failed compile

sincerely,
 -The Buildbot





buildbot failure in ASF Buildbot on cassandra-2.1

2014-06-13 Thread buildbot
The Buildbot has detected a new failure on builder cassandra-2.1 while building 
cassandra.
Full details are available at:
 http://ci.apache.org/builders/cassandra-2.1/builds/144

Buildbot URL: http://ci.apache.org/

Buildslave for this Build: portunus_ubuntu

Build Reason: scheduler
Build Source Stamp: [branch cassandra-2.1] 
30d3623bcbb2d02d2ed24351045b5d657c08d236
Blamelist: Brandon Williams brandonwilli...@apache.org

BUILD FAILED: failed compile

sincerely,
 -The Buildbot





[jira] [Commented] (CASSANDRA-7361) Cassandra locks up in full GC when you assign the entire heap to row cache

2014-06-13 Thread Jacek Furmankiewicz (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14030703#comment-14030703
 ] 

Jacek Furmankiewicz commented on CASSANDRA-7361:


For what it's worth, here are some results of our testing. I hope this will be 
helpful.

We set Cassandra to 24 GB heap, row cache to 16 GB. Lucked via numactl cpubind 
to a single NUMA node with 16 cores (on a  64 core server).

We changed all the JVM_OPTS in bin/cassandra to simply use G1 instead of all 
the other GC settings

{quote}
# enable assertions.  disabling this in production will give a modest
# performance benefit (around 5%).
JVM_OPTS=$JVM_OPTS -ea

# add the jamm javaagent
JVM_OPTS=$JVM_OPTS -javaagent:$CASSANDRA_HOME/lib/jamm-0.2.5.jar

# some JVMs will fill up their heap when accessed via JMX, see CASSANDRA-6541
JVM_OPTS=$JVM_OPTS -XX:+CMSClassUnloadingEnabled

# enable thread priorities, primarily so we can give periodic tasks
# a lower priority to avoid interfering with client workload
JVM_OPTS=$JVM_OPTS -XX:+UseThreadPriorities
# allows lowering thread priority without being root.  see
# http://tech.stolsvik.com/2010/01/linux-java-thread-priorities-workaround.html
JVM_OPTS=$JVM_OPTS -XX:ThreadPriorityPolicy=42

# min and max heap sizes should be set to the same value to avoid
# stop-the-world GC pauses during resize, and so that we can lock the
# heap in memory on startup to prevent any of it from being swapped
# out.
JVM_OPTS=$JVM_OPTS -Xms${MAX_HEAP_SIZE}
JVM_OPTS=$JVM_OPTS -Xmx${MAX_HEAP_SIZE}
JVM_OPTS=$JVM_OPTS -Xmn${HEAP_NEWSIZE}
JVM_OPTS=$JVM_OPTS -XX:+HeapDumpOnOutOfMemoryError

# set jvm HeapDumpPath with CASSANDRA_HEAPDUMP_DIR
if [ x$CASSANDRA_HEAPDUMP_DIR != x ]; then
JVM_OPTS=$JVM_OPTS 
-XX:HeapDumpPath=$CASSANDRA_HEAPDUMP_DIR/cassandra-`date +%s`-pid$$.hprof
fi


startswith() { [ ${1#$2} != $1 ]; }

# Per-thread stack size.
JVM_OPTS=$JVM_OPTS -Xss256k

# Larger interned string table, for gossip's benefit (CASSANDRA-6410)
JVM_OPTS=$JVM_OPTS -XX:StringTableSize=103

# GC tuning options
JVM_OPTS=$JVM_OPTS -XX:+UseG1GC
JVM_OPTS=$JVM_OPTS -XX:MaxGCPauseMillis=10

#JVM_OPTS=$JVM_OPTS -XX:+UseConcMarkSweepGC 
#JVM_OPTS=$JVM_OPTS -XX:+CMSParallelRemarkEnabled 
#JVM_OPTS=$JVM_OPTS -XX:SurvivorRatio=8 
#JVM_OPTS=$JVM_OPTS -XX:MaxTenuringThreshold=1
#JVM_OPTS=$JVM_OPTS -XX:CMSInitiatingOccupancyFraction=75
#JVM_OPTS=$JVM_OPTS -XX:+UseCMSInitiatingOccupancyOnly
#JVM_OPTS=$JVM_OPTS -XX:+UseTLAB
{quote}

NUMA settings in bin/cassandra

{quote}
NUMACTL_ARGS=--cpubind=0 --localalloc
if which numactl /dev/null 2/dev/null  numactl $NUMACTL_ARGS ls / 
/dev/null 2/dev/null
then
NUMACTL=numactl $NUMACTL_ARGS
else
NUMACTL=
fi
{quote}



Then we threw our biggest batch processing job at. It run the whole night, 
creating probably around 200 million columns during the processing run,
The writes are so large we have to increase thrift frame size to 60 MB to 
accommodate some of the largest batches.
This was also locked to a different NUMA node with 16 cores.

On top of that we threw a reader process that peels of events related to the 
creation of those 200 mln columns and synchronizes an external data destination.
We do this via a message queue in Cassandra. We use all sorts of nifty tricks 
in there to avoid tombstone exceptions during queries.
So this process did massively heavy reads while the other one was doing massive 
writes. Also NUMA locked to a different node with 16 cores.

After a whole night of processing, Cassandra was doing just fine. Not a single 
instance of STW GC occurred:

{quote}
-bash-4.1$ jstat -gc 72811 5s

 S0CS1CS0US1U  EC   EUOC OU   PC PU 
   YGC YGCTFGCFGCT GCT   
 0.0   180224.0  0.0   180224.0 6430720.0 5292032.0 18554880.0 6491303.4  
32768.0 27272.2  20270 6859.859   0  0.000 6859.859
 0.0   163840.0  0.0   163840.0 6447104.0 2957312.0 18554880.0 6524999.7  
32768.0 27272.2  20274 6860.643   0  0.000 6860.643
 0.0   172032.0  0.0   172032.0 6438912.0 5939200.0 18554880.0 6543167.4  
32768.0 27272.2  20277 6861.222   0  0.000 6861.222
 0.0   172032.0  0.0   172032.0 6438912.0 6127616.0 18554880.0 6566848.4  
32768.0 27272.2  20281 6861.806   0  0.000 6861.806
{quote}

So if you ask me, the whole off-heap row cache really does not give much, 
considering the overhead it still has to maintain within heap.

I think Cassandra should experiment with keeping the entire cache in heap 
without any Unsafe shenanigans and use G1 to manage it.

Hope this helps.




 Cassandra locks up in full GC when you assign the entire heap to row cache
 --

 Key: CASSANDRA-7361
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7361
 Project: Cassandra
  Issue Type: Bug
  Components: Core
  

[jira] [Comment Edited] (CASSANDRA-7361) Cassandra locks up in full GC when you assign the entire heap to row cache

2014-06-13 Thread Jacek Furmankiewicz (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14030703#comment-14030703
 ] 

Jacek Furmankiewicz edited comment on CASSANDRA-7361 at 6/13/14 3:06 PM:
-

For what it's worth, here are some results of our testing. I hope this will be 
helpful.

We set Cassandra to 24 GB heap, row cache to 16 GB. Lucked via numactl cpubind 
to a single NUMA node with 16 cores (on a  64 core server).

We changed all the JVM_OPTS in bin/cassandra to simply use G1 instead of all 
the other GC settings

--
# enable assertions.  disabling this in production will give a modest
# performance benefit (around 5%).
JVM_OPTS=$JVM_OPTS -ea

# add the jamm javaagent
JVM_OPTS=$JVM_OPTS -javaagent:$CASSANDRA_HOME/lib/jamm-0.2.5.jar

# some JVMs will fill up their heap when accessed via JMX, see CASSANDRA-6541
JVM_OPTS=$JVM_OPTS -XX:+CMSClassUnloadingEnabled

# enable thread priorities, primarily so we can give periodic tasks
# a lower priority to avoid interfering with client workload
JVM_OPTS=$JVM_OPTS -XX:+UseThreadPriorities
# allows lowering thread priority without being root.  see
# http://tech.stolsvik.com/2010/01/linux-java-thread-priorities-workaround.html
JVM_OPTS=$JVM_OPTS -XX:ThreadPriorityPolicy=42

# min and max heap sizes should be set to the same value to avoid
# stop-the-world GC pauses during resize, and so that we can lock the
# heap in memory on startup to prevent any of it from being swapped
# out.
JVM_OPTS=$JVM_OPTS -Xms${MAX_HEAP_SIZE}
JVM_OPTS=$JVM_OPTS -Xmx${MAX_HEAP_SIZE}
JVM_OPTS=$JVM_OPTS -Xmn${HEAP_NEWSIZE}
JVM_OPTS=$JVM_OPTS -XX:+HeapDumpOnOutOfMemoryError

# set jvm HeapDumpPath with CASSANDRA_HEAPDUMP_DIR
if [ x$CASSANDRA_HEAPDUMP_DIR != x ]; then
JVM_OPTS=$JVM_OPTS 
-XX:HeapDumpPath=$CASSANDRA_HEAPDUMP_DIR/cassandra-`date +%s`-pid$$.hprof
fi


startswith() { [ ${1#$2} != $1 ]; }

# Per-thread stack size.
JVM_OPTS=$JVM_OPTS -Xss256k

# Larger interned string table, for gossip's benefit (CASSANDRA-6410)
JVM_OPTS=$JVM_OPTS -XX:StringTableSize=103

# GC tuning options
JVM_OPTS=$JVM_OPTS -XX:+UseG1GC
JVM_OPTS=$JVM_OPTS -XX:MaxGCPauseMillis=10

#JVM_OPTS=$JVM_OPTS -XX:+UseConcMarkSweepGC 
#JVM_OPTS=$JVM_OPTS -XX:+CMSParallelRemarkEnabled 
#JVM_OPTS=$JVM_OPTS -XX:SurvivorRatio=8 
#JVM_OPTS=$JVM_OPTS -XX:MaxTenuringThreshold=1
#JVM_OPTS=$JVM_OPTS -XX:CMSInitiatingOccupancyFraction=75
#JVM_OPTS=$JVM_OPTS -XX:+UseCMSInitiatingOccupancyOnly
#JVM_OPTS=$JVM_OPTS -XX:+UseTLAB
--

NUMA settings in bin/cassandra

{quote}
NUMACTL_ARGS=--cpubind=0 --localalloc
if which numactl /dev/null 2/dev/null  numactl $NUMACTL_ARGS ls / 
/dev/null 2/dev/null
then
NUMACTL=numactl $NUMACTL_ARGS
else
NUMACTL=
fi
{quote}



Then we threw our biggest batch processing job at. It run the whole night, 
creating probably around 200 million columns during the processing run,
The writes are so large we have to increase thrift frame size to 60 MB to 
accommodate some of the largest batches.
This was also locked to a different NUMA node with 16 cores.

On top of that we threw a reader process that peels of events related to the 
creation of those 200 mln columns and synchronizes an external data destination.
We do this via a message queue in Cassandra. We use all sorts of nifty tricks 
in there to avoid tombstone exceptions during queries.
So this process did massively heavy reads while the other one was doing massive 
writes. Also NUMA locked to a different node with 16 cores.

After a whole night of processing, Cassandra was doing just fine. Not a single 
instance of STW GC occurred:

{quote}
-bash-4.1$ jstat -gc 72811 5s

 S0CS1CS0US1U  EC   EUOC OU   PC PU 
   YGC YGCTFGCFGCT GCT   
 0.0   180224.0  0.0   180224.0 6430720.0 5292032.0 18554880.0 6491303.4  
32768.0 27272.2  20270 6859.859   0  0.000 6859.859
 0.0   163840.0  0.0   163840.0 6447104.0 2957312.0 18554880.0 6524999.7  
32768.0 27272.2  20274 6860.643   0  0.000 6860.643
 0.0   172032.0  0.0   172032.0 6438912.0 5939200.0 18554880.0 6543167.4  
32768.0 27272.2  20277 6861.222   0  0.000 6861.222
 0.0   172032.0  0.0   172032.0 6438912.0 6127616.0 18554880.0 6566848.4  
32768.0 27272.2  20281 6861.806   0  0.000 6861.806
{quote}

So if you ask me, the whole off-heap row cache really does not give much, 
considering the overhead it still has to maintain within heap.

I think Cassandra should experiment with keeping the entire cache in heap 
without any Unsafe shenanigans and use G1 to manage it.

Hope this helps.





was (Author: jfurmankiewicz):
For what it's worth, here are some results of our testing. I hope this will be 
helpful.

We set Cassandra to 24 GB heap, row cache to 16 GB. Lucked via numactl cpubind 
to a single NUMA 

[jira] [Commented] (CASSANDRA-7386) JBOD threshold to prevent unbalanced disk utilization

2014-06-13 Thread Robert Stupp (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7386?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14030745#comment-14030745
 ] 

Robert Stupp commented on CASSANDRA-7386:
-

bq. we already track reads-per-sstable

So shall we add _load_ calculation to the existing metric?

 JBOD threshold to prevent unbalanced disk utilization
 -

 Key: CASSANDRA-7386
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7386
 Project: Cassandra
  Issue Type: Improvement
Reporter: Chris Lohfink
Priority: Minor
 Attachments: patch_2_1_branch_proto.diff


 Currently the pick the disks are picked first by number of current tasks, 
 then by free space.  This helps with performance but can lead to large 
 differences in utilization in some (unlikely but possible) scenarios.  Ive 
 seen 55% to 10% and heard reports of 90% to 10% on IRC.  With both LCS and 
 STCS (although my suspicion is that STCS makes it worse since harder to be 
 balanced).
 I purpose the algorithm change a little to have some maximum range of 
 utilization where it will pick by free space over load (acknowledging it can 
 be slower).  So if a disk A is 30% full and disk B is 5% full it will never 
 pick A over B until it balances out.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[2/8] git commit: fix merge

2014-06-13 Thread brandonwilliams
fix merge


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

Branch: refs/heads/cassandra-2.1
Commit: cc276fb198cbc1cddd880736a5d99f49cfcc9592
Parents: be79ba5
Author: Brandon Williams brandonwilli...@apache.org
Authored: Fri Jun 13 11:17:51 2014 -0500
Committer: Brandon Williams brandonwilli...@apache.org
Committed: Fri Jun 13 11:17:51 2014 -0500

--
 src/java/org/apache/cassandra/db/Keyspace.java | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/cc276fb1/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 308d8ef..a6da637 100644
--- a/src/java/org/apache/cassandra/db/Keyspace.java
+++ b/src/java/org/apache/cassandra/db/Keyspace.java
@@ -27,7 +27,6 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
 
 import com.google.common.base.Function;
 import com.google.common.collect.Iterables;
-import org.apache.cassandra.metrics.KeyspaceMetrics;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -79,7 +78,7 @@ public class Keyspace
 /* ColumnFamilyStore per column family */
 private final ConcurrentMapUUID, ColumnFamilyStore columnFamilyStores = 
new ConcurrentHashMapUUID, ColumnFamilyStore();
 private volatile AbstractReplicationStrategy replicationStrategy;
-public final KeyspaceMetrics metric;
+
 public static final FunctionString,Keyspace keyspaceTransformer = new 
FunctionString, Keyspace()
 {
 public Keyspace apply(String keyspaceName)
@@ -265,7 +264,6 @@ public class Keyspace
 metadata = Schema.instance.getKSMetaData(keyspaceName);
 assert metadata != null : Unknown keyspace  + keyspaceName;
 createReplicationStrategy(metadata);
-metric = new KeyspaceMetrics(this);
 
 for (CFMetaData cfm : new 
ArrayListCFMetaData(metadata.cfMetaData().values()))
 {



[4/8] git commit: Merge branch 'cassandra-2.0' into cassandra-2.1

2014-06-13 Thread brandonwilliams
Merge branch 'cassandra-2.0' into cassandra-2.1


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

Branch: refs/heads/cassandra-2.1
Commit: 12025b7ae7e1251bf07dba7652ef1390a6900af3
Parents: 30d3623 cc276fb
Author: Brandon Williams brandonwilli...@apache.org
Authored: Fri Jun 13 11:18:52 2014 -0500
Committer: Brandon Williams brandonwilli...@apache.org
Committed: Fri Jun 13 11:18:52 2014 -0500

--
 src/java/org/apache/cassandra/db/Keyspace.java | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/12025b7a/src/java/org/apache/cassandra/db/Keyspace.java
--



[6/8] git commit: fix merge

2014-06-13 Thread brandonwilliams
fix merge


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

Branch: refs/heads/trunk
Commit: 9baae7b80767b077403a75cd1c1e2589ae38b0ba
Parents: 12025b7
Author: Brandon Williams brandonwilli...@apache.org
Authored: Fri Jun 13 11:35:07 2014 -0500
Committer: Brandon Williams brandonwilli...@apache.org
Committed: Fri Jun 13 11:35:07 2014 -0500

--
 src/java/org/apache/cassandra/db/Keyspace.java  |  2 -
 .../cassandra/metrics/KeyspaceMetrics.java  | 94 +---
 2 files changed, 80 insertions(+), 16 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/9baae7b8/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 8762643..54054c5 100644
--- a/src/java/org/apache/cassandra/db/Keyspace.java
+++ b/src/java/org/apache/cassandra/db/Keyspace.java
@@ -64,8 +64,6 @@ public class Keyspace
 
 public final KeyspaceMetrics metric;
 
-public final KeyspaceMetrics metric;
-
 // It is possible to call Keyspace.open without a running daemon, so it 
makes sense to ensure
 // proper directories here as well as in CassandraDaemon.
 static

http://git-wip-us.apache.org/repos/asf/cassandra/blob/9baae7b8/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
--
diff --git a/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java 
b/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
index 4a0980f..7ef8a75 100644
--- a/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
+++ b/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
@@ -32,16 +32,24 @@ import org.apache.cassandra.db.Keyspace;
  */
 public class KeyspaceMetrics
 {
-/** Total amount of data stored in the memtable, including column related 
overhead. */
-public final GaugeLong memtableDataSize;
-/** Total amount of data stored in the memtables (2i and pending flush 
memtables included). */
-public final GaugeLong allMemtablesDataSize;
+/** Total amount of live data stored in the memtable, excluding any data 
structure overhead */
+public final GaugeLong memtableLiveDataSize;
+/** Total amount of data stored in the memtable that resides on-heap, 
including column related overhead and overwritten rows. */
+public final GaugeLong memtableOnHeapDataSize;
+/** Total amount of data stored in the memtable that resides off-heap, 
including column related overhead and overwritten rows. */
+public final GaugeLong memtableOffHeapDataSize;
+/** Total amount of live data stored in the memtables (2i and pending 
flush memtables included) that resides off-heap, excluding any data structure 
overhead */
+public final GaugeLong allMemtablesLiveDataSize;
+/** Total amount of data stored in the memtables (2i and pending flush 
memtables included) that resides on-heap. */
+public final GaugeLong allMemtablesOnHeapDataSize;
+/** Total amount of data stored in the memtables (2i and pending flush 
memtables included) that resides off-heap. */
+public final GaugeLong allMemtablesOffHeapDataSize;
 /** Total number of columns present in the memtable. */
 public final GaugeLong memtableColumnsCount;
 /** Number of times flush has resulted in the memtable being switched out. 
*/
 public final GaugeLong memtableSwitchCount;
 /** Estimated number of tasks pending for this column family */
-public final GaugeInteger pendingTasks;
+public final GaugeInteger pendingFlushes;
 /** Estimate of number of pending compactios for this CF */
 public final GaugeInteger pendingCompactions;
 /** Disk space used by SSTables belonging to this CF */
@@ -74,26 +82,74 @@ public class KeyspaceMetrics
 return total;
 }
 });
-memtableDataSize = 
Metrics.newGauge(factory.createMetricName(MemtableDataSize), new GaugeLong()
+memtableLiveDataSize = 
Metrics.newGauge(factory.createMetricName(MemtableLiveDataSize), new 
GaugeLong()
 {
 public Long value()
 {
 long total = 0;
 for (ColumnFamilyStore cf : ks.getColumnFamilyStores())
 {
-total += cf.metric.memtableDataSize.value();
+total += cf.metric.memtableLiveDataSize.value();
 }
 return total;
 }
 });
-allMemtablesDataSize = 

[7/8] git commit: fix merge

2014-06-13 Thread brandonwilliams
fix merge


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

Branch: refs/heads/cassandra-2.1
Commit: 9baae7b80767b077403a75cd1c1e2589ae38b0ba
Parents: 12025b7
Author: Brandon Williams brandonwilli...@apache.org
Authored: Fri Jun 13 11:35:07 2014 -0500
Committer: Brandon Williams brandonwilli...@apache.org
Committed: Fri Jun 13 11:35:07 2014 -0500

--
 src/java/org/apache/cassandra/db/Keyspace.java  |  2 -
 .../cassandra/metrics/KeyspaceMetrics.java  | 94 +---
 2 files changed, 80 insertions(+), 16 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/9baae7b8/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 8762643..54054c5 100644
--- a/src/java/org/apache/cassandra/db/Keyspace.java
+++ b/src/java/org/apache/cassandra/db/Keyspace.java
@@ -64,8 +64,6 @@ public class Keyspace
 
 public final KeyspaceMetrics metric;
 
-public final KeyspaceMetrics metric;
-
 // It is possible to call Keyspace.open without a running daemon, so it 
makes sense to ensure
 // proper directories here as well as in CassandraDaemon.
 static

http://git-wip-us.apache.org/repos/asf/cassandra/blob/9baae7b8/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
--
diff --git a/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java 
b/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
index 4a0980f..7ef8a75 100644
--- a/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
+++ b/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
@@ -32,16 +32,24 @@ import org.apache.cassandra.db.Keyspace;
  */
 public class KeyspaceMetrics
 {
-/** Total amount of data stored in the memtable, including column related 
overhead. */
-public final GaugeLong memtableDataSize;
-/** Total amount of data stored in the memtables (2i and pending flush 
memtables included). */
-public final GaugeLong allMemtablesDataSize;
+/** Total amount of live data stored in the memtable, excluding any data 
structure overhead */
+public final GaugeLong memtableLiveDataSize;
+/** Total amount of data stored in the memtable that resides on-heap, 
including column related overhead and overwritten rows. */
+public final GaugeLong memtableOnHeapDataSize;
+/** Total amount of data stored in the memtable that resides off-heap, 
including column related overhead and overwritten rows. */
+public final GaugeLong memtableOffHeapDataSize;
+/** Total amount of live data stored in the memtables (2i and pending 
flush memtables included) that resides off-heap, excluding any data structure 
overhead */
+public final GaugeLong allMemtablesLiveDataSize;
+/** Total amount of data stored in the memtables (2i and pending flush 
memtables included) that resides on-heap. */
+public final GaugeLong allMemtablesOnHeapDataSize;
+/** Total amount of data stored in the memtables (2i and pending flush 
memtables included) that resides off-heap. */
+public final GaugeLong allMemtablesOffHeapDataSize;
 /** Total number of columns present in the memtable. */
 public final GaugeLong memtableColumnsCount;
 /** Number of times flush has resulted in the memtable being switched out. 
*/
 public final GaugeLong memtableSwitchCount;
 /** Estimated number of tasks pending for this column family */
-public final GaugeInteger pendingTasks;
+public final GaugeInteger pendingFlushes;
 /** Estimate of number of pending compactios for this CF */
 public final GaugeInteger pendingCompactions;
 /** Disk space used by SSTables belonging to this CF */
@@ -74,26 +82,74 @@ public class KeyspaceMetrics
 return total;
 }
 });
-memtableDataSize = 
Metrics.newGauge(factory.createMetricName(MemtableDataSize), new GaugeLong()
+memtableLiveDataSize = 
Metrics.newGauge(factory.createMetricName(MemtableLiveDataSize), new 
GaugeLong()
 {
 public Long value()
 {
 long total = 0;
 for (ColumnFamilyStore cf : ks.getColumnFamilyStores())
 {
-total += cf.metric.memtableDataSize.value();
+total += cf.metric.memtableLiveDataSize.value();
 }
 return total;
 }
 });
-allMemtablesDataSize = 

[3/8] git commit: fix merge

2014-06-13 Thread brandonwilliams
fix merge


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

Branch: refs/heads/trunk
Commit: cc276fb198cbc1cddd880736a5d99f49cfcc9592
Parents: be79ba5
Author: Brandon Williams brandonwilli...@apache.org
Authored: Fri Jun 13 11:17:51 2014 -0500
Committer: Brandon Williams brandonwilli...@apache.org
Committed: Fri Jun 13 11:17:51 2014 -0500

--
 src/java/org/apache/cassandra/db/Keyspace.java | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/cc276fb1/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 308d8ef..a6da637 100644
--- a/src/java/org/apache/cassandra/db/Keyspace.java
+++ b/src/java/org/apache/cassandra/db/Keyspace.java
@@ -27,7 +27,6 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
 
 import com.google.common.base.Function;
 import com.google.common.collect.Iterables;
-import org.apache.cassandra.metrics.KeyspaceMetrics;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -79,7 +78,7 @@ public class Keyspace
 /* ColumnFamilyStore per column family */
 private final ConcurrentMapUUID, ColumnFamilyStore columnFamilyStores = 
new ConcurrentHashMapUUID, ColumnFamilyStore();
 private volatile AbstractReplicationStrategy replicationStrategy;
-public final KeyspaceMetrics metric;
+
 public static final FunctionString,Keyspace keyspaceTransformer = new 
FunctionString, Keyspace()
 {
 public Keyspace apply(String keyspaceName)
@@ -265,7 +264,6 @@ public class Keyspace
 metadata = Schema.instance.getKSMetaData(keyspaceName);
 assert metadata != null : Unknown keyspace  + keyspaceName;
 createReplicationStrategy(metadata);
-metric = new KeyspaceMetrics(this);
 
 for (CFMetaData cfm : new 
ArrayListCFMetaData(metadata.cfMetaData().values()))
 {



[5/8] git commit: Merge branch 'cassandra-2.0' into cassandra-2.1

2014-06-13 Thread brandonwilliams
Merge branch 'cassandra-2.0' into cassandra-2.1


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

Branch: refs/heads/trunk
Commit: 12025b7ae7e1251bf07dba7652ef1390a6900af3
Parents: 30d3623 cc276fb
Author: Brandon Williams brandonwilli...@apache.org
Authored: Fri Jun 13 11:18:52 2014 -0500
Committer: Brandon Williams brandonwilli...@apache.org
Committed: Fri Jun 13 11:18:52 2014 -0500

--
 src/java/org/apache/cassandra/db/Keyspace.java | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/12025b7a/src/java/org/apache/cassandra/db/Keyspace.java
--



[8/8] git commit: Merge branch 'cassandra-2.1' into trunk

2014-06-13 Thread brandonwilliams
Merge branch 'cassandra-2.1' into trunk

Conflicts:
src/java/org/apache/cassandra/db/Keyspace.java
src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java


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

Branch: refs/heads/trunk
Commit: 7765e0e4125aa61dd4d035f5766e451f53ac2c20
Parents: 3aa0305 9baae7b
Author: Brandon Williams brandonwilli...@apache.org
Authored: Fri Jun 13 11:38:46 2014 -0500
Committer: Brandon Williams brandonwilli...@apache.org
Committed: Fri Jun 13 11:38:46 2014 -0500

--
 src/java/org/apache/cassandra/db/Keyspace.java | 9 +
 src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java | 2 --
 2 files changed, 1 insertion(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/7765e0e4/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
--
diff --cc src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
index 6a9cab9,7ef8a75..384e6c6
--- a/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
+++ b/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
@@@ -42,10 -44,6 +42,8 @@@ public class KeyspaceMetric
  public final GaugeLong allMemtablesOnHeapDataSize;
  /** Total amount of data stored in the memtables (2i and pending flush 
memtables included) that resides off-heap. */
  public final GaugeLong allMemtablesOffHeapDataSize;
 +/** Total amount of live data stored in the memtables (2i and pending 
flush memtables included) that resides off-heap, excluding any data structure 
overhead */
 +public final GaugeLong allMemtablesLiveDataSize;
- /** Total amount of data stored in the memtables (2i and pending flush 
memtables included). */
- public final GaugeLong allMemtablesDataSize;
  /** Total number of columns present in the memtable. */
  public final GaugeLong memtableColumnsCount;
  /** Number of times flush has resulted in the memtable being switched 
out. */



[1/8] git commit: fix merge

2014-06-13 Thread brandonwilliams
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.0 be79ba500 - cc276fb19
  refs/heads/cassandra-2.1 30d3623bc - 9baae7b80
  refs/heads/trunk 3aa030593 - 7765e0e41


fix merge


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

Branch: refs/heads/cassandra-2.0
Commit: cc276fb198cbc1cddd880736a5d99f49cfcc9592
Parents: be79ba5
Author: Brandon Williams brandonwilli...@apache.org
Authored: Fri Jun 13 11:17:51 2014 -0500
Committer: Brandon Williams brandonwilli...@apache.org
Committed: Fri Jun 13 11:17:51 2014 -0500

--
 src/java/org/apache/cassandra/db/Keyspace.java | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/cc276fb1/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 308d8ef..a6da637 100644
--- a/src/java/org/apache/cassandra/db/Keyspace.java
+++ b/src/java/org/apache/cassandra/db/Keyspace.java
@@ -27,7 +27,6 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
 
 import com.google.common.base.Function;
 import com.google.common.collect.Iterables;
-import org.apache.cassandra.metrics.KeyspaceMetrics;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -79,7 +78,7 @@ public class Keyspace
 /* ColumnFamilyStore per column family */
 private final ConcurrentMapUUID, ColumnFamilyStore columnFamilyStores = 
new ConcurrentHashMapUUID, ColumnFamilyStore();
 private volatile AbstractReplicationStrategy replicationStrategy;
-public final KeyspaceMetrics metric;
+
 public static final FunctionString,Keyspace keyspaceTransformer = new 
FunctionString, Keyspace()
 {
 public Keyspace apply(String keyspaceName)
@@ -265,7 +264,6 @@ public class Keyspace
 metadata = Schema.instance.getKSMetaData(keyspaceName);
 assert metadata != null : Unknown keyspace  + keyspaceName;
 createReplicationStrategy(metadata);
-metric = new KeyspaceMetrics(this);
 
 for (CFMetaData cfm : new 
ArrayListCFMetaData(metadata.cfMetaData().values()))
 {



[1/3] git commit: fix typos

2014-06-13 Thread brandonwilliams
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 9baae7b80 - a8f5278c8
  refs/heads/trunk 7765e0e41 - b47d8a8c4


fix typos


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

Branch: refs/heads/cassandra-2.1
Commit: a8f5278c8c7253ff5bd707a6b8b9fd508545fe73
Parents: 9baae7b
Author: Brandon Williams brandonwilli...@apache.org
Authored: Fri Jun 13 11:47:27 2014 -0500
Committer: Brandon Williams brandonwilli...@apache.org
Committed: Fri Jun 13 11:47:27 2014 -0500

--
 src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/a8f5278c/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
--
diff --git a/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java 
b/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
index 7ef8a75..718e6f4 100644
--- a/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
+++ b/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
@@ -106,7 +106,7 @@ public class KeyspaceMetrics
 return total;
 }
 });
-memtableOffHeapDataSize = 
Metrics.newGauge(factory.createMetricName(MemtableiOffHeapDataSize), new 
GaugeLong()
+memtableOffHeapDataSize = 
Metrics.newGauge(factory.createMetricName(MemtableOffHeapDataSize), new 
GaugeLong()
 {
 public Long value()
 {
@@ -229,12 +229,13 @@ public class KeyspaceMetrics
  */
 public void release()
 {
-
Metrics.defaultRegistry().removeMetric(factory.createMetricName(AllMemtablesLiveDateSize));
+
Metrics.defaultRegistry().removeMetric(factory.createMetricName(AllMemtablesLiveDataSize));
 
Metrics.defaultRegistry().removeMetric(factory.createMetricName(AllMemtablesOnHeapDataSize));
 
Metrics.defaultRegistry().removeMetric(factory.createMetricName(AllMemtablesOffHeapDataSize));
 
Metrics.defaultRegistry().removeMetric(factory.createMetricName(MemtableLiveDataSize));
 
Metrics.defaultRegistry().removeMetric(factory.createMetricName(MemtableOnHeapDataSize));
 
Metrics.defaultRegistry().removeMetric(factory.createMetricName(MemtableOffHeapDataSize));
+
Metrics.defaultRegistry().removeMetric(factory.createMetricName(MemtableColumnsCount));
 
Metrics.defaultRegistry().removeMetric(factory.createMetricName(MemtableSwitchCount));
 
Metrics.defaultRegistry().removeMetric(factory.createMetricName(PendingFlushes));
 
Metrics.defaultRegistry().removeMetric(factory.createMetricName(PendingCompactions));



[2/3] git commit: fix typos

2014-06-13 Thread brandonwilliams
fix typos


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

Branch: refs/heads/trunk
Commit: a8f5278c8c7253ff5bd707a6b8b9fd508545fe73
Parents: 9baae7b
Author: Brandon Williams brandonwilli...@apache.org
Authored: Fri Jun 13 11:47:27 2014 -0500
Committer: Brandon Williams brandonwilli...@apache.org
Committed: Fri Jun 13 11:47:27 2014 -0500

--
 src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/a8f5278c/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
--
diff --git a/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java 
b/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
index 7ef8a75..718e6f4 100644
--- a/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
+++ b/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
@@ -106,7 +106,7 @@ public class KeyspaceMetrics
 return total;
 }
 });
-memtableOffHeapDataSize = 
Metrics.newGauge(factory.createMetricName(MemtableiOffHeapDataSize), new 
GaugeLong()
+memtableOffHeapDataSize = 
Metrics.newGauge(factory.createMetricName(MemtableOffHeapDataSize), new 
GaugeLong()
 {
 public Long value()
 {
@@ -229,12 +229,13 @@ public class KeyspaceMetrics
  */
 public void release()
 {
-
Metrics.defaultRegistry().removeMetric(factory.createMetricName(AllMemtablesLiveDateSize));
+
Metrics.defaultRegistry().removeMetric(factory.createMetricName(AllMemtablesLiveDataSize));
 
Metrics.defaultRegistry().removeMetric(factory.createMetricName(AllMemtablesOnHeapDataSize));
 
Metrics.defaultRegistry().removeMetric(factory.createMetricName(AllMemtablesOffHeapDataSize));
 
Metrics.defaultRegistry().removeMetric(factory.createMetricName(MemtableLiveDataSize));
 
Metrics.defaultRegistry().removeMetric(factory.createMetricName(MemtableOnHeapDataSize));
 
Metrics.defaultRegistry().removeMetric(factory.createMetricName(MemtableOffHeapDataSize));
+
Metrics.defaultRegistry().removeMetric(factory.createMetricName(MemtableColumnsCount));
 
Metrics.defaultRegistry().removeMetric(factory.createMetricName(MemtableSwitchCount));
 
Metrics.defaultRegistry().removeMetric(factory.createMetricName(PendingFlushes));
 
Metrics.defaultRegistry().removeMetric(factory.createMetricName(PendingCompactions));



[3/3] git commit: Merge branch 'cassandra-2.1' into trunk

2014-06-13 Thread brandonwilliams
Merge branch 'cassandra-2.1' into trunk

Conflicts:
src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java


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

Branch: refs/heads/trunk
Commit: b47d8a8c45724e4ad2575608c78070f5fe4da030
Parents: 7765e0e a8f5278
Author: Brandon Williams brandonwilli...@apache.org
Authored: Fri Jun 13 11:49:33 2014 -0500
Committer: Brandon Williams brandonwilli...@apache.org
Committed: Fri Jun 13 11:49:33 2014 -0500

--
 src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/b47d8a8c/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
--
diff --cc src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
index 384e6c6,718e6f4..c5afcc1
--- a/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
+++ b/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
@@@ -232,11 -235,10 +235,9 @@@ public class KeyspaceMetric
  
Metrics.defaultRegistry().removeMetric(factory.createMetricName(MemtableLiveDataSize));
  
Metrics.defaultRegistry().removeMetric(factory.createMetricName(MemtableOnHeapDataSize));
  
Metrics.defaultRegistry().removeMetric(factory.createMetricName(MemtableOffHeapDataSize));
- 
Metrics.defaultRegistry().removeMetric(factory.createMetricName(AllMemtablesOnHeapDataSize));
- 
Metrics.defaultRegistry().removeMetric(factory.createMetricName(AllMemtablesOffHeapDataSize));
- 
Metrics.defaultRegistry().removeMetric(factory.createMetricName(AllMemtablesLiveDataSize));
+ 
Metrics.defaultRegistry().removeMetric(factory.createMetricName(MemtableColumnsCount));
  
Metrics.defaultRegistry().removeMetric(factory.createMetricName(MemtableSwitchCount));
  
Metrics.defaultRegistry().removeMetric(factory.createMetricName(PendingFlushes));
 -
Metrics.defaultRegistry().removeMetric(factory.createMetricName(PendingCompactions));
  
Metrics.defaultRegistry().removeMetric(factory.createMetricName(LiveDiskSpaceUsed));
  
Metrics.defaultRegistry().removeMetric(factory.createMetricName(TotalDiskSpaceUsed));
  
Metrics.defaultRegistry().removeMetric(factory.createMetricName(BloomFilterDiskSpaceUsed));



[jira] [Commented] (CASSANDRA-7373) Commit logs no longer deleting and MemtablePostFlusher pending growing

2014-06-13 Thread Jeff Griffith (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7373?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14030855#comment-14030855
 ] 

Jeff Griffith commented on CASSANDRA-7373:
--

[~mishail] [~jbellis]  Is there already a separate bug for the second patch 
where the extend fails or should I create one?

 Commit logs no longer deleting and MemtablePostFlusher pending growing
 --

 Key: CASSANDRA-7373
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7373
 Project: Cassandra
  Issue Type: Bug
  Components: Core
 Environment: RHEL 6.5
 Cassandra 1.12.16
 Replication factor of 3
Reporter: Francois Richard
Assignee: Mikhail Stepura
 Fix For: 1.2.17, 2.0.9, 2.1.0

 Attachments: 0001-Move-latch.countDown-into-finally-block.patch, 
 0002-Handle-possible-integer-overflow.patch, 7373-v2.txt


 We have this issue where once in a while, we get into a situation where the 
 MemtablePostFlusher is not executing and the space used by the commit logs on 
 disks keeps on increasing and increasing.
 We can observe the problem by invoking nodetool tpstats:
 {code}
 Pool NameActive   Pending  Completed   Blocked  All 
 time blocked
 ReadStage 6 6   46650213 0
  0
 RequestResponseStage  0 0  130547421 0
  0
 MutationStage 2 2  116813206 0
  0
 ReadRepairStage   0 02322201 0
  0
 ReplicateOnWriteStage 0 0  0 0
  0
 GossipStage   0 0 120780 0
  0
 AntiEntropyStage  0 0  0 0
  0
 MigrationStage0 0  0 0
  0
 MemoryMeter   0 0456 0
  0
 MemtablePostFlusher   1   447   6344 0
  0
 FlushWriter   0 0   6132 0
 62
 MiscStage 0 0  0 0
  0
 PendingRangeCalculator0 0  6 0
  0
 commitlog_archiver0 0  0 0
  0
 InternalResponseStage 0 0  0 0
  0
 HintedHandoff 2 2  4 0
  0
 Message type   Dropped
 RANGE_SLICE  0
 READ_REPAIR  0
 BINARY   0
 READ 0
 MUTATION 0
 _TRACE   0
 REQUEST_RESPONSE 0
 COUNTER_MUTATION 0
 {code}
 Here is a potential error in the logs that can explain this:
 {code}
 ERROR [FlushWriter:2693] 2014-06-09 22:05:38,452 CassandraDaemon.java (line 
 191) Exception in thread Thread[FlushWriter:2693,5,main]
 java.lang.NegativeArraySizeException
   at 
 org.apache.cassandra.io.util.FastByteArrayOutputStream.expand(FastByteArrayOutputStream.java:104)
   at 
 org.apache.cassandra.io.util.FastByteArrayOutputStream.write(FastByteArrayOutputStream.java:220)
   at java.io.DataOutputStream.write(DataOutputStream.java:107)
   at 
 org.apache.cassandra.io.util.DataOutputBuffer.write(DataOutputBuffer.java:60)
   at 
 org.apache.cassandra.utils.ByteBufferUtil.write(ByteBufferUtil.java:328)
   at 
 org.apache.cassandra.utils.ByteBufferUtil.writeWithLength(ByteBufferUtil.java:315)
   at 
 org.apache.cassandra.db.ColumnSerializer.serialize(ColumnSerializer.java:55)
   at 
 org.apache.cassandra.db.ColumnSerializer.serialize(ColumnSerializer.java:30)
   at 
 org.apache.cassandra.db.OnDiskAtom$Serializer.serializeForSSTable(OnDiskAtom.java:62)
   at org.apache.cassandra.db.ColumnIndex$Builder.add(ColumnIndex.java:181)
   at 
 org.apache.cassandra.db.ColumnIndex$Builder.build(ColumnIndex.java:133)
   at 
 org.apache.cassandra.io.sstable.SSTableWriter.append(SSTableWriter.java:185)
   at 
 org.apache.cassandra.db.Memtable$FlushRunnable.writeSortedContents(Memtable.java:430)
   at 
 org.apache.cassandra.db.Memtable$FlushRunnable.runWith(Memtable.java:385)
   at 
 org.apache.cassandra.io.util.DiskAwareRunnable.runMayThrow(DiskAwareRunnable.java:48)
 {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Comment Edited] (CASSANDRA-7373) Commit logs no longer deleting and MemtablePostFlusher pending growing

2014-06-13 Thread Jeff Griffith (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7373?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14030855#comment-14030855
 ] 

Jeff Griffith edited comment on CASSANDRA-7373 at 6/13/14 5:10 PM:
---

[~mishail] [~jbellis]  Is there already a separate bug for the second patch 
where the extend fails or should I create one?Or perhaps this one (7373) 
serves the purpose and 7275 fixes the CDL problem.


was (Author: jeffery.griffith):
[~mishail] [~jbellis]  Is there already a separate bug for the second patch 
where the extend fails or should I create one?

 Commit logs no longer deleting and MemtablePostFlusher pending growing
 --

 Key: CASSANDRA-7373
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7373
 Project: Cassandra
  Issue Type: Bug
  Components: Core
 Environment: RHEL 6.5
 Cassandra 1.12.16
 Replication factor of 3
Reporter: Francois Richard
Assignee: Mikhail Stepura
 Fix For: 1.2.17, 2.0.9, 2.1.0

 Attachments: 0001-Move-latch.countDown-into-finally-block.patch, 
 0002-Handle-possible-integer-overflow.patch, 7373-v2.txt


 We have this issue where once in a while, we get into a situation where the 
 MemtablePostFlusher is not executing and the space used by the commit logs on 
 disks keeps on increasing and increasing.
 We can observe the problem by invoking nodetool tpstats:
 {code}
 Pool NameActive   Pending  Completed   Blocked  All 
 time blocked
 ReadStage 6 6   46650213 0
  0
 RequestResponseStage  0 0  130547421 0
  0
 MutationStage 2 2  116813206 0
  0
 ReadRepairStage   0 02322201 0
  0
 ReplicateOnWriteStage 0 0  0 0
  0
 GossipStage   0 0 120780 0
  0
 AntiEntropyStage  0 0  0 0
  0
 MigrationStage0 0  0 0
  0
 MemoryMeter   0 0456 0
  0
 MemtablePostFlusher   1   447   6344 0
  0
 FlushWriter   0 0   6132 0
 62
 MiscStage 0 0  0 0
  0
 PendingRangeCalculator0 0  6 0
  0
 commitlog_archiver0 0  0 0
  0
 InternalResponseStage 0 0  0 0
  0
 HintedHandoff 2 2  4 0
  0
 Message type   Dropped
 RANGE_SLICE  0
 READ_REPAIR  0
 BINARY   0
 READ 0
 MUTATION 0
 _TRACE   0
 REQUEST_RESPONSE 0
 COUNTER_MUTATION 0
 {code}
 Here is a potential error in the logs that can explain this:
 {code}
 ERROR [FlushWriter:2693] 2014-06-09 22:05:38,452 CassandraDaemon.java (line 
 191) Exception in thread Thread[FlushWriter:2693,5,main]
 java.lang.NegativeArraySizeException
   at 
 org.apache.cassandra.io.util.FastByteArrayOutputStream.expand(FastByteArrayOutputStream.java:104)
   at 
 org.apache.cassandra.io.util.FastByteArrayOutputStream.write(FastByteArrayOutputStream.java:220)
   at java.io.DataOutputStream.write(DataOutputStream.java:107)
   at 
 org.apache.cassandra.io.util.DataOutputBuffer.write(DataOutputBuffer.java:60)
   at 
 org.apache.cassandra.utils.ByteBufferUtil.write(ByteBufferUtil.java:328)
   at 
 org.apache.cassandra.utils.ByteBufferUtil.writeWithLength(ByteBufferUtil.java:315)
   at 
 org.apache.cassandra.db.ColumnSerializer.serialize(ColumnSerializer.java:55)
   at 
 org.apache.cassandra.db.ColumnSerializer.serialize(ColumnSerializer.java:30)
   at 
 org.apache.cassandra.db.OnDiskAtom$Serializer.serializeForSSTable(OnDiskAtom.java:62)
   at org.apache.cassandra.db.ColumnIndex$Builder.add(ColumnIndex.java:181)
   at 
 org.apache.cassandra.db.ColumnIndex$Builder.build(ColumnIndex.java:133)
   at 
 org.apache.cassandra.io.sstable.SSTableWriter.append(SSTableWriter.java:185)
   at 
 org.apache.cassandra.db.Memtable$FlushRunnable.writeSortedContents(Memtable.java:430)
   at 
 org.apache.cassandra.db.Memtable$FlushRunnable.runWith(Memtable.java:385)
  

[jira] [Comment Edited] (CASSANDRA-7373) Commit logs no longer deleting and MemtablePostFlusher pending growing

2014-06-13 Thread Jeff Griffith (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7373?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14030855#comment-14030855
 ] 

Jeff Griffith edited comment on CASSANDRA-7373 at 6/13/14 5:11 PM:
---

[~mishail] [~jbellis]  Is there already a separate bug for the second patch 
where the extend fails or should I create one?Or perhaps this one (7373) 
serves the purpose and 7275 fixes the CDL problem?



was (Author: jeffery.griffith):
[~mishail] [~jbellis]  Is there already a separate bug for the second patch 
where the extend fails or should I create one?Or perhaps this one (7373) 
serves the purpose and 7275 fixes the CDL problem.

 Commit logs no longer deleting and MemtablePostFlusher pending growing
 --

 Key: CASSANDRA-7373
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7373
 Project: Cassandra
  Issue Type: Bug
  Components: Core
 Environment: RHEL 6.5
 Cassandra 1.12.16
 Replication factor of 3
Reporter: Francois Richard
Assignee: Mikhail Stepura
 Fix For: 1.2.17, 2.0.9, 2.1.0

 Attachments: 0001-Move-latch.countDown-into-finally-block.patch, 
 0002-Handle-possible-integer-overflow.patch, 7373-v2.txt


 We have this issue where once in a while, we get into a situation where the 
 MemtablePostFlusher is not executing and the space used by the commit logs on 
 disks keeps on increasing and increasing.
 We can observe the problem by invoking nodetool tpstats:
 {code}
 Pool NameActive   Pending  Completed   Blocked  All 
 time blocked
 ReadStage 6 6   46650213 0
  0
 RequestResponseStage  0 0  130547421 0
  0
 MutationStage 2 2  116813206 0
  0
 ReadRepairStage   0 02322201 0
  0
 ReplicateOnWriteStage 0 0  0 0
  0
 GossipStage   0 0 120780 0
  0
 AntiEntropyStage  0 0  0 0
  0
 MigrationStage0 0  0 0
  0
 MemoryMeter   0 0456 0
  0
 MemtablePostFlusher   1   447   6344 0
  0
 FlushWriter   0 0   6132 0
 62
 MiscStage 0 0  0 0
  0
 PendingRangeCalculator0 0  6 0
  0
 commitlog_archiver0 0  0 0
  0
 InternalResponseStage 0 0  0 0
  0
 HintedHandoff 2 2  4 0
  0
 Message type   Dropped
 RANGE_SLICE  0
 READ_REPAIR  0
 BINARY   0
 READ 0
 MUTATION 0
 _TRACE   0
 REQUEST_RESPONSE 0
 COUNTER_MUTATION 0
 {code}
 Here is a potential error in the logs that can explain this:
 {code}
 ERROR [FlushWriter:2693] 2014-06-09 22:05:38,452 CassandraDaemon.java (line 
 191) Exception in thread Thread[FlushWriter:2693,5,main]
 java.lang.NegativeArraySizeException
   at 
 org.apache.cassandra.io.util.FastByteArrayOutputStream.expand(FastByteArrayOutputStream.java:104)
   at 
 org.apache.cassandra.io.util.FastByteArrayOutputStream.write(FastByteArrayOutputStream.java:220)
   at java.io.DataOutputStream.write(DataOutputStream.java:107)
   at 
 org.apache.cassandra.io.util.DataOutputBuffer.write(DataOutputBuffer.java:60)
   at 
 org.apache.cassandra.utils.ByteBufferUtil.write(ByteBufferUtil.java:328)
   at 
 org.apache.cassandra.utils.ByteBufferUtil.writeWithLength(ByteBufferUtil.java:315)
   at 
 org.apache.cassandra.db.ColumnSerializer.serialize(ColumnSerializer.java:55)
   at 
 org.apache.cassandra.db.ColumnSerializer.serialize(ColumnSerializer.java:30)
   at 
 org.apache.cassandra.db.OnDiskAtom$Serializer.serializeForSSTable(OnDiskAtom.java:62)
   at org.apache.cassandra.db.ColumnIndex$Builder.add(ColumnIndex.java:181)
   at 
 org.apache.cassandra.db.ColumnIndex$Builder.build(ColumnIndex.java:133)
   at 
 org.apache.cassandra.io.sstable.SSTableWriter.append(SSTableWriter.java:185)
   at 
 org.apache.cassandra.db.Memtable$FlushRunnable.writeSortedContents(Memtable.java:430)
   

[jira] [Updated] (CASSANDRA-7016) can't map/reduce over subset of rows with cql

2014-06-13 Thread Brandon Williams (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-7016?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Brandon Williams updated CASSANDRA-7016:


Fix Version/s: 2.0.9

 can't map/reduce over subset of rows with cql
 -

 Key: CASSANDRA-7016
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7016
 Project: Cassandra
  Issue Type: Bug
  Components: Core, Hadoop
Reporter: Jonathan Halliday
Priority: Minor
 Fix For: 2.0.9


 select ... where token(k)  x and token(k) = y and k in (a,b) allow 
 filtering;
 This fails on 2.0.6: can't restrict k by more than one relation.
 In the context of map/reduce (hence the token range) I want to map over only 
 a subset of the keys (hence the 'in').  Pushing the 'in' filter down to cql 
 is substantially cheaper than pulling all rows to the client and then 
 discarding most of them.
 Currently this is possible only if the hadoop integration code is altered to 
 apply the AND on the client side and use cql that contains only the resulting 
 filtered 'in' set.  The problem is not hadoop specific though, so IMO it 
 should really be solved in cql not the hadoop integration code.
 Most restrictions on cql syntax seem to exist to prevent unduly expensive 
 queries. This one seems to be doing the opposite.
 Edit: on further thought and with reference to the code in 
 SelectStatement$RawStatement, it seems to me that  token(k) and k should be 
 considered distinct entities for the purposes of processing restrictions. 
 That is, no restriction on the token should conflict with a restriction on 
 the raw key. That way any monolithic query in terms of k and be decomposed 
 into parallel chunks over the token range for the purposes of map/reduce 
 processing simply by appending a 'and where token(k)...' clause to the 
 exiting 'where k ...'.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


buildbot success in ASF Buildbot on cassandra-2.0

2014-06-13 Thread buildbot
The Buildbot has detected a restored build on builder cassandra-2.0 while 
building cassandra.
Full details are available at:
 http://ci.apache.org/builders/cassandra-2.0/builds/76

Buildbot URL: http://ci.apache.org/

Buildslave for this Build: portunus_ubuntu

Build Reason: scheduler
Build Source Stamp: [branch cassandra-2.0] 
cc276fb198cbc1cddd880736a5d99f49cfcc9592
Blamelist: Brandon Williams brandonwilli...@apache.org

Build succeeded!

sincerely,
 -The Buildbot





buildbot success in ASF Buildbot on cassandra-trunk

2014-06-13 Thread buildbot
The Buildbot has detected a restored build on builder cassandra-trunk while 
building cassandra.
Full details are available at:
 http://ci.apache.org/builders/cassandra-trunk/builds/327

Buildbot URL: http://ci.apache.org/

Buildslave for this Build: portunus_ubuntu

Build Reason: scheduler
Build Source Stamp: [branch trunk] 7765e0e4125aa61dd4d035f5766e451f53ac2c20
Blamelist: Brandon Williams brandonwilli...@apache.org

Build succeeded!

sincerely,
 -The Buildbot





buildbot success in ASF Buildbot on cassandra-2.1

2014-06-13 Thread buildbot
The Buildbot has detected a restored build on builder cassandra-2.1 while 
building cassandra.
Full details are available at:
 http://ci.apache.org/builders/cassandra-2.1/builds/145

Buildbot URL: http://ci.apache.org/

Buildslave for this Build: portunus_ubuntu

Build Reason: scheduler
Build Source Stamp: [branch cassandra-2.1] 
9baae7b80767b077403a75cd1c1e2589ae38b0ba
Blamelist: Brandon Williams brandonwilli...@apache.org

Build succeeded!

sincerely,
 -The Buildbot





[jira] [Updated] (CASSANDRA-7202) Update ccm for windows launch script changes from #7001

2014-06-13 Thread Philip Thompson (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-7202?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Philip Thompson updated CASSANDRA-7202:
---

Labels: Windows qa-resolved  (was: Windows)

 Update ccm for windows launch script changes from #7001
 ---

 Key: CASSANDRA-7202
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7202
 Project: Cassandra
  Issue Type: Test
  Components: Tests
Reporter: Philip Thompson
Assignee: Philip Thompson
  Labels: Windows, qa-resolved

 The new .bat launch script changes will require changes to ccm and dtests so 
 we can get windows dtests running on cassci.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (CASSANDRA-7373) Commit logs no longer deleting and MemtablePostFlusher pending growing

2014-06-13 Thread Mikhail Stepura (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7373?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14030932#comment-14030932
 ] 

Mikhail Stepura commented on CASSANDRA-7373:


[~jeffery.griffith] we'll address the extend problem in this one.

[~jbellis] which check do you mean? Are we OK with 
[^0002-Handle-possible-integer-overflow.patch] ?

 Commit logs no longer deleting and MemtablePostFlusher pending growing
 --

 Key: CASSANDRA-7373
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7373
 Project: Cassandra
  Issue Type: Bug
  Components: Core
 Environment: RHEL 6.5
 Cassandra 1.12.16
 Replication factor of 3
Reporter: Francois Richard
Assignee: Mikhail Stepura
 Fix For: 1.2.17, 2.0.9, 2.1.0

 Attachments: 0001-Move-latch.countDown-into-finally-block.patch, 
 0002-Handle-possible-integer-overflow.patch, 7373-v2.txt


 We have this issue where once in a while, we get into a situation where the 
 MemtablePostFlusher is not executing and the space used by the commit logs on 
 disks keeps on increasing and increasing.
 We can observe the problem by invoking nodetool tpstats:
 {code}
 Pool NameActive   Pending  Completed   Blocked  All 
 time blocked
 ReadStage 6 6   46650213 0
  0
 RequestResponseStage  0 0  130547421 0
  0
 MutationStage 2 2  116813206 0
  0
 ReadRepairStage   0 02322201 0
  0
 ReplicateOnWriteStage 0 0  0 0
  0
 GossipStage   0 0 120780 0
  0
 AntiEntropyStage  0 0  0 0
  0
 MigrationStage0 0  0 0
  0
 MemoryMeter   0 0456 0
  0
 MemtablePostFlusher   1   447   6344 0
  0
 FlushWriter   0 0   6132 0
 62
 MiscStage 0 0  0 0
  0
 PendingRangeCalculator0 0  6 0
  0
 commitlog_archiver0 0  0 0
  0
 InternalResponseStage 0 0  0 0
  0
 HintedHandoff 2 2  4 0
  0
 Message type   Dropped
 RANGE_SLICE  0
 READ_REPAIR  0
 BINARY   0
 READ 0
 MUTATION 0
 _TRACE   0
 REQUEST_RESPONSE 0
 COUNTER_MUTATION 0
 {code}
 Here is a potential error in the logs that can explain this:
 {code}
 ERROR [FlushWriter:2693] 2014-06-09 22:05:38,452 CassandraDaemon.java (line 
 191) Exception in thread Thread[FlushWriter:2693,5,main]
 java.lang.NegativeArraySizeException
   at 
 org.apache.cassandra.io.util.FastByteArrayOutputStream.expand(FastByteArrayOutputStream.java:104)
   at 
 org.apache.cassandra.io.util.FastByteArrayOutputStream.write(FastByteArrayOutputStream.java:220)
   at java.io.DataOutputStream.write(DataOutputStream.java:107)
   at 
 org.apache.cassandra.io.util.DataOutputBuffer.write(DataOutputBuffer.java:60)
   at 
 org.apache.cassandra.utils.ByteBufferUtil.write(ByteBufferUtil.java:328)
   at 
 org.apache.cassandra.utils.ByteBufferUtil.writeWithLength(ByteBufferUtil.java:315)
   at 
 org.apache.cassandra.db.ColumnSerializer.serialize(ColumnSerializer.java:55)
   at 
 org.apache.cassandra.db.ColumnSerializer.serialize(ColumnSerializer.java:30)
   at 
 org.apache.cassandra.db.OnDiskAtom$Serializer.serializeForSSTable(OnDiskAtom.java:62)
   at org.apache.cassandra.db.ColumnIndex$Builder.add(ColumnIndex.java:181)
   at 
 org.apache.cassandra.db.ColumnIndex$Builder.build(ColumnIndex.java:133)
   at 
 org.apache.cassandra.io.sstable.SSTableWriter.append(SSTableWriter.java:185)
   at 
 org.apache.cassandra.db.Memtable$FlushRunnable.writeSortedContents(Memtable.java:430)
   at 
 org.apache.cassandra.db.Memtable$FlushRunnable.runWith(Memtable.java:385)
   at 
 org.apache.cassandra.io.util.DiskAwareRunnable.runMayThrow(DiskAwareRunnable.java:48)
 {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[02/12] git commit: Track metrics at a keyspace level

2014-06-13 Thread brandonwilliams
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/7065b1bd
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/7065b1bd
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/7065b1bd

Branch: refs/heads/cassandra-2.1
Commit: 7065b1bdf119e07f2e64735f60ab3e3d036c00de
Parents: d509fe1
Author: Brandon Williams brandonwilli...@apache.org
Authored: Thu Jun 12 18:42:21 2014 -0500
Committer: Brandon Williams brandonwilli...@apache.org
Committed: Thu Jun 12 18:48:11 2014 -0500

--
 CHANGES.txt |   1 +
 src/java/org/apache/cassandra/db/Table.java |   4 +
 .../cassandra/metrics/KeyspaceMetrics.java  | 202 +++
 3 files changed, 207 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/7065b1bd/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index f37eda4..28b5f29 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 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/7065b1bd/src/java/org/apache/cassandra/db/Table.java
--
diff --git a/src/java/org/apache/cassandra/db/Table.java 
b/src/java/org/apache/cassandra/db/Table.java
index e6df982..611fd9a 100644
--- a/src/java/org/apache/cassandra/db/Table.java
+++ b/src/java/org/apache/cassandra/db/Table.java
@@ -42,6 +42,7 @@ import org.apache.cassandra.io.sstable.SSTableReader;
 import org.apache.cassandra.locator.AbstractReplicationStrategy;
 import org.apache.cassandra.service.StorageService;
 import org.apache.cassandra.tracing.Tracing;
+import org.apache.cassandra.metrics.KeyspaceMetrics;
 
 /**
  * It represents a Keyspace.
@@ -74,6 +75,7 @@ public class Table
 private final ConcurrentMapUUID, ColumnFamilyStore columnFamilyStores = 
new ConcurrentHashMapUUID, ColumnFamilyStore();
 private final Object[] indexLocks;
 private volatile AbstractReplicationStrategy replicationStrategy;
+public final KeyspaceMetrics metric;
 public static final FunctionString,Table tableTransformer = new 
FunctionString, Table()
 {
 public Table apply(String tableName)
@@ -132,6 +134,7 @@ public class Table
 {
 for (ColumnFamilyStore cfs : t.getColumnFamilyStores())
 t.unloadCf(cfs);
+t.metric.release();
 }
 return t;
 }
@@ -271,6 +274,7 @@ public class Table
 logger.debug(Initializing {}.{}, name, cfm.cfName);
 initCf(cfm.cfId, cfm.cfName, loadSSTables);
 }
+this.metric = new KeyspaceMetrics(this);
 }
 
 public void createReplicationStrategy(KSMetaData ksm)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7065b1bd/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
--
diff --git a/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java 
b/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
new file mode 100644
index 000..4a0980f
--- /dev/null
+++ b/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
@@ -0,0 +1,202 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * License); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cassandra.metrics;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.yammer.metrics.Metrics;
+import com.yammer.metrics.core.*;
+import com.yammer.metrics.stats.Snapshot;
+
+import org.apache.cassandra.db.ColumnFamilyStore;
+import org.apache.cassandra.db.Keyspace;
+
+/**
+ * Metrics for {@link ColumnFamilyStore}.
+ */
+public class KeyspaceMetrics
+{

[09/12] git commit: Merge branch 'cassandra-1.2' into cassandra-2.0

2014-06-13 Thread brandonwilliams
Merge branch 'cassandra-1.2' into cassandra-2.0


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

Branch: refs/heads/cassandra-2.0
Commit: cee1f674aa9bf50710dc3874c2e77698236e4734
Parents: cc276fb 593bba9
Author: Brandon Williams brandonwilli...@apache.org
Authored: Fri Jun 13 13:35:19 2014 -0500
Committer: Brandon Williams brandonwilli...@apache.org
Committed: Fri Jun 13 13:35:19 2014 -0500

--

--




[06/12] git commit: fix wrong patch commit

2014-06-13 Thread brandonwilliams
fix wrong patch commit


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

Branch: refs/heads/cassandra-1.2
Commit: 593bba94f68ce6fe5220264d5323693ce80ef6fb
Parents: 7065b1b
Author: Brandon Williams brandonwilli...@apache.org
Authored: Fri Jun 13 13:35:08 2014 -0500
Committer: Brandon Williams brandonwilli...@apache.org
Committed: Fri Jun 13 13:35:08 2014 -0500

--
 .../cassandra/metrics/KeyspaceMetrics.java  | 42 +++-
 1 file changed, 6 insertions(+), 36 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/593bba94/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
--
diff --git a/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java 
b/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
index 4a0980f..936187c 100644
--- a/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
+++ b/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
@@ -17,15 +17,12 @@
  */
 package org.apache.cassandra.metrics;
 
-import java.util.ArrayList;
-import java.util.List;
 
 import com.yammer.metrics.Metrics;
 import com.yammer.metrics.core.*;
-import com.yammer.metrics.stats.Snapshot;
 
 import org.apache.cassandra.db.ColumnFamilyStore;
-import org.apache.cassandra.db.Keyspace;
+import org.apache.cassandra.db.Table;
 
 /**
  * Metrics for {@link ColumnFamilyStore}.
@@ -34,16 +31,12 @@ public class KeyspaceMetrics
 {
 /** Total amount of data stored in the memtable, including column related 
overhead. */
 public final GaugeLong memtableDataSize;
-/** Total amount of data stored in the memtables (2i and pending flush 
memtables included). */
-public final GaugeLong allMemtablesDataSize;
 /** Total number of columns present in the memtable. */
 public final GaugeLong memtableColumnsCount;
 /** Number of times flush has resulted in the memtable being switched out. 
*/
 public final GaugeLong memtableSwitchCount;
 /** Estimated number of tasks pending for this column family */
 public final GaugeInteger pendingTasks;
-/** Estimate of number of pending compactios for this CF */
-public final GaugeInteger pendingCompactions;
 /** Disk space used by SSTables belonging to this CF */
 public final GaugeLong liveDiskSpaceUsed;
 /** Total disk space used by SSTables belonging to this CF, including 
obsolete ones waiting to be GC'd */
@@ -58,7 +51,7 @@ public class KeyspaceMetrics
  *
  * @param ks Keyspace to measure metrics
  */
-public KeyspaceMetrics(final Keyspace ks)
+public KeyspaceMetrics(final Table ks)
 {
 factory = new KeyspaceMetricNameFactory(ks);
 
@@ -86,18 +79,6 @@ public class KeyspaceMetrics
 return total;
 }
 });
-allMemtablesDataSize = 
Metrics.newGauge(factory.createMetricName(AllMemtablesDataSize), new 
GaugeLong()
-{
-public Long value()
-{
-long total = 0;
-for (ColumnFamilyStore cf : ks.getColumnFamilyStores())
-{
-total += cf.metric.allMemtablesDataSize.value();
-}
-return total;
-}
-});
 memtableSwitchCount = 
Metrics.newGauge(factory.createMetricName(MemtableSwitchCount), new 
GaugeLong()
 {
 public Long value()
@@ -108,23 +89,11 @@ public class KeyspaceMetrics
 return sum;
 }
 });
-pendingCompactions = 
Metrics.newGauge(factory.createMetricName(PendingCompactions), new 
GaugeInteger()
-{
-public Integer value()
-{
-int sum = 0;
-for (ColumnFamilyStore cf : ks.getColumnFamilyStores())
-{
-sum += cf.metric.pendingCompactions.value();
-}
-return sum;
-}
-});
 pendingTasks = 
Metrics.newGauge(factory.createMetricName(PendingTasks), new GaugeInteger()
 {
 public Integer value()
 {
-return Keyspace.switchLock.getQueueLength();
+return Table.switchLock.getQueueLength();
 }
 });
 liveDiskSpaceUsed = 
Metrics.newGauge(factory.createMetricName(LiveDiskSpaceUsed), new 
GaugeLong()
@@ -169,6 +138,7 @@ public class KeyspaceMetrics
 public void release()
 {
 
Metrics.defaultRegistry().removeMetric(factory.createMetricName(AllMemtablesDataSize));
+

[01/12] git commit: Track metrics at a keyspace level

2014-06-13 Thread brandonwilliams
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-1.2 7065b1bdf - 593bba94f
  refs/heads/cassandra-2.0 cc276fb19 - cee1f674a
  refs/heads/cassandra-2.1 a8f5278c8 - a9da3fda5
  refs/heads/trunk b47d8a8c4 - 305132946


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/7065b1bd
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/7065b1bd
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/7065b1bd

Branch: refs/heads/cassandra-2.0
Commit: 7065b1bdf119e07f2e64735f60ab3e3d036c00de
Parents: d509fe1
Author: Brandon Williams brandonwilli...@apache.org
Authored: Thu Jun 12 18:42:21 2014 -0500
Committer: Brandon Williams brandonwilli...@apache.org
Committed: Thu Jun 12 18:48:11 2014 -0500

--
 CHANGES.txt |   1 +
 src/java/org/apache/cassandra/db/Table.java |   4 +
 .../cassandra/metrics/KeyspaceMetrics.java  | 202 +++
 3 files changed, 207 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/7065b1bd/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index f37eda4..28b5f29 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 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/7065b1bd/src/java/org/apache/cassandra/db/Table.java
--
diff --git a/src/java/org/apache/cassandra/db/Table.java 
b/src/java/org/apache/cassandra/db/Table.java
index e6df982..611fd9a 100644
--- a/src/java/org/apache/cassandra/db/Table.java
+++ b/src/java/org/apache/cassandra/db/Table.java
@@ -42,6 +42,7 @@ import org.apache.cassandra.io.sstable.SSTableReader;
 import org.apache.cassandra.locator.AbstractReplicationStrategy;
 import org.apache.cassandra.service.StorageService;
 import org.apache.cassandra.tracing.Tracing;
+import org.apache.cassandra.metrics.KeyspaceMetrics;
 
 /**
  * It represents a Keyspace.
@@ -74,6 +75,7 @@ public class Table
 private final ConcurrentMapUUID, ColumnFamilyStore columnFamilyStores = 
new ConcurrentHashMapUUID, ColumnFamilyStore();
 private final Object[] indexLocks;
 private volatile AbstractReplicationStrategy replicationStrategy;
+public final KeyspaceMetrics metric;
 public static final FunctionString,Table tableTransformer = new 
FunctionString, Table()
 {
 public Table apply(String tableName)
@@ -132,6 +134,7 @@ public class Table
 {
 for (ColumnFamilyStore cfs : t.getColumnFamilyStores())
 t.unloadCf(cfs);
+t.metric.release();
 }
 return t;
 }
@@ -271,6 +274,7 @@ public class Table
 logger.debug(Initializing {}.{}, name, cfm.cfName);
 initCf(cfm.cfId, cfm.cfName, loadSSTables);
 }
+this.metric = new KeyspaceMetrics(this);
 }
 
 public void createReplicationStrategy(KSMetaData ksm)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7065b1bd/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
--
diff --git a/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java 
b/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
new file mode 100644
index 000..4a0980f
--- /dev/null
+++ b/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
@@ -0,0 +1,202 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * License); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cassandra.metrics;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.yammer.metrics.Metrics;
+import 

[11/12] git commit: Merge branch 'cassandra-2.0' into cassandra-2.1

2014-06-13 Thread brandonwilliams
Merge branch 'cassandra-2.0' into cassandra-2.1


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

Branch: refs/heads/trunk
Commit: a9da3fda5a83d8fbe3b5316f03a97dd2da6227e1
Parents: a8f5278 cee1f67
Author: Brandon Williams brandonwilli...@apache.org
Authored: Fri Jun 13 13:35:29 2014 -0500
Committer: Brandon Williams brandonwilli...@apache.org
Committed: Fri Jun 13 13:35:29 2014 -0500

--

--




[07/12] git commit: Merge branch 'cassandra-1.2' into cassandra-2.0

2014-06-13 Thread brandonwilliams
Merge branch 'cassandra-1.2' into cassandra-2.0


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

Branch: refs/heads/trunk
Commit: cee1f674aa9bf50710dc3874c2e77698236e4734
Parents: cc276fb 593bba9
Author: Brandon Williams brandonwilli...@apache.org
Authored: Fri Jun 13 13:35:19 2014 -0500
Committer: Brandon Williams brandonwilli...@apache.org
Committed: Fri Jun 13 13:35:19 2014 -0500

--

--




[12/12] git commit: Merge branch 'cassandra-2.1' into trunk

2014-06-13 Thread brandonwilliams
Merge branch 'cassandra-2.1' into trunk


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

Branch: refs/heads/trunk
Commit: 305132946d20c7c2e81f2eb80da50f7131031061
Parents: b47d8a8 a9da3fd
Author: Brandon Williams brandonwilli...@apache.org
Authored: Fri Jun 13 13:36:01 2014 -0500
Committer: Brandon Williams brandonwilli...@apache.org
Committed: Fri Jun 13 13:36:01 2014 -0500

--

--




[10/12] git commit: Merge branch 'cassandra-2.0' into cassandra-2.1

2014-06-13 Thread brandonwilliams
Merge branch 'cassandra-2.0' into cassandra-2.1


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

Branch: refs/heads/cassandra-2.1
Commit: a9da3fda5a83d8fbe3b5316f03a97dd2da6227e1
Parents: a8f5278 cee1f67
Author: Brandon Williams brandonwilli...@apache.org
Authored: Fri Jun 13 13:35:29 2014 -0500
Committer: Brandon Williams brandonwilli...@apache.org
Committed: Fri Jun 13 13:35:29 2014 -0500

--

--




[08/12] git commit: Merge branch 'cassandra-1.2' into cassandra-2.0

2014-06-13 Thread brandonwilliams
Merge branch 'cassandra-1.2' into cassandra-2.0


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

Branch: refs/heads/cassandra-2.1
Commit: cee1f674aa9bf50710dc3874c2e77698236e4734
Parents: cc276fb 593bba9
Author: Brandon Williams brandonwilli...@apache.org
Authored: Fri Jun 13 13:35:19 2014 -0500
Committer: Brandon Williams brandonwilli...@apache.org
Committed: Fri Jun 13 13:35:19 2014 -0500

--

--




[03/12] git commit: fix wrong patch commit

2014-06-13 Thread brandonwilliams
fix wrong patch commit


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

Branch: refs/heads/cassandra-2.0
Commit: 593bba94f68ce6fe5220264d5323693ce80ef6fb
Parents: 7065b1b
Author: Brandon Williams brandonwilli...@apache.org
Authored: Fri Jun 13 13:35:08 2014 -0500
Committer: Brandon Williams brandonwilli...@apache.org
Committed: Fri Jun 13 13:35:08 2014 -0500

--
 .../cassandra/metrics/KeyspaceMetrics.java  | 42 +++-
 1 file changed, 6 insertions(+), 36 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/593bba94/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
--
diff --git a/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java 
b/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
index 4a0980f..936187c 100644
--- a/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
+++ b/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
@@ -17,15 +17,12 @@
  */
 package org.apache.cassandra.metrics;
 
-import java.util.ArrayList;
-import java.util.List;
 
 import com.yammer.metrics.Metrics;
 import com.yammer.metrics.core.*;
-import com.yammer.metrics.stats.Snapshot;
 
 import org.apache.cassandra.db.ColumnFamilyStore;
-import org.apache.cassandra.db.Keyspace;
+import org.apache.cassandra.db.Table;
 
 /**
  * Metrics for {@link ColumnFamilyStore}.
@@ -34,16 +31,12 @@ public class KeyspaceMetrics
 {
 /** Total amount of data stored in the memtable, including column related 
overhead. */
 public final GaugeLong memtableDataSize;
-/** Total amount of data stored in the memtables (2i and pending flush 
memtables included). */
-public final GaugeLong allMemtablesDataSize;
 /** Total number of columns present in the memtable. */
 public final GaugeLong memtableColumnsCount;
 /** Number of times flush has resulted in the memtable being switched out. 
*/
 public final GaugeLong memtableSwitchCount;
 /** Estimated number of tasks pending for this column family */
 public final GaugeInteger pendingTasks;
-/** Estimate of number of pending compactios for this CF */
-public final GaugeInteger pendingCompactions;
 /** Disk space used by SSTables belonging to this CF */
 public final GaugeLong liveDiskSpaceUsed;
 /** Total disk space used by SSTables belonging to this CF, including 
obsolete ones waiting to be GC'd */
@@ -58,7 +51,7 @@ public class KeyspaceMetrics
  *
  * @param ks Keyspace to measure metrics
  */
-public KeyspaceMetrics(final Keyspace ks)
+public KeyspaceMetrics(final Table ks)
 {
 factory = new KeyspaceMetricNameFactory(ks);
 
@@ -86,18 +79,6 @@ public class KeyspaceMetrics
 return total;
 }
 });
-allMemtablesDataSize = 
Metrics.newGauge(factory.createMetricName(AllMemtablesDataSize), new 
GaugeLong()
-{
-public Long value()
-{
-long total = 0;
-for (ColumnFamilyStore cf : ks.getColumnFamilyStores())
-{
-total += cf.metric.allMemtablesDataSize.value();
-}
-return total;
-}
-});
 memtableSwitchCount = 
Metrics.newGauge(factory.createMetricName(MemtableSwitchCount), new 
GaugeLong()
 {
 public Long value()
@@ -108,23 +89,11 @@ public class KeyspaceMetrics
 return sum;
 }
 });
-pendingCompactions = 
Metrics.newGauge(factory.createMetricName(PendingCompactions), new 
GaugeInteger()
-{
-public Integer value()
-{
-int sum = 0;
-for (ColumnFamilyStore cf : ks.getColumnFamilyStores())
-{
-sum += cf.metric.pendingCompactions.value();
-}
-return sum;
-}
-});
 pendingTasks = 
Metrics.newGauge(factory.createMetricName(PendingTasks), new GaugeInteger()
 {
 public Integer value()
 {
-return Keyspace.switchLock.getQueueLength();
+return Table.switchLock.getQueueLength();
 }
 });
 liveDiskSpaceUsed = 
Metrics.newGauge(factory.createMetricName(LiveDiskSpaceUsed), new 
GaugeLong()
@@ -169,6 +138,7 @@ public class KeyspaceMetrics
 public void release()
 {
 
Metrics.defaultRegistry().removeMetric(factory.createMetricName(AllMemtablesDataSize));
+

[05/12] git commit: fix wrong patch commit

2014-06-13 Thread brandonwilliams
fix wrong patch commit


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

Branch: refs/heads/trunk
Commit: 593bba94f68ce6fe5220264d5323693ce80ef6fb
Parents: 7065b1b
Author: Brandon Williams brandonwilli...@apache.org
Authored: Fri Jun 13 13:35:08 2014 -0500
Committer: Brandon Williams brandonwilli...@apache.org
Committed: Fri Jun 13 13:35:08 2014 -0500

--
 .../cassandra/metrics/KeyspaceMetrics.java  | 42 +++-
 1 file changed, 6 insertions(+), 36 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/593bba94/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
--
diff --git a/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java 
b/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
index 4a0980f..936187c 100644
--- a/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
+++ b/src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java
@@ -17,15 +17,12 @@
  */
 package org.apache.cassandra.metrics;
 
-import java.util.ArrayList;
-import java.util.List;
 
 import com.yammer.metrics.Metrics;
 import com.yammer.metrics.core.*;
-import com.yammer.metrics.stats.Snapshot;
 
 import org.apache.cassandra.db.ColumnFamilyStore;
-import org.apache.cassandra.db.Keyspace;
+import org.apache.cassandra.db.Table;
 
 /**
  * Metrics for {@link ColumnFamilyStore}.
@@ -34,16 +31,12 @@ public class KeyspaceMetrics
 {
 /** Total amount of data stored in the memtable, including column related 
overhead. */
 public final GaugeLong memtableDataSize;
-/** Total amount of data stored in the memtables (2i and pending flush 
memtables included). */
-public final GaugeLong allMemtablesDataSize;
 /** Total number of columns present in the memtable. */
 public final GaugeLong memtableColumnsCount;
 /** Number of times flush has resulted in the memtable being switched out. 
*/
 public final GaugeLong memtableSwitchCount;
 /** Estimated number of tasks pending for this column family */
 public final GaugeInteger pendingTasks;
-/** Estimate of number of pending compactios for this CF */
-public final GaugeInteger pendingCompactions;
 /** Disk space used by SSTables belonging to this CF */
 public final GaugeLong liveDiskSpaceUsed;
 /** Total disk space used by SSTables belonging to this CF, including 
obsolete ones waiting to be GC'd */
@@ -58,7 +51,7 @@ public class KeyspaceMetrics
  *
  * @param ks Keyspace to measure metrics
  */
-public KeyspaceMetrics(final Keyspace ks)
+public KeyspaceMetrics(final Table ks)
 {
 factory = new KeyspaceMetricNameFactory(ks);
 
@@ -86,18 +79,6 @@ public class KeyspaceMetrics
 return total;
 }
 });
-allMemtablesDataSize = 
Metrics.newGauge(factory.createMetricName(AllMemtablesDataSize), new 
GaugeLong()
-{
-public Long value()
-{
-long total = 0;
-for (ColumnFamilyStore cf : ks.getColumnFamilyStores())
-{
-total += cf.metric.allMemtablesDataSize.value();
-}
-return total;
-}
-});
 memtableSwitchCount = 
Metrics.newGauge(factory.createMetricName(MemtableSwitchCount), new 
GaugeLong()
 {
 public Long value()
@@ -108,23 +89,11 @@ public class KeyspaceMetrics
 return sum;
 }
 });
-pendingCompactions = 
Metrics.newGauge(factory.createMetricName(PendingCompactions), new 
GaugeInteger()
-{
-public Integer value()
-{
-int sum = 0;
-for (ColumnFamilyStore cf : ks.getColumnFamilyStores())
-{
-sum += cf.metric.pendingCompactions.value();
-}
-return sum;
-}
-});
 pendingTasks = 
Metrics.newGauge(factory.createMetricName(PendingTasks), new GaugeInteger()
 {
 public Integer value()
 {
-return Keyspace.switchLock.getQueueLength();
+return Table.switchLock.getQueueLength();
 }
 });
 liveDiskSpaceUsed = 
Metrics.newGauge(factory.createMetricName(LiveDiskSpaceUsed), new 
GaugeLong()
@@ -169,6 +138,7 @@ public class KeyspaceMetrics
 public void release()
 {
 
Metrics.defaultRegistry().removeMetric(factory.createMetricName(AllMemtablesDataSize));
+

[jira] [Commented] (CASSANDRA-7266) Allow cqlsh shell ignore .cassandra permission errors and not fail to open the cqlsh shell.

2014-06-13 Thread Mikhail Stepura (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7266?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14030976#comment-14030976
 ] 

Mikhail Stepura commented on CASSANDRA-7266:


* There is still {{accessible_historyDir}} in the patch
* The patch adds trailing spaces to the line with {{self.show_line_nums = True}}
* I would prefer printing out the value of HISTORY_DIR instead of just 
`~/.cassandra`

 Allow cqlsh shell ignore .cassandra permission errors and not fail to open 
 the cqlsh shell.
 ---

 Key: CASSANDRA-7266
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7266
 Project: Cassandra
  Issue Type: Improvement
  Components: Tools
Reporter: Carolyn Jung
Priority: Minor
  Labels: lhf
 Attachments: cassandra-7266-1.patch, cassandra-7266.patch


 There is an issue with home directories not working and this is causing users 
 to not be able to execute cqlsh shell. CQLSH shell uses the .cassandra folder 
 in the user's home directory for history and currently throws error and 
 returns you to the prompt.  Below is the error:
 -bash-4.1$ cqlsh 
 Traceback (most recent call last): 
 File /usr/bin/cqlsh, line 141, in module 
 os.mkdir(HISTORY_DIR) 
 OSError: [Errno 13] Permission denied: '/home/testuser/.cassandra'
 In this example, testuser does not have access to the home directory.
 Requested resolution is to allow a user to access the cqlsh shell even though 
 the home directory is inaccessible.
 The current workaround is to gain access to the home directory.  This is not 
 acceptable in all cases because of security policies of the organization.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


buildbot failure in ASF Buildbot on cassandra-trunk

2014-06-13 Thread buildbot
The Buildbot has detected a new failure on builder cassandra-trunk while 
building cassandra.
Full details are available at:
 http://ci.apache.org/builders/cassandra-trunk/builds/329

Buildbot URL: http://ci.apache.org/

Buildslave for this Build: portunus_ubuntu

Build Reason: scheduler
Build Source Stamp: [branch trunk] 305132946d20c7c2e81f2eb80da50f7131031061
Blamelist: Brandon Williams brandonwilli...@apache.org

BUILD FAILED: failed shell

sincerely,
 -The Buildbot





[jira] [Commented] (CASSANDRA-7389) BitSetTest fails on Windows

2014-06-13 Thread Ala' Alkhaldi (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14031087#comment-14031087
 ] 

Ala' Alkhaldi commented on CASSANDRA-7389:
--

BitSetTest.compareBitSets uses KeyGenerator.WordGenerator to fill the 
BloomFilters. KeyGenerator.WordGenerator relies on linux  \usr\share\dict\words 
file for retrieving the word list which is not available in Windows.
Since the strings inserted to the bloomFilters do not need to be English words 
for the test to work, I replaced the KeyGenerator.WordGenerator with 
KeyGenerator.RandomStringGenerator. Please check the attached patch.



 BitSetTest fails on Windows
 ---

 Key: CASSANDRA-7389
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7389
 Project: Cassandra
  Issue Type: Sub-task
Reporter: Joshua McKenzie
Assignee: Ala' Alkhaldi
Priority: Minor
  Labels: Windows
 Fix For: 3.0


 [junit] Testcase: compareBitSets(org.apache.cassandra.utils.BitSetTest):  
   Caused an ERROR
 [junit] java.io.FileNotFoundException: \usr\share\dict\words (The system 
 cannot find the path specified)
 [junit] java.lang.RuntimeException: java.io.FileNotFoundException: 
 \usr\share\dict\words (The system cannot find the path specified)
 [junit] at 
 org.apache.cassandra.utils.KeyGenerator$WordGenerator.reset(KeyGenerator.java:137)
 [junit] at 
 org.apache.cassandra.utils.KeyGenerator$WordGenerator.init(KeyGenerator.java:126)
 [junit] at 
 org.apache.cassandra.utils.BitSetTest.compareBitSets(BitSetTest.java:50)
 [junit] Caused by: java.io.FileNotFoundException: \usr\share\dict\words 
 (The system cannot find the path specified)
 [junit] at java.io.FileInputStream.open(Native Method)
 [junit] at java.io.FileInputStream.init(FileInputStream.java:146)
 [junit] at java.io.FileInputStream.init(FileInputStream.java:101)
 [junit] at 
 org.apache.cassandra.utils.KeyGenerator$WordGenerator.reset(KeyGenerator.java:135)



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (CASSANDRA-7389) BitSetTest fails on Windows

2014-06-13 Thread Ala' Alkhaldi (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-7389?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ala' Alkhaldi updated CASSANDRA-7389:
-

Attachment: 7389_v1

 BitSetTest fails on Windows
 ---

 Key: CASSANDRA-7389
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7389
 Project: Cassandra
  Issue Type: Sub-task
Reporter: Joshua McKenzie
Assignee: Ala' Alkhaldi
Priority: Minor
  Labels: Windows
 Fix For: 3.0


 [junit] Testcase: compareBitSets(org.apache.cassandra.utils.BitSetTest):  
   Caused an ERROR
 [junit] java.io.FileNotFoundException: \usr\share\dict\words (The system 
 cannot find the path specified)
 [junit] java.lang.RuntimeException: java.io.FileNotFoundException: 
 \usr\share\dict\words (The system cannot find the path specified)
 [junit] at 
 org.apache.cassandra.utils.KeyGenerator$WordGenerator.reset(KeyGenerator.java:137)
 [junit] at 
 org.apache.cassandra.utils.KeyGenerator$WordGenerator.init(KeyGenerator.java:126)
 [junit] at 
 org.apache.cassandra.utils.BitSetTest.compareBitSets(BitSetTest.java:50)
 [junit] Caused by: java.io.FileNotFoundException: \usr\share\dict\words 
 (The system cannot find the path specified)
 [junit] at java.io.FileInputStream.open(Native Method)
 [junit] at java.io.FileInputStream.init(FileInputStream.java:146)
 [junit] at java.io.FileInputStream.init(FileInputStream.java:101)
 [junit] at 
 org.apache.cassandra.utils.KeyGenerator$WordGenerator.reset(KeyGenerator.java:135)



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (CASSANDRA-7389) BitSetTest fails on Windows

2014-06-13 Thread Ala' Alkhaldi (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-7389?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ala' Alkhaldi updated CASSANDRA-7389:
-

Attachment: (was: 7389_v1)

 BitSetTest fails on Windows
 ---

 Key: CASSANDRA-7389
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7389
 Project: Cassandra
  Issue Type: Sub-task
Reporter: Joshua McKenzie
Assignee: Ala' Alkhaldi
Priority: Minor
  Labels: Windows
 Fix For: 3.0


 [junit] Testcase: compareBitSets(org.apache.cassandra.utils.BitSetTest):  
   Caused an ERROR
 [junit] java.io.FileNotFoundException: \usr\share\dict\words (The system 
 cannot find the path specified)
 [junit] java.lang.RuntimeException: java.io.FileNotFoundException: 
 \usr\share\dict\words (The system cannot find the path specified)
 [junit] at 
 org.apache.cassandra.utils.KeyGenerator$WordGenerator.reset(KeyGenerator.java:137)
 [junit] at 
 org.apache.cassandra.utils.KeyGenerator$WordGenerator.init(KeyGenerator.java:126)
 [junit] at 
 org.apache.cassandra.utils.BitSetTest.compareBitSets(BitSetTest.java:50)
 [junit] Caused by: java.io.FileNotFoundException: \usr\share\dict\words 
 (The system cannot find the path specified)
 [junit] at java.io.FileInputStream.open(Native Method)
 [junit] at java.io.FileInputStream.init(FileInputStream.java:146)
 [junit] at java.io.FileInputStream.init(FileInputStream.java:101)
 [junit] at 
 org.apache.cassandra.utils.KeyGenerator$WordGenerator.reset(KeyGenerator.java:135)



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (CASSANDRA-7389) BitSetTest fails on Windows

2014-06-13 Thread Ala' Alkhaldi (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-7389?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ala' Alkhaldi updated CASSANDRA-7389:
-

Attachment: 7389_v1

 BitSetTest fails on Windows
 ---

 Key: CASSANDRA-7389
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7389
 Project: Cassandra
  Issue Type: Sub-task
Reporter: Joshua McKenzie
Assignee: Ala' Alkhaldi
Priority: Minor
  Labels: Windows
 Fix For: 3.0

 Attachments: 7389_v1


 [junit] Testcase: compareBitSets(org.apache.cassandra.utils.BitSetTest):  
   Caused an ERROR
 [junit] java.io.FileNotFoundException: \usr\share\dict\words (The system 
 cannot find the path specified)
 [junit] java.lang.RuntimeException: java.io.FileNotFoundException: 
 \usr\share\dict\words (The system cannot find the path specified)
 [junit] at 
 org.apache.cassandra.utils.KeyGenerator$WordGenerator.reset(KeyGenerator.java:137)
 [junit] at 
 org.apache.cassandra.utils.KeyGenerator$WordGenerator.init(KeyGenerator.java:126)
 [junit] at 
 org.apache.cassandra.utils.BitSetTest.compareBitSets(BitSetTest.java:50)
 [junit] Caused by: java.io.FileNotFoundException: \usr\share\dict\words 
 (The system cannot find the path specified)
 [junit] at java.io.FileInputStream.open(Native Method)
 [junit] at java.io.FileInputStream.init(FileInputStream.java:146)
 [junit] at java.io.FileInputStream.init(FileInputStream.java:101)
 [junit] at 
 org.apache.cassandra.utils.KeyGenerator$WordGenerator.reset(KeyGenerator.java:135)



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (CASSANDRA-7389) BitSetTest fails on Windows

2014-06-13 Thread Joshua McKenzie (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-7389?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Joshua McKenzie updated CASSANDRA-7389:
---

Reviewer: Joshua McKenzie

 BitSetTest fails on Windows
 ---

 Key: CASSANDRA-7389
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7389
 Project: Cassandra
  Issue Type: Sub-task
Reporter: Joshua McKenzie
Assignee: Ala' Alkhaldi
Priority: Minor
  Labels: Windows
 Fix For: 3.0

 Attachments: 7389_v1


 [junit] Testcase: compareBitSets(org.apache.cassandra.utils.BitSetTest):  
   Caused an ERROR
 [junit] java.io.FileNotFoundException: \usr\share\dict\words (The system 
 cannot find the path specified)
 [junit] java.lang.RuntimeException: java.io.FileNotFoundException: 
 \usr\share\dict\words (The system cannot find the path specified)
 [junit] at 
 org.apache.cassandra.utils.KeyGenerator$WordGenerator.reset(KeyGenerator.java:137)
 [junit] at 
 org.apache.cassandra.utils.KeyGenerator$WordGenerator.init(KeyGenerator.java:126)
 [junit] at 
 org.apache.cassandra.utils.BitSetTest.compareBitSets(BitSetTest.java:50)
 [junit] Caused by: java.io.FileNotFoundException: \usr\share\dict\words 
 (The system cannot find the path specified)
 [junit] at java.io.FileInputStream.open(Native Method)
 [junit] at java.io.FileInputStream.init(FileInputStream.java:146)
 [junit] at java.io.FileInputStream.init(FileInputStream.java:101)
 [junit] at 
 org.apache.cassandra.utils.KeyGenerator$WordGenerator.reset(KeyGenerator.java:135)



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (CASSANDRA-7389) BitSetTest fails on Windows

2014-06-13 Thread Joshua McKenzie (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14031169#comment-14031169
 ] 

Joshua McKenzie commented on CASSANDRA-7389:


lgtm.  +1

 BitSetTest fails on Windows
 ---

 Key: CASSANDRA-7389
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7389
 Project: Cassandra
  Issue Type: Sub-task
Reporter: Joshua McKenzie
Assignee: Ala' Alkhaldi
Priority: Minor
  Labels: Windows
 Fix For: 3.0

 Attachments: 7389_v1


 [junit] Testcase: compareBitSets(org.apache.cassandra.utils.BitSetTest):  
   Caused an ERROR
 [junit] java.io.FileNotFoundException: \usr\share\dict\words (The system 
 cannot find the path specified)
 [junit] java.lang.RuntimeException: java.io.FileNotFoundException: 
 \usr\share\dict\words (The system cannot find the path specified)
 [junit] at 
 org.apache.cassandra.utils.KeyGenerator$WordGenerator.reset(KeyGenerator.java:137)
 [junit] at 
 org.apache.cassandra.utils.KeyGenerator$WordGenerator.init(KeyGenerator.java:126)
 [junit] at 
 org.apache.cassandra.utils.BitSetTest.compareBitSets(BitSetTest.java:50)
 [junit] Caused by: java.io.FileNotFoundException: \usr\share\dict\words 
 (The system cannot find the path specified)
 [junit] at java.io.FileInputStream.open(Native Method)
 [junit] at java.io.FileInputStream.init(FileInputStream.java:146)
 [junit] at java.io.FileInputStream.init(FileInputStream.java:101)
 [junit] at 
 org.apache.cassandra.utils.KeyGenerator$WordGenerator.reset(KeyGenerator.java:135)



--
This message was sent by Atlassian JIRA
(v6.2#6252)


git commit: Use RandomStringGenerator instead of WordGenerator so BitSetTest passes on windows.

2014-06-13 Thread brandonwilliams
Repository: cassandra
Updated Branches:
  refs/heads/trunk 305132946 - 8ff5262f0


Use RandomStringGenerator instead of WordGenerator so BitSetTest passes
on windows.

Patch by Ala' Alkhaldi, reviewed by Joshua McKenzie for CASSANDRA-7060


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

Branch: refs/heads/trunk
Commit: 8ff5262f0d77ce9b350cdde599bf847f9f28a395
Parents: 3051329
Author: Brandon Williams brandonwilli...@apache.org
Authored: Fri Jun 13 16:14:42 2014 -0500
Committer: Brandon Williams brandonwilli...@apache.org
Committed: Fri Jun 13 16:14:42 2014 -0500

--
 test/unit/org/apache/cassandra/utils/BitSetTest.java | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/8ff5262f/test/unit/org/apache/cassandra/utils/BitSetTest.java
--
diff --git a/test/unit/org/apache/cassandra/utils/BitSetTest.java 
b/test/unit/org/apache/cassandra/utils/BitSetTest.java
index e9f9211..59bc5e4 100644
--- a/test/unit/org/apache/cassandra/utils/BitSetTest.java
+++ b/test/unit/org/apache/cassandra/utils/BitSetTest.java
@@ -29,7 +29,7 @@ import org.junit.Test;
 
 import org.junit.Assert;
 import org.apache.cassandra.io.util.DataOutputBuffer;
-import org.apache.cassandra.utils.KeyGenerator.WordGenerator;
+import org.apache.cassandra.utils.KeyGenerator.RandomStringGenerator;
 import org.apache.cassandra.utils.obs.IBitSet;
 import org.apache.cassandra.utils.obs.OffHeapBitSet;
 import org.apache.cassandra.utils.obs.OpenBitSet;
@@ -44,10 +44,10 @@ public class BitSetTest
 @Test
 public void compareBitSets()
 {
-BloomFilter bf2 = (BloomFilter) 
FilterFactory.getFilter(KeyGenerator.WordGenerator.WORDS / 2, 
FilterTestHelper.MAX_FAILURE_RATE, false);
-BloomFilter bf3 = (BloomFilter) 
FilterFactory.getFilter(KeyGenerator.WordGenerator.WORDS / 2, 
FilterTestHelper.MAX_FAILURE_RATE, true);
-int skipEven = KeyGenerator.WordGenerator.WORDS % 2 == 0 ? 0 : 2;
-WordGenerator gen1 = new KeyGenerator.WordGenerator(skipEven, 2);
+BloomFilter bf2 = (BloomFilter) 
FilterFactory.getFilter(FilterTestHelper.ELEMENTS / 2, 
FilterTestHelper.MAX_FAILURE_RATE, false);
+BloomFilter bf3 = (BloomFilter) 
FilterFactory.getFilter(FilterTestHelper.ELEMENTS / 2, 
FilterTestHelper.MAX_FAILURE_RATE, true);
+
+RandomStringGenerator gen1 = new 
KeyGenerator.RandomStringGenerator(new Random().nextInt(), 
FilterTestHelper.ELEMENTS);
 
 // make sure both bitsets are empty.
 compare(bf2.bitset, bf3.bitset);



[jira] [Updated] (CASSANDRA-7393) Replace counter cache with optimised counter read path

2014-06-13 Thread Aleksey Yeschenko (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-7393?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Aleksey Yeschenko updated CASSANDRA-7393:
-

Fix Version/s: (was: 2.1.0)
   3.0

 Replace counter cache with optimised counter read path
 --

 Key: CASSANDRA-7393
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7393
 Project: Cassandra
  Issue Type: Improvement
Reporter: Aleksey Yeschenko
Assignee: Aleksey Yeschenko
 Fix For: 3.0


 As mentioned in CASSANDRA-7366, we can utilize the optimizations in 
 CollationController#collectTimeOrderedData() now for the read-before-write 
 counter path, and get most/all of the benefits of the counter cache for 
 'free' + get better 'cold' read performance as well.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (CASSANDRA-6178) Consider allowing timestamp at the protocol level ... and deprecating server side timestamps

2014-06-13 Thread Jonathan Ellis (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-6178?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14031186#comment-14031186
 ] 

Jonathan Ellis commented on CASSANDRA-6178:
---

We could still get a unique, client-provided timestamp by having the client 
fetch a unique id from the server on connection a la CASSANDRA-6108, and 
concatenate that with some time and sequence bits.  RAMP transactions gives us 
increased motivation to come up with a compact, cluster-unique timestamp.



 Consider allowing timestamp at the protocol level ... and deprecating server 
 side timestamps
 

 Key: CASSANDRA-6178
 URL: https://issues.apache.org/jira/browse/CASSANDRA-6178
 Project: Cassandra
  Issue Type: Improvement
Reporter: Sylvain Lebresne
Assignee: Sylvain Lebresne

 Generating timestamps server side by default for CQL has been done for 
 convenience, so that end-user don't have to provide one with every query.  
 However, doing it server side has the downside that updates made sequentially 
 by one single client (thread) are no guaranteed to have sequentially 
 increasing timestamps. Unless a client thread is always pinned to one 
 specific server connection that is, but no good client driver out (that is, 
 including thrit driver) there does that because that's contradictory to 
 abstracting fault tolerance to the driver user (and goes again most sane load 
 balancing strategy).
 Very concretely, this means that if you write a very trivial test program 
 that sequentially insert a value and then erase it (or overwrite it), then, 
 if you let CQL pick timestamp server side, the deletion might not erase the 
 just inserted value (because the delete might reach a different coordinator 
 than the insert and thus get a lower timestamp). From the user point of view, 
 this is a very confusing behavior, and understandably so: if timestamps are 
 optional, you'd hope that they are least respect the sequentiality of 
 operation from a single client thread.
 Of course we do support client-side assigned timestamps so it's not like the 
 test above is not fixable. And you could argue that's it's not a bug per-se.  
 Still, it's a very confusing default behavior for something very simple, 
 which suggest it's not the best default.
 You could also argue that inserting a value and deleting/overwriting right 
 away (in the same thread) is not something real program often do. And indeed, 
 it's likely that in practice server-side timestamps work fine for most real 
 application. Still, it's too easy to get counter-intuitive behavior with 
 server-side timestamps and I think we should consider moving away from them.
 So what I'd suggest is that we push back the job of providing timestamp 
 client side. But to make it easy for the driver to generate it (rather than 
 the end user), we should allow providing said timestamp at the protocol level.
 As a side note, letting the client provide the timestamp would also have the 
 advantage of making it easy for the driver to retry failed operations with 
 their initial timestamp, so that retries are truly idempotent.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (CASSANDRA-7389) BitSetTest fails on Windows

2014-06-13 Thread Joshua McKenzie (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14031184#comment-14031184
 ] 

Joshua McKenzie commented on CASSANDRA-7389:


One thing worth mentioning - the count of /usr/share/dict/words / 2 is 
substantially higher than FilterTestHelper.ELEMENTS / 2 (used for BloomFilter 
numElements init), however for purposes of this test either should be 
sufficient.

 BitSetTest fails on Windows
 ---

 Key: CASSANDRA-7389
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7389
 Project: Cassandra
  Issue Type: Sub-task
Reporter: Joshua McKenzie
Assignee: Ala' Alkhaldi
Priority: Minor
  Labels: Windows
 Fix For: 3.0

 Attachments: 7389_v1


 [junit] Testcase: compareBitSets(org.apache.cassandra.utils.BitSetTest):  
   Caused an ERROR
 [junit] java.io.FileNotFoundException: \usr\share\dict\words (The system 
 cannot find the path specified)
 [junit] java.lang.RuntimeException: java.io.FileNotFoundException: 
 \usr\share\dict\words (The system cannot find the path specified)
 [junit] at 
 org.apache.cassandra.utils.KeyGenerator$WordGenerator.reset(KeyGenerator.java:137)
 [junit] at 
 org.apache.cassandra.utils.KeyGenerator$WordGenerator.init(KeyGenerator.java:126)
 [junit] at 
 org.apache.cassandra.utils.BitSetTest.compareBitSets(BitSetTest.java:50)
 [junit] Caused by: java.io.FileNotFoundException: \usr\share\dict\words 
 (The system cannot find the path specified)
 [junit] at java.io.FileInputStream.open(Native Method)
 [junit] at java.io.FileInputStream.init(FileInputStream.java:146)
 [junit] at java.io.FileInputStream.init(FileInputStream.java:101)
 [junit] at 
 org.apache.cassandra.utils.KeyGenerator$WordGenerator.reset(KeyGenerator.java:135)



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (CASSANDRA-6178) Consider allowing timestamp at the protocol level ... and deprecating server side timestamps

2014-06-13 Thread Tupshin Harper (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-6178?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14031203#comment-14031203
 ] 

Tupshin Harper commented on CASSANDRA-6178:
---

FWIW I am very negative on client side time stamps ever being mandatory.

 Consider allowing timestamp at the protocol level ... and deprecating server 
 side timestamps
 

 Key: CASSANDRA-6178
 URL: https://issues.apache.org/jira/browse/CASSANDRA-6178
 Project: Cassandra
  Issue Type: Improvement
Reporter: Sylvain Lebresne
Assignee: Sylvain Lebresne

 Generating timestamps server side by default for CQL has been done for 
 convenience, so that end-user don't have to provide one with every query.  
 However, doing it server side has the downside that updates made sequentially 
 by one single client (thread) are no guaranteed to have sequentially 
 increasing timestamps. Unless a client thread is always pinned to one 
 specific server connection that is, but no good client driver out (that is, 
 including thrit driver) there does that because that's contradictory to 
 abstracting fault tolerance to the driver user (and goes again most sane load 
 balancing strategy).
 Very concretely, this means that if you write a very trivial test program 
 that sequentially insert a value and then erase it (or overwrite it), then, 
 if you let CQL pick timestamp server side, the deletion might not erase the 
 just inserted value (because the delete might reach a different coordinator 
 than the insert and thus get a lower timestamp). From the user point of view, 
 this is a very confusing behavior, and understandably so: if timestamps are 
 optional, you'd hope that they are least respect the sequentiality of 
 operation from a single client thread.
 Of course we do support client-side assigned timestamps so it's not like the 
 test above is not fixable. And you could argue that's it's not a bug per-se.  
 Still, it's a very confusing default behavior for something very simple, 
 which suggest it's not the best default.
 You could also argue that inserting a value and deleting/overwriting right 
 away (in the same thread) is not something real program often do. And indeed, 
 it's likely that in practice server-side timestamps work fine for most real 
 application. Still, it's too easy to get counter-intuitive behavior with 
 server-side timestamps and I think we should consider moving away from them.
 So what I'd suggest is that we push back the job of providing timestamp 
 client side. But to make it easy for the driver to generate it (rather than 
 the end user), we should allow providing said timestamp at the protocol level.
 As a side note, letting the client provide the timestamp would also have the 
 advantage of making it easy for the driver to retry failed operations with 
 their initial timestamp, so that retries are truly idempotent.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


buildbot success in ASF Buildbot on cassandra-trunk

2014-06-13 Thread buildbot
The Buildbot has detected a restored build on builder cassandra-trunk while 
building cassandra.
Full details are available at:
 http://ci.apache.org/builders/cassandra-trunk/builds/330

Buildbot URL: http://ci.apache.org/

Buildslave for this Build: portunus_ubuntu

Build Reason: scheduler
Build Source Stamp: [branch trunk] 8ff5262f0d77ce9b350cdde599bf847f9f28a395
Blamelist: Brandon Williams brandonwilli...@apache.org

Build succeeded!

sincerely,
 -The Buildbot





[jira] [Commented] (CASSANDRA-6178) Consider allowing timestamp at the protocol level ... and deprecating server side timestamps

2014-06-13 Thread Aleksey Yeschenko (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-6178?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14031213#comment-14031213
 ] 

Aleksey Yeschenko commented on CASSANDRA-6178:
--

[~tupshin] If you are worried about users and usability, then you shouldn't be. 
With CASSANDRA-6855 in, nothing is going to change for v3-protocol users - the 
driver will generate the timestamp automatically and transparently behind the 
scenes, unless you provide one explicitly. And, as mentioned in #6855 comments, 
it's the necessary precondition for idempotent retries in the driver.

 Consider allowing timestamp at the protocol level ... and deprecating server 
 side timestamps
 

 Key: CASSANDRA-6178
 URL: https://issues.apache.org/jira/browse/CASSANDRA-6178
 Project: Cassandra
  Issue Type: Improvement
Reporter: Sylvain Lebresne
Assignee: Sylvain Lebresne

 Generating timestamps server side by default for CQL has been done for 
 convenience, so that end-user don't have to provide one with every query.  
 However, doing it server side has the downside that updates made sequentially 
 by one single client (thread) are no guaranteed to have sequentially 
 increasing timestamps. Unless a client thread is always pinned to one 
 specific server connection that is, but no good client driver out (that is, 
 including thrit driver) there does that because that's contradictory to 
 abstracting fault tolerance to the driver user (and goes again most sane load 
 balancing strategy).
 Very concretely, this means that if you write a very trivial test program 
 that sequentially insert a value and then erase it (or overwrite it), then, 
 if you let CQL pick timestamp server side, the deletion might not erase the 
 just inserted value (because the delete might reach a different coordinator 
 than the insert and thus get a lower timestamp). From the user point of view, 
 this is a very confusing behavior, and understandably so: if timestamps are 
 optional, you'd hope that they are least respect the sequentiality of 
 operation from a single client thread.
 Of course we do support client-side assigned timestamps so it's not like the 
 test above is not fixable. And you could argue that's it's not a bug per-se.  
 Still, it's a very confusing default behavior for something very simple, 
 which suggest it's not the best default.
 You could also argue that inserting a value and deleting/overwriting right 
 away (in the same thread) is not something real program often do. And indeed, 
 it's likely that in practice server-side timestamps work fine for most real 
 application. Still, it's too easy to get counter-intuitive behavior with 
 server-side timestamps and I think we should consider moving away from them.
 So what I'd suggest is that we push back the job of providing timestamp 
 client side. But to make it easy for the driver to generate it (rather than 
 the end user), we should allow providing said timestamp at the protocol level.
 As a side note, letting the client provide the timestamp would also have the 
 advantage of making it easy for the driver to retry failed operations with 
 their initial timestamp, so that retries are truly idempotent.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Created] (CASSANDRA-7398) -Dcassandra.config= needs file:///

2014-06-13 Thread JIRA
Marco Tulio Avila Cerón created CASSANDRA-7398:
--

 Summary: -Dcassandra.config= needs file:///
 Key: CASSANDRA-7398
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7398
 Project: Cassandra
  Issue Type: Bug
  Components: Core
 Environment:  Cassandra 2.1.0-rc1-SNAPSHOT, Win 7
Reporter: Marco Tulio Avila Cerón
Priority: Minor
 Fix For: 2.1 rc1


The parameter in the VM options -Dcassandra.config= needs file:///
Allow the user to have optional file:/// when loading the config file from 
the filesystem



--
This message was sent by Atlassian JIRA
(v6.2#6252)


git commit: don't rely on toString being a stable implementation, where possible

2014-06-13 Thread dbrosius
Repository: cassandra
Updated Branches:
  refs/heads/trunk 8ff5262f0 - 45afe1d93


don't rely on toString being a stable implementation, where possible


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

Branch: refs/heads/trunk
Commit: 45afe1d935be9057fe3aa08f2d7b9300501402ff
Parents: 8ff5262
Author: Dave Brosius dbros...@mebigfatguy.com
Authored: Sat Jun 14 01:29:58 2014 -0400
Committer: Dave Brosius dbros...@mebigfatguy.com
Committed: Sat Jun 14 01:29:58 2014 -0400

--
 src/java/org/apache/cassandra/db/ColumnFamilyStore.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/45afe1d9/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 e2d9248..ae191f0 100644
--- a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
+++ b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
@@ -463,7 +463,7 @@ public class ColumnFamilyStore implements 
ColumnFamilyStoreMBean
 {
 public boolean accept(File pathname)
 {
-return pathname.toString().endsWith(StreamLockfile.FILE_EXT);
+return pathname.getPath().endsWith(StreamLockfile.FILE_EXT);
 }
 };
 for (File dir : directories.getCFDirectories())