Merge branch 'cassandra-3.0' into cassandra-3.11
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/388c961e Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/388c961e Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/388c961e Branch: refs/heads/cassandra-3.11 Commit: 388c961e4bb8f0a414c6aa700c67cd76eaf01046 Parents: ca034ea b77e754 Author: Robert Stupp <[email protected]> Authored: Tue May 2 16:12:45 2017 -0700 Committer: Robert Stupp <[email protected]> Committed: Tue May 2 16:12:45 2017 -0700 ---------------------------------------------------------------------- CHANGES.txt | 1 + .../cassandra/cql3/functions/UDAggregate.java | 21 +++++---- .../validation/operations/AggregationTest.java | 46 ++++++++++++++++++++ 3 files changed, 60 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/388c961e/CHANGES.txt ---------------------------------------------------------------------- diff --cc CHANGES.txt index 1690e31,19cd39c..3844bfa --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,33 -1,4 +1,34 @@@ -3.0.14 +3.11.0 ++ * UDA fails without input rows (CASSANDRA-13399) + * Fix compaction-stress by using daemonInitialization (CASSANDRA-13188) + * V5 protocol flags decoding broken (CASSANDRA-13443) + * Use write lock not read lock for removing sstables from compaction strategies. (CASSANDRA-13422) + * Use corePoolSize equal to maxPoolSize in JMXEnabledThreadPoolExecutors (CASSANDRA-13329) + * Avoid rebuilding SASI indexes containing no values (CASSANDRA-12962) + * Add charset to Analyser input stream (CASSANDRA-13151) + * Fix testLimitSSTables flake caused by concurrent flush (CASSANDRA-12820) + * cdc column addition strikes again (CASSANDRA-13382) + * Fix static column indexes (CASSANDRA-13277) + * DataOutputBuffer.asNewBuffer broken (CASSANDRA-13298) + * unittest CipherFactoryTest failed on MacOS (CASSANDRA-13370) + * Forbid SELECT restrictions and CREATE INDEX over non-frozen UDT columns (CASSANDRA-13247) + * Default logging we ship will incorrectly print "?:?" for "%F:%L" pattern (CASSANDRA-13317) + * Possible AssertionError in UnfilteredRowIteratorWithLowerBound (CASSANDRA-13366) + * Support unaligned memory access for AArch64 (CASSANDRA-13326) + * Improve SASI range iterator efficiency on intersection with an empty range (CASSANDRA-12915). + * Fix equality comparisons of columns using the duration type (CASSANDRA-13174) + * Obfuscate password in stress-graphs (CASSANDRA-12233) + * Move to FastThreadLocalThread and FastThreadLocal (CASSANDRA-13034) + * nodetool stopdaemon errors out (CASSANDRA-13030) + * Tables in system_distributed should not use gcgs of 0 (CASSANDRA-12954) + * Fix primary index calculation for SASI (CASSANDRA-12910) + * More fixes to the TokenAllocator (CASSANDRA-12990) + * NoReplicationTokenAllocator should work with zero replication factor (CASSANDRA-12983) + * Address message coalescing regression (CASSANDRA-12676) + * Delete illegal character from StandardTokenizerImpl.jflex (CASSANDRA-13417) + * Fix cqlsh automatic protocol downgrade regression (CASSANDRA-13307) + * Tracing payload not passed from QueryMessage to tracing session (CASSANDRA-12835) +Merged from 3.0: * Fail repair if insufficient responses received (CASSANDRA-13397) * Fix SSTableLoader fail when the loaded table contains dropped columns (CASSANDRA-13276) * Avoid name clashes in CassandraIndexTest (CASSANDRA-13427) http://git-wip-us.apache.org/repos/asf/cassandra/blob/388c961e/src/java/org/apache/cassandra/cql3/functions/UDAggregate.java ---------------------------------------------------------------------- diff --cc src/java/org/apache/cassandra/cql3/functions/UDAggregate.java index 87c955f,96e19de..1a3174c --- a/src/java/org/apache/cassandra/cql3/functions/UDAggregate.java +++ b/src/java/org/apache/cassandra/cql3/functions/UDAggregate.java @@@ -156,21 -150,18 +156,15 @@@ public class UDAggregate extends Abstra private long stateFunctionCount; private long stateFunctionDuration; - private ByteBuffer state; - { - reset(); - } + private Object state; + private boolean needsInit = true; - public void addInput(int protocolVersion, List<ByteBuffer> values) throws InvalidRequestException + public void addInput(ProtocolVersion protocolVersion, List<ByteBuffer> values) throws InvalidRequestException { - if (needsInit) - { - state = initcond != null ? UDHelper.deserialize(stateTypeCodec, protocolVersion, initcond.duplicate()) : null; - stateFunctionDuration = 0; - stateFunctionCount = 0; - needsInit = false; - } ++ maybeInit(protocolVersion); + long startTime = System.nanoTime(); stateFunctionCount++; - List<ByteBuffer> fArgs = new ArrayList<>(values.size() + 1); - fArgs.add(state); - fArgs.addAll(values); if (stateFunction instanceof UDFunction) { UDFunction udf = (UDFunction)stateFunction; @@@ -184,10 -175,8 +178,21 @@@ stateFunctionDuration += (System.nanoTime() - startTime) / 1000; } - public ByteBuffer compute(int protocolVersion) throws InvalidRequestException ++ private void maybeInit(ProtocolVersion protocolVersion) + { ++ if (needsInit) ++ { ++ state = initcond != null ? UDHelper.deserialize(stateTypeCodec, protocolVersion, initcond.duplicate()) : null; ++ stateFunctionDuration = 0; ++ stateFunctionCount = 0; ++ needsInit = false; ++ } ++ } ++ + public ByteBuffer compute(ProtocolVersion protocolVersion) throws InvalidRequestException + { - assert !needsInit; ++ maybeInit(protocolVersion); + // final function is traced in UDFunction Tracing.trace("Executed UDA {}: {} call(s) to state function {} in {}\u03bcs", name(), stateFunctionCount, stateFunction.name(), stateFunctionDuration); if (finalFunction == null) http://git-wip-us.apache.org/repos/asf/cassandra/blob/388c961e/test/unit/org/apache/cassandra/cql3/validation/operations/AggregationTest.java ---------------------------------------------------------------------- --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
