You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by sl...@apache.org on 2013/12/02 09:25:04 UTC

[1/2] git commit: Expose thread pool metrics for the native protocol server

Updated Branches:
  refs/heads/cassandra-2.0 b68719524 -> e4fc8771e


Expose thread pool metrics for the native protocol server

patch by mishail; reviewed by slebresne for CASSANDRA-6234


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

Branch: refs/heads/cassandra-2.0
Commit: f393504539d1fd7ba70e9dabb70460f44a600e9d
Parents: a322b64
Author: Sylvain Lebresne <sy...@datastax.com>
Authored: Mon Dec 2 09:22:15 2013 +0100
Committer: Sylvain Lebresne <sy...@datastax.com>
Committed: Mon Dec 2 09:22:15 2013 +0100

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../transport/RequestThreadPoolExecutor.java    | 31 ++++++++++++++++++--
 2 files changed, 29 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/f3935045/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index f84ffec..2119f77 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -6,6 +6,7 @@
  * cqlsh: quote single quotes in strings inside collections (CASSANDRA-6172)
  * Improve gossip performance for typical messages (CASSANDRA-6409)
  * Throw IRE if a prepared has more markers than supported (CASSANDRA-5598)
+ * Expose Thread metrics for the native protocol server (CASSANDRA-6234)
 
 
 1.2.12

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f3935045/src/java/org/apache/cassandra/transport/RequestThreadPoolExecutor.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/transport/RequestThreadPoolExecutor.java b/src/java/org/apache/cassandra/transport/RequestThreadPoolExecutor.java
index d266387..c2e6033 100644
--- a/src/java/org/apache/cassandra/transport/RequestThreadPoolExecutor.java
+++ b/src/java/org/apache/cassandra/transport/RequestThreadPoolExecutor.java
@@ -17,15 +17,15 @@
  */
 package org.apache.cassandra.transport;
 
-import java.util.concurrent.LinkedBlockingQueue;
+import java.util.List;
 import java.util.concurrent.TimeUnit;
 
 import org.jboss.netty.handler.execution.MemoryAwareThreadPoolExecutor;
 import org.jboss.netty.util.ObjectSizeEstimator;
-
 import org.apache.cassandra.concurrent.DebuggableThreadPoolExecutor;
 import org.apache.cassandra.concurrent.NamedThreadFactory;
 import org.apache.cassandra.config.DatabaseDescriptor;
