Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5AE1510FB2 for ; Mon, 4 Nov 2013 15:52:15 +0000 (UTC) Received: (qmail 12349 invoked by uid 500); 4 Nov 2013 15:50:57 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 11205 invoked by uid 500); 4 Nov 2013 15:50:05 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 10312 invoked by uid 99); 4 Nov 2013 15:49:19 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Nov 2013 15:49:19 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 24F9E3A849; Mon, 4 Nov 2013 15:49:19 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jbellis@apache.org To: commits@cassandra.apache.org Date: Mon, 04 Nov 2013 15:49:22 -0000 Message-Id: <47801538319c414c8aadc31d5985e87b@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [5/6] git commit: merge from 1.2 merge from 1.2 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/424fb481 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/424fb481 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/424fb481 Branch: refs/heads/cassandra-2.0 Commit: 424fb4812e5b3b4882201e44d3576571e51b5fa7 Parents: 4a439d2 e768191 Author: Jonathan Ellis Authored: Mon Nov 4 09:49:01 2013 -0600 Committer: Jonathan Ellis Committed: Mon Nov 4 09:49:01 2013 -0600 ---------------------------------------------------------------------- CHANGES.txt | 7 +++ .../apache/cassandra/cql3/QueryProcessor.java | 49 +++++++++++++++----- src/java/org/apache/cassandra/db/Memtable.java | 6 +-- 3 files changed, 47 insertions(+), 15 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/424fb481/CHANGES.txt ---------------------------------------------------------------------- diff --cc CHANGES.txt index a6636a5,fd93a5f..38fd876 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,20 -1,11 +1,27 @@@ -1.2.12 +2.0.3 + * 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) +Merged from 1.2: + * add non-jamm path for cached statements (CASSANDRA-6293) + * (Hadoop) Require CFRR batchSize to be at least 2 (CASSANDRA-6114) + * Fix altering column types (CASSANDRA-6185) + * cqlsh: fix CREATE/ALTER WITH completion (CASSANDRA-6196) + * add windows bat files for shell commands (CASSANDRA-6145) + * Fix potential stack overflow during range tombstones insertion (CASSANDRA-6181) + * (Hadoop) Make LOCAL_ONE the default consistency level (CASSANDRA-6214) * Require logging in for Thrift CQL2/3 statement preparation (CASSANDRA-6254) * restrict max_num_tokens to 1536 (CASSANDRA-6267) * Nodetool gets default JMX port from cassandra-env.sh (CASSANDRA-6273) http://git-wip-us.apache.org/repos/asf/cassandra/blob/424fb481/src/java/org/apache/cassandra/cql3/QueryProcessor.java ---------------------------------------------------------------------- diff --cc src/java/org/apache/cassandra/cql3/QueryProcessor.java index dc2649c,2d43bdc..71bf1b0 --- a/src/java/org/apache/cassandra/cql3/QueryProcessor.java +++ b/src/java/org/apache/cassandra/cql3/QueryProcessor.java @@@ -73,44 -67,35 +69,68 @@@ public class QueryProcesso } }; - private static final ConcurrentLinkedHashMap thriftPreparedStatements = new ConcurrentLinkedHashMap.Builder() - .maximumWeightedCapacity(MAX_CACHE_PREPARED_MEMORY) - .weigher(thriftMemoryUsageWeigher) - .build(); + private static final ConcurrentLinkedHashMap preparedStatements; + private static final ConcurrentLinkedHashMap thriftPreparedStatements; + + static + { + if (MemoryMeter.isInitialized()) + { + preparedStatements = new ConcurrentLinkedHashMap.Builder() + .maximumWeightedCapacity(MAX_CACHE_PREPARED_MEMORY) + .weigher(cqlMemoryUsageWeigher) + .build(); + thriftPreparedStatements = new ConcurrentLinkedHashMap.Builder() + .maximumWeightedCapacity(MAX_CACHE_PREPARED_MEMORY) + .weigher(thriftMemoryUsageWeigher) + .build(); + } + else + { + logger.error("Unable to initialize MemoryMeter (jamm not specified as javaagent). This means " + + "Cassandra will be unable to measure object sizes accurately and may consequently OOM."); + preparedStatements = new ConcurrentLinkedHashMap.Builder() + .maximumWeightedCapacity(MAX_CACHE_PREPARED_COUNT) + .build(); + thriftPreparedStatements = new ConcurrentLinkedHashMap.Builder() + .maximumWeightedCapacity(MAX_CACHE_PREPARED_COUNT) + .build(); + } + } + private static final List preExecutionHooks = new CopyOnWriteArrayList<>(); + private static final List postExecutionHooks = new CopyOnWriteArrayList<>(); + private static final List postPreparationHooks = new CopyOnWriteArrayList<>(); + + public static void addPreExecutionHook(PreExecutionHook hook) + { + preExecutionHooks.add(hook); + } + + public static void removePreExecutionHook(PreExecutionHook hook) + { + preExecutionHooks.remove(hook); + } + + public static void addPostExecutionHook(PostExecutionHook hook) + { + postExecutionHooks.add(hook); + } + + public static void removePostExecutionHook(PostExecutionHook hook) + { + postExecutionHooks.remove(hook); + } + + public static void addPostPreparationHook(PostPreparationHook hook) + { + postPreparationHooks.add(hook); + } + + public static void removePostPreparationHook(PostPreparationHook hook) + { + postPreparationHooks.remove(hook); + } public static CQLStatement getPrepared(MD5Digest id) { http://git-wip-us.apache.org/repos/asf/cassandra/blob/424fb481/src/java/org/apache/cassandra/db/Memtable.java ----------------------------------------------------------------------