You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by al...@apache.org on 2014/09/19 21:57:43 UTC
[1/2] git commit: Fix tests by making QP use its own executor
Repository: cassandra
Updated Branches:
refs/heads/trunk 0956a8a71 -> 4e7265663
Fix tests by making QP use its own executor
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/488e775c
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/488e775c
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/488e775c
Branch: refs/heads/trunk
Commit: 488e775cc13044ac1a2b4bd9c4e5d544a4d15bae
Parents: 0e83100
Author: Aleksey Yeschenko <al...@apache.org>
Authored: Fri Sep 19 12:57:17 2014 -0700
Committer: Aleksey Yeschenko <al...@apache.org>
Committed: Fri Sep 19 12:57:17 2014 -0700
----------------------------------------------------------------------
.../apache/cassandra/cql3/QueryProcessor.java | 30 +++++++++-----------
1 file changed, 14 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/488e775c/src/java/org/apache/cassandra/cql3/QueryProcessor.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/QueryProcessor.java b/src/java/org/apache/cassandra/cql3/QueryProcessor.java
index 9a09d42..0c75642 100644
--- a/src/java/org/apache/cassandra/cql3/QueryProcessor.java
+++ b/src/java/org/apache/cassandra/cql3/QueryProcessor.java
@@ -19,9 +19,7 @@ package org.apache.cassandra.cql3;
import java.nio.ByteBuffer;
import java.util.*;
-import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.TimeUnit;
+import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicInteger;
import com.google.common.annotations.VisibleForTesting;
@@ -89,7 +87,8 @@ public class QueryProcessor implements QueryHandler
@VisibleForTesting
public static final CQLMetrics metrics = new CQLMetrics();
- private static AtomicInteger lastMinuteEvictionsCount = new AtomicInteger(0);
+ private static final AtomicInteger lastMinuteEvictionsCount = new AtomicInteger(0);
+ private static final ScheduledExecutorService evictionCheckTimer = Executors.newScheduledThreadPool(1);
static
{
@@ -118,6 +117,17 @@ public class QueryProcessor implements QueryHandler
})
.build();
+ evictionCheckTimer.scheduleAtFixedRate(new Runnable()
+ {
+ public void run()
+ {
+ long count = lastMinuteEvictionsCount.getAndSet(0);
+ if (count > 0)
+ logger.info("{} prepared statements discarded in the last minute because cache limit reached ({} bytes)",
+ count,
+ MAX_CACHE_PREPARED_MEMORY);
+ }
+ }, 1, 1, TimeUnit.MINUTES);
}
public static int preparedStatementsCount()
@@ -155,18 +165,6 @@ public class QueryProcessor implements QueryHandler
private QueryProcessor()
{
MigrationManager.instance.register(new MigrationSubscriber());
-
- StorageService.scheduledTasks.scheduleAtFixedRate(new Runnable()
- {
- public void run()
- {
- long count = lastMinuteEvictionsCount.getAndSet(0);
- if (count > 0)
- logger.info("{} prepared statements discarded in the last minute because cache limit reached ({} bytes)",
- count,
- MAX_CACHE_PREPARED_MEMORY);
- }
- }, 1, 1, TimeUnit.MINUTES);
}
public ParsedStatement.Prepared getPrepared(MD5Digest id)
[2/2] git commit: Merge branch 'cassandra-2.1' into trunk
Posted by al...@apache.org.
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/4e726566
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/4e726566
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/4e726566
Branch: refs/heads/trunk
Commit: 4e72656636754485fe43e85e65046e6a929fadbc
Parents: 0956a8a 488e775
Author: Aleksey Yeschenko <al...@apache.org>
Authored: Fri Sep 19 12:57:35 2014 -0700
Committer: Aleksey Yeschenko <al...@apache.org>
Committed: Fri Sep 19 12:57:35 2014 -0700
----------------------------------------------------------------------
.../apache/cassandra/cql3/QueryProcessor.java | 30 +++++++++-----------
1 file changed, 14 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/4e726566/src/java/org/apache/cassandra/cql3/QueryProcessor.java
----------------------------------------------------------------------