+import org.apache.cassandra.metrics.ThreadPoolMetrics;
 
 public class RequestThreadPoolExecutor extends MemoryAwareThreadPoolExecutor
 {
@@ -33,6 +33,10 @@ public class RequestThreadPoolExecutor extends MemoryAwareThreadPoolExecutor
     // Number of request we accept to queue before blocking. We could allow this to be configured...
     private final static int MAX_QUEUED_REQUESTS = 128;
 
+    private final static String THREAD_FACTORY_ID = "Native-Transport-Requests";
+
+    private final ThreadPoolMetrics metrics;
+
     public RequestThreadPoolExecutor()
     {
         super(DatabaseDescriptor.getNativeTransportMaxThreads(),
@@ -40,7 +44,8 @@ public class RequestThreadPoolExecutor extends MemoryAwareThreadPoolExecutor
               MAX_QUEUED_REQUESTS,
               CORE_THREAD_TIMEOUT_SEC, TimeUnit.SECONDS,
               sizeEstimator(),
-              new NamedThreadFactory("Native-Transport-Requests"));
+              new NamedThreadFactory(THREAD_FACTORY_ID));
+        metrics = new ThreadPoolMetrics(this, "transport", THREAD_FACTORY_ID);
     }
 
     /*
@@ -74,4 +79,24 @@ public class RequestThreadPoolExecutor extends MemoryAwareThreadPoolExecutor
         super.afterExecute(r, t);
         DebuggableThreadPoolExecutor.logExceptionsAfterExecute(r, t);
     }
+
+    @Override
+    public void shutdown()
+    {
+        if (!isShutdown())
+        {
+            metrics.release();
+        }
+        super.shutdown();
+    }
+
+    @Override
+    public List<Runnable> shutdownNow()
+    {
+        if (!isShutdown())
+        {
+            metrics.release();
+        }
+        return super.shutdownNow();
+    }
 }


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

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

Branch: refs/heads/cassandra-2.0
Commit: e4fc8771e1b3ff3e3598cf1ebcd88084fc2f1ded
Parents: b687195 f393504
Author: Sylvain Lebresne <sy...@datastax.com>
Authored: Mon Dec 2 09:24:54 2013 +0100
Committer: Sylvain Lebresne <sy...@datastax.com>
Committed: Mon Dec 2 09:24:54 2013 +0100

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../transport/RequestThreadPoolExecutor.java    | 31 ++++++++++++++++++--
 2 files changed, 29 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/e4fc8771/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index 4e77faa,2119f77..bdd6da4
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -10,44 -3,13 +10,45 @@@ Merged from 1.2
   * cqlsh: quote single quotes in strings inside collections (CASSANDRA-6172)
   * Improve gossip performance for typical messages (CASSANDRA-6409)
   * Throw IRE if a prepared has more markers than supported (CASSANDRA-5598)
+  * Expose Thread metrics for the native protocol server (CASSANDRA-6234)
  
  
 -1.2.12
 +2.0.3
 + * Fix FD leak on slice read path (CASSANDRA-6275)
 + * Cancel read meter task when closing SSTR (CASSANDRA-6358)
 + * free off-heap IndexSummary during bulk (CASSANDRA-6359)
 + * Recover from IOException in accept() thread (CASSANDRA-6349)
 + * Improve Gossip tolerance of abnormally slow tasks (CASSANDRA-6338)
 + * Fix trying to hint timed out counter writes (CASSANDRA-6322)
 + * Allow restoring specific columnfamilies from archived CL (CASSANDRA-4809)
 + * Avoid flushing compaction_history after each operation (CASSANDRA-6287)
 + * Fix repair assertion error when tombstones expire (CASSANDRA-6277)
 + * Skip loading corrupt key cache (CASSANDRA-6260)
 + * Fixes for compacting larger-than-memory rows (CASSANDRA-6274)
 + * Compact hottest sstables first and optionally omit coldest from
 +   compaction entirely (CASSANDRA-6109)
 + * Fix modifying column_metadata from thrift (CASSANDRA-6182)
 + * cqlsh: fix LIST USERS output (CASSANDRA-6242)
 + * Add IRequestSink interface (CASSANDRA-6248)
 + * Update memtable size while flushing (CASSANDRA-6249)
 + * Provide hooks around CQL2/CQL3 statement execution (CASSANDRA-6252)
 + * Require Permission.SELECT for CAS updates (CASSANDRA-6247)
 + * New CQL-aware SSTableWriter (CASSANDRA-5894)
 + * Reject CAS operation when the protocol v1 is used (CASSANDRA-6270)
 + * Correctly throw error when frame too large (CASSANDRA-5981)
 + * Fix serialization bug in PagedRange with 2ndary indexes (CASSANDRA-6299)
 + * Fix CQL3 table validation in Thrift (CASSANDRA-6140)
 + * Fix bug missing results with IN clauses (CASSANDRA-6327)
 + * Fix paging with reversed slices (CASSANDRA-6343)
 + * Set minTimestamp correctly to be able to drop expired sstables (CASSANDRA-6337)
 + * Support NaN and Infinity as float literals (CASSANDRA-6003)
 + * Remove RF from nodetool ring output (CASSANDRA-6289)
 + * Fix attempting to flush empty rows (CASSANDRA-6374)
 + * Fix potential out of bounds exception when paging (CASSANDRA-6333)
 +Merged from 1.2:
 + * Optimize FD phi calculation (CASSANDRA-6386)
 + * Improve initial FD phi estimate when starting up (CASSANDRA-6385)
 + * Don't list CQL3 table in CLI describe even if named explicitely (CASSANDRA-5750)
   * Invalidate row cache when dropping CF (CASSANDRA-6351)
   * add non-jamm path for cached statements (CASSANDRA-6293)
   * (Hadoop) Require CFRR batchSize to be at least 2 (CASSANDRA-6114)