Merge branch 'cassandra-2.1' into cassandra-2.2
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/80ba11c6 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/80ba11c6 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/80ba11c6 Branch: refs/heads/cassandra-2.2 Commit: 80ba11c62acff08954a1f79d1bf9078602dfc665 Parents: f9c998c a8dce22 Author: Tyler Hobbs <tylerlho...@gmail.com> Authored: Wed May 27 13:52:34 2015 -0500 Committer: Tyler Hobbs <tylerlho...@gmail.com> Committed: Wed May 27 13:52:34 2015 -0500 ---------------------------------------------------------------------- CHANGES.txt | 3 + .../apache/cassandra/db/ColumnFamilyStore.java | 4 +- src/java/org/apache/cassandra/db/DataRange.java | 82 ++++++++++++++++--- .../cassandra/db/SliceFromReadCommand.java | 28 +++++++ .../cassandra/db/filter/ColumnCounter.java | 63 ++++++++++++++- .../cassandra/db/filter/SliceQueryFilter.java | 83 ++++++++++++++++++-- .../service/pager/AbstractQueryPager.java | 40 ++++++++-- .../service/pager/RangeSliceQueryPager.java | 4 +- .../service/pager/SliceQueryPager.java | 6 +- .../service/pager/AbstractQueryPagerTest.java | 8 +- 10 files changed, 281 insertions(+), 40 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/80ba11c6/CHANGES.txt ---------------------------------------------------------------------- diff --cc CHANGES.txt index e183137,d00cc65..0864759 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -12,124 -3,6 +12,127 @@@ Merged from 2.1 * Improve estimated row count (CASSANDRA-9107) * Optimize range tombstone memory footprint (CASSANDRA-8603) * Use configured gcgs in anticompaction (CASSANDRA-9397) ++Merged from 2.0: ++ * Fix null static columns in pages after the first, paged reversed ++ queries (CASSANDRA-8502) + + +2.2.0-beta1 + * Introduce Transactional API for internal state changes (CASSANDRA-8984) + * Add a flag in cassandra.yaml to enable UDFs (CASSANDRA-9404) + * Better support of null for UDF (CASSANDRA-8374) + * Use ecj instead of javassist for UDFs (CASSANDRA-8241) + * faster async logback configuration for tests (CASSANDRA-9376) + * Add `smallint` and `tinyint` data types (CASSANDRA-8951) + * Avoid thrift schema creation when native driver is used in stress tool (CASSANDRA-9374) + * Populate TokenMetadata early during startup (CASSANDRA-9317) + * Make Functions.declared thread-safe + * Add client warnings to native protocol v4 (CASSANDRA-8930) + * Allow roles cache to be invalidated (CASSANDRA-8967) + * Upgrade Snappy (CASSANDRA-9063) + * Don't start Thrift rpc by default (CASSANDRA-9319) + * Only stream from unrepaired sstables with incremental repair (CASSANDRA-8267) + * Aggregate UDFs allow SFUNC return type to differ from STYPE if FFUNC specified (CASSANDRA-9321) + * Remove Thrift dependencies in bundled tools (CASSANDRA-8358) + * Disable memory mapping of hsperfdata file for JVM statistics (CASSANDRA-9242) + * Add pre-startup checks to detect potential incompatibilities (CASSANDRA-8049) + * Distinguish between null and unset in protocol v4 (CASSANDRA-7304) + * Add user/role permissions for user-defined functions (CASSANDRA-7557) + * Allow cassandra config to be updated to restart daemon without unloading classes (CASSANDRA-9046) + * Don't initialize compaction writer before checking if iter is empty (CASSANDRA-9117) + * Don't execute any functions at prepare-time (CASSANDRA-9037) + * Share file handles between all instances of a SegmentedFile (CASSANDRA-8893) + * Make it possible to major compact LCS (CASSANDRA-7272) + * Make FunctionExecutionException extend RequestExecutionException + (CASSANDRA-9055) + * Add support for SELECT JSON, INSERT JSON syntax and new toJson(), fromJson() + functions (CASSANDRA-7970) + * Optimise max purgeable timestamp calculation in compaction (CASSANDRA-8920) + * Constrain internode message buffer sizes, and improve IO class hierarchy (CASSANDRA-8670) + * New tool added to validate all sstables in a node (CASSANDRA-5791) + * Push notification when tracing completes for an operation (CASSANDRA-7807) + * Delay "node up" and "node added" notifications until native protocol server is started (CASSANDRA-8236) + * Compressed Commit Log (CASSANDRA-6809) + * Optimise IntervalTree (CASSANDRA-8988) + * Add a key-value payload for third party usage (CASSANDRA-8553, 9212) + * Bump metrics-reporter-config dependency for metrics 3.0 (CASSANDRA-8149) + * Partition intra-cluster message streams by size, not type (CASSANDRA-8789) + * Add WriteFailureException to native protocol, notify coordinator of + write failures (CASSANDRA-8592) + * Convert SequentialWriter to nio (CASSANDRA-8709) + * Add role based access control (CASSANDRA-7653, 8650, 7216, 8760, 8849, 8761, 8850) + * Record client ip address in tracing sessions (CASSANDRA-8162) + * Indicate partition key columns in response metadata for prepared + statements (CASSANDRA-7660) + * Merge UUIDType and TimeUUIDType parse logic (CASSANDRA-8759) + * Avoid memory allocation when searching index summary (CASSANDRA-8793) + * Optimise (Time)?UUIDType Comparisons (CASSANDRA-8730) + * Make CRC32Ex into a separate maven dependency (CASSANDRA-8836) + * Use preloaded jemalloc w/ Unsafe (CASSANDRA-8714, 9197) + * Avoid accessing partitioner through StorageProxy (CASSANDRA-8244, 8268) + * Upgrade Metrics library and remove depricated metrics (CASSANDRA-5657) + * Serializing Row cache alternative, fully off heap (CASSANDRA-7438) + * Duplicate rows returned when in clause has repeated values (CASSANDRA-6707) + * Make CassandraException unchecked, extend RuntimeException (CASSANDRA-8560) + * Support direct buffer decompression for reads (CASSANDRA-8464) + * DirectByteBuffer compatible LZ4 methods (CASSANDRA-7039) + * Group sstables for anticompaction correctly (CASSANDRA-8578) + * Add ReadFailureException to native protocol, respond + immediately when replicas encounter errors while handling + a read request (CASSANDRA-7886) + * Switch CommitLogSegment from RandomAccessFile to nio (CASSANDRA-8308) + * Allow mixing token and partition key restrictions (CASSANDRA-7016) + * Support index key/value entries on map collections (CASSANDRA-8473) + * Modernize schema tables (CASSANDRA-8261) + * Support for user-defined aggregation functions (CASSANDRA-8053) + * Fix NPE in SelectStatement with empty IN values (CASSANDRA-8419) + * Refactor SelectStatement, return IN results in natural order instead + of IN value list order and ignore duplicate values in partition key IN restrictions (CASSANDRA-7981) + * Support UDTs, tuples, and collections in user-defined + functions (CASSANDRA-7563) + * Fix aggregate fn results on empty selection, result column name, + and cqlsh parsing (CASSANDRA-8229) + * Mark sstables as repaired after full repair (CASSANDRA-7586) + * Extend Descriptor to include a format value and refactor reader/writer + APIs (CASSANDRA-7443) + * Integrate JMH for microbenchmarks (CASSANDRA-8151) + * Keep sstable levels when bootstrapping (CASSANDRA-7460) + * Add Sigar library and perform basic OS settings check on startup (CASSANDRA-7838) + * Support for aggregation functions (CASSANDRA-4914) + * Remove cassandra-cli (CASSANDRA-7920) + * Accept dollar quoted strings in CQL (CASSANDRA-7769) + * Make assassinate a first class command (CASSANDRA-7935) + * Support IN clause on any partition key column (CASSANDRA-7855) + * Support IN clause on any clustering column (CASSANDRA-4762) + * Improve compaction logging (CASSANDRA-7818) + * Remove YamlFileNetworkTopologySnitch (CASSANDRA-7917) + * Do anticompaction in groups (CASSANDRA-6851) + * Support user-defined functions (CASSANDRA-7395, 7526, 7562, 7740, 7781, 7929, + 7924, 7812, 8063, 7813, 7708) + * Permit configurable timestamps with cassandra-stress (CASSANDRA-7416) + * Move sstable RandomAccessReader to nio2, which allows using the + FILE_SHARE_DELETE flag on Windows (CASSANDRA-4050) + * Remove CQL2 (CASSANDRA-5918) + * Optimize fetching multiple cells by name (CASSANDRA-6933) + * Allow compilation in java 8 (CASSANDRA-7028) + * Make incremental repair default (CASSANDRA-7250) + * Enable code coverage thru JaCoCo (CASSANDRA-7226) + * Switch external naming of 'column families' to 'tables' (CASSANDRA-4369) + * Shorten SSTable path (CASSANDRA-6962) + * Use unsafe mutations for most unit tests (CASSANDRA-6969) + * Fix race condition during calculation of pending ranges (CASSANDRA-7390) + * Fail on very large batch sizes (CASSANDRA-8011) + * Improve concurrency of repair (CASSANDRA-6455, 8208, 9145) + * Select optimal CRC32 implementation at runtime (CASSANDRA-8614) + * Evaluate MurmurHash of Token once per query (CASSANDRA-7096) + * Generalize progress reporting (CASSANDRA-8901) + * Resumable bootstrap streaming (CASSANDRA-8838, CASSANDRA-8942) + * Allow scrub for secondary index (CASSANDRA-5174) + * Save repair data to system table (CASSANDRA-5839) + * fix nodetool names that reference column families (CASSANDRA-8872) + + +2.1.6 * Warn on misuse of unlogged batches (CASSANDRA-9282) * Failure detector detects and ignores local pauses (CASSANDRA-9183) * Add utility class to support for rate limiting a given log statement (CASSANDRA-9029) http://git-wip-us.apache.org/repos/asf/cassandra/blob/80ba11c6/src/java/org/apache/cassandra/db/ColumnFamilyStore.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/80ba11c6/src/java/org/apache/cassandra/db/DataRange.java ---------------------------------------------------------------------- diff --cc src/java/org/apache/cassandra/db/DataRange.java index d93e1dd,08fdd14..1e6f8c8 --- a/src/java/org/apache/cassandra/db/DataRange.java +++ b/src/java/org/apache/cassandra/db/DataRange.java @@@ -165,9 -169,10 +174,10 @@@ public class DataRang // When using a paging range, we don't allow wrapped ranges, as it's unclear how to handle them properly. // This is ok for now since we only need this in range slice queries, and the range are "unwrapped" in that case. - assert !(range instanceof Range) || !((Range)range).isWrapAround() || range.right.isMinimum() : range; + assert !(range instanceof Range) || !((Range<?>)range).isWrapAround() || range.right.isMinimum() : range; this.sliceFilter = filter; + this.cfm = cfm; this.comparator = comparator; this.firstPartitionColumnStart = firstPartitionColumnStart; this.lastPartitionColumnFinish = lastPartitionColumnFinish; http://git-wip-us.apache.org/repos/asf/cassandra/blob/80ba11c6/src/java/org/apache/cassandra/db/filter/ColumnCounter.java ---------------------------------------------------------------------- diff --cc src/java/org/apache/cassandra/db/filter/ColumnCounter.java index 43555bc,d7a8873..0d5acd1 --- a/src/java/org/apache/cassandra/db/filter/ColumnCounter.java +++ b/src/java/org/apache/cassandra/db/filter/ColumnCounter.java @@@ -153,8 -146,61 +153,65 @@@ public class ColumnCounte live++; previous = current; + + return true; } } + + /** + * Similar to GroupByPrefix, but designed to handle counting cells in reverse order. + */ + public static class GroupByPrefixReversed extends GroupByPrefix + { + public GroupByPrefixReversed(long timestamp, CellNameType type, int toGroup) + { + super(timestamp, type, toGroup); + } + + @Override - public void count(Cell cell, DeletionInfo.InOrderTester tester) ++ public boolean count(Cell cell, DeletionInfo.InOrderTester tester) + { + if (tester.isDeleted(cell)) - return; ++ return false; + + if (!cell.isLive(timestamp)) + { + tombstones++; - return; ++ return true; + } + + if (toGroup == 0) + { + live = 1; - return; ++ return true; + } + + CellName current = cell.name(); + assert current.size() >= toGroup; + + if (previous == null) + { + // This is the first group we've seen. If it happens to be static, we still want to increment the + // count because a) there are no-static rows (statics are always last in reversed order), and b) any + // static cells we see after this will not increment the count + previous = current; + live++; + } + else if (!current.isStatic()) // ignore statics if we've seen any other statics or any other groups + { + for (int i = 0; i < toGroup; i++) + { + if (type.subtype(i).compare(previous.get(i), current.get(i)) != 0) + { + // it's a new group + live++; + previous = current; - return; ++ return true; + } + } + } ++ ++ return true; + } + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/80ba11c6/src/java/org/apache/cassandra/db/filter/SliceQueryFilter.java ---------------------------------------------------------------------- diff --cc src/java/org/apache/cassandra/db/filter/SliceQueryFilter.java index 697c715,9d5b705..dbce923 --- a/src/java/org/apache/cassandra/db/filter/SliceQueryFilter.java +++ b/src/java/org/apache/cassandra/db/filter/SliceQueryFilter.java @@@ -24,22 -24,22 +24,22 @@@ import java.util.* import com.google.common.collect.AbstractIterator; import com.google.common.collect.Iterators; ++import org.apache.cassandra.config.CFMetaData; ++import org.apache.cassandra.db.composites.*; ++import org.apache.cassandra.utils.ByteBufferUtil; ++import org.apache.cassandra.utils.Pair; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.apache.cassandra.config.DatabaseDescriptor; import org.apache.cassandra.db.*; import org.apache.cassandra.db.columniterator.OnDiskAtomIterator; - import org.apache.cassandra.db.composites.CType; - import org.apache.cassandra.db.composites.CellName; - import org.apache.cassandra.db.composites.CellNameType; - import org.apache.cassandra.db.composites.Composite; -import org.apache.cassandra.db.columniterator.SSTableSliceIterator; -import org.apache.cassandra.db.composites.*; import org.apache.cassandra.io.IVersionedSerializer; -import org.apache.cassandra.io.sstable.SSTableReader; +import org.apache.cassandra.io.sstable.format.SSTableReader; import org.apache.cassandra.io.util.DataOutputPlus; import org.apache.cassandra.io.util.FileDataInput; +import org.apache.cassandra.service.ClientWarn; import org.apache.cassandra.tracing.Tracing; -import org.apache.cassandra.utils.ByteBufferUtil; -import org.apache.cassandra.utils.Pair; public class SliceQueryFilter implements IDiskAtomFilter { http://git-wip-us.apache.org/repos/asf/cassandra/blob/80ba11c6/src/java/org/apache/cassandra/service/pager/AbstractQueryPager.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/80ba11c6/src/java/org/apache/cassandra/service/pager/SliceQueryPager.java ----------------------------------------------------------------------