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/trunk Commit: 424fb4812e5b3b4882201e44d3576571e51b5fa7 Parents: 4a439d2 e768191 Author: Jonathan Ellis <jbel...@apache.org> Authored: Mon Nov 4 09:49:01 2013 -0600 Committer: Jonathan Ellis <jbel...@apache.org> 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<Integer, CQLStatement> thriftPreparedStatements = new ConcurrentLinkedHashMap.Builder<Integer, CQLStatement>() - .maximumWeightedCapacity(MAX_CACHE_PREPARED_MEMORY) - .weigher(thriftMemoryUsageWeigher) - .build(); + private static final ConcurrentLinkedHashMap<MD5Digest, CQLStatement> preparedStatements; + private static final ConcurrentLinkedHashMap<Integer, CQLStatement> thriftPreparedStatements; + + static + { + if (MemoryMeter.isInitialized()) + { + preparedStatements = new ConcurrentLinkedHashMap.Builder<MD5Digest, CQLStatement>() + .maximumWeightedCapacity(MAX_CACHE_PREPARED_MEMORY) + .weigher(cqlMemoryUsageWeigher) + .build(); + thriftPreparedStatements = new ConcurrentLinkedHashMap.Builder<Integer, CQLStatement>() + .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<MD5Digest, CQLStatement>() + .maximumWeightedCapacity(MAX_CACHE_PREPARED_COUNT) + .build(); + thriftPreparedStatements = new ConcurrentLinkedHashMap.Builder<Integer, CQLStatement>() + .maximumWeightedCapacity(MAX_CACHE_PREPARED_COUNT) + .build(); + } + } + private static final List<PreExecutionHook> preExecutionHooks = new CopyOnWriteArrayList<>(); + private static final List<PostExecutionHook> postExecutionHooks = new CopyOnWriteArrayList<>(); + private static final List<PostPreparationHook> 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 ----------------------------------------------------------------------