Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 8B733200C77 for ; Fri, 7 Apr 2017 12:21:35 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 8A44A160B97; Fri, 7 Apr 2017 10:21:35 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 72EA9160BA2 for ; Fri, 7 Apr 2017 12:21:34 +0200 (CEST) Received: (qmail 82224 invoked by uid 500); 7 Apr 2017 10:21:33 -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 81816 invoked by uid 99); 7 Apr 2017 10:21:33 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Apr 2017 10:21:33 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 2D471E152F; Fri, 7 Apr 2017 10:21:33 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ifesdjeen@apache.org To: commits@cassandra.apache.org Date: Fri, 07 Apr 2017 10:21:35 -0000 Message-Id: In-Reply-To: <94be856332994ebcaa931a1ede98741d@git.apache.org> References: <94be856332994ebcaa931a1ede98741d@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [3/5] cassandra git commit: Merge branch 'cassandra-3.0' into cassandra-3.11 archived-at: Fri, 07 Apr 2017 10:21:35 -0000 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/863ad11c Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/863ad11c Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/863ad11c Branch: refs/heads/trunk Commit: 863ad11c8acb6c5f811d2cb2668eb353863f29e6 Parents: 5efaaf9 2d6fd78 Author: Alex Petrov Authored: Fri Apr 7 12:16:22 2017 +0200 Committer: Alex Petrov Committed: Fri Apr 7 12:16:22 2017 +0200 ---------------------------------------------------------------------- CHANGES.txt | 1 + .../db/SinglePartitionReadCommand.java | 11 +-- .../db/filter/ClusteringIndexNamesFilter.java | 6 +- .../db/partitions/AbstractBTreePartition.java | 5 -- .../cassandra/utils/IndexedSearchIterator.java | 5 ++ .../apache/cassandra/utils/SearchIterator.java | 2 - .../cassandra/utils/memory/EnsureOnHeap.java | 5 -- .../cql3/validation/operations/DeleteTest.java | 82 +++++++++++++++++++- .../partition/PartitionImplementationTest.java | 2 +- 9 files changed, 92 insertions(+), 27 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/863ad11c/CHANGES.txt ---------------------------------------------------------------------- diff --cc CHANGES.txt index 26e64d2,440ccd8..aa8c3ff --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,27 -1,5 +1,28 @@@ -3.0.13 +3.11.0 + * 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) +Merged from 3.0: + * Make reading of range tombstones more reliable (CASSANDRA-12811) * Fix startup problems due to schema tables not completely flushed (CASSANDRA-12213) * Fix view builder bug that can filter out data on restart (CASSANDRA-13405) * Fix 2i page size calculation when there are no regular columns (CASSANDRA-13400) http://git-wip-us.apache.org/repos/asf/cassandra/blob/863ad11c/src/java/org/apache/cassandra/db/SinglePartitionReadCommand.java ---------------------------------------------------------------------- diff --cc src/java/org/apache/cassandra/db/SinglePartitionReadCommand.java index 724f59e,99abd10..1358f29 --- a/src/java/org/apache/cassandra/db/SinglePartitionReadCommand.java +++ b/src/java/org/apache/cassandra/db/SinglePartitionReadCommand.java @@@ -778,13 -736,13 +778,13 @@@ public class SinglePartitionReadComman // We need to get the partition deletion and include it if it's live. In any case though, we're done with that sstable. sstable.incrementReadCount(); - try (UnfilteredRowIterator iter = StorageHook.instance.makeRowIterator(cfs, sstable, partitionKey(), Slices.ALL, columnFilter(), filter.isReversed(), isForThrift())) - try (UnfilteredRowIterator iter = filter.filter(sstable.iterator(partitionKey(), columnFilter(), filter.isReversed(), isForThrift()))) ++ try (UnfilteredRowIterator iter = StorageHook.instance.makeRowIterator(cfs, sstable, partitionKey(), filter.getSlices(metadata()), columnFilter(), filter.isReversed(), isForThrift())) { + sstablesIterated++; if (!iter.partitionLevelDeletion().isLive()) - { - sstablesIterated++; result = add(UnfilteredRowIterators.noRowsIterator(iter.metadata(), iter.partitionKey(), Rows.EMPTY_STATIC_ROW, iter.partitionLevelDeletion(), filter.isReversed()), result, filter, sstable.isRepaired()); - } + else + result = add(iter, result, filter, sstable.isRepaired()); } continue; } http://git-wip-us.apache.org/repos/asf/cassandra/blob/863ad11c/src/java/org/apache/cassandra/db/filter/ClusteringIndexNamesFilter.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/863ad11c/src/java/org/apache/cassandra/db/partitions/AbstractBTreePartition.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/863ad11c/src/java/org/apache/cassandra/utils/SearchIterator.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/863ad11c/src/java/org/apache/cassandra/utils/memory/EnsureOnHeap.java ---------------------------------------------------------------------- diff --cc src/java/org/apache/cassandra/utils/memory/EnsureOnHeap.java index 8345118,0000000..54ace5e mode 100644,000000..100644 --- a/src/java/org/apache/cassandra/utils/memory/EnsureOnHeap.java +++ b/src/java/org/apache/cassandra/utils/memory/EnsureOnHeap.java @@@ -1,170 -1,0 +1,165 @@@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +package org.apache.cassandra.utils.memory; + +import java.util.Iterator; + +import org.apache.cassandra.db.BufferDecoratedKey; +import org.apache.cassandra.db.Clustering; +import org.apache.cassandra.db.DecoratedKey; +import org.apache.cassandra.db.DeletionInfo; +import org.apache.cassandra.db.rows.*; +import org.apache.cassandra.db.transform.Transformation; +import org.apache.cassandra.utils.SearchIterator; + +public abstract class EnsureOnHeap extends Transformation +{ + public abstract DecoratedKey applyToPartitionKey(DecoratedKey key); + public abstract UnfilteredRowIterator applyToPartition(UnfilteredRowIterator partition); + public abstract SearchIterator applyToPartition(SearchIterator partition); + public abstract Iterator applyToPartition(Iterator partition); + public abstract DeletionInfo applyToDeletionInfo(DeletionInfo deletionInfo); + public abstract Row applyToRow(Row row); + public abstract Row applyToStatic(Row row); + public abstract RangeTombstoneMarker applyToMarker(RangeTombstoneMarker marker); + + static class CloneToHeap extends EnsureOnHeap + { + protected BaseRowIterator applyToPartition(BaseRowIterator partition) + { + return partition instanceof UnfilteredRowIterator + ? Transformation.apply((UnfilteredRowIterator) partition, this) + : Transformation.apply((RowIterator) partition, this); + } + + public DecoratedKey applyToPartitionKey(DecoratedKey key) + { + return new BufferDecoratedKey(key.getToken(), HeapAllocator.instance.clone(key.getKey())); + } + + public Row applyToRow(Row row) + { + if (row == null) + return null; + return Rows.copy(row, HeapAllocator.instance.cloningBTreeRowBuilder()).build(); + } + + public Row applyToStatic(Row row) + { + if (row == Rows.EMPTY_STATIC_ROW) + return row; + return applyToRow(row); + } + + public RangeTombstoneMarker applyToMarker(RangeTombstoneMarker marker) + { + return marker.copy(HeapAllocator.instance); + } + + public UnfilteredRowIterator applyToPartition(UnfilteredRowIterator partition) + { + return Transformation.apply(partition, this); + } + + public SearchIterator applyToPartition(SearchIterator partition) + { + return new SearchIterator() + { - public boolean hasNext() - { - return partition.hasNext(); - } - + public Row next(Clustering key) + { + return applyToRow(partition.next(key)); + } + }; + } + + public Iterator applyToPartition(Iterator partition) + { + return new Iterator() + { + public boolean hasNext() + { + return partition.hasNext(); + } + public Row next() + { + return applyToRow(partition.next()); + } + public void remove() + { + partition.remove(); + } + }; + } + + public DeletionInfo applyToDeletionInfo(DeletionInfo deletionInfo) + { + return deletionInfo.copy(HeapAllocator.instance); + } + } + + static class NoOp extends EnsureOnHeap + { + protected BaseRowIterator applyToPartition(BaseRowIterator partition) + { + return partition; + } + + public DecoratedKey applyToPartitionKey(DecoratedKey key) + { + return key; + } + + public Row applyToRow(Row row) + { + return row; + } + + public Row applyToStatic(Row row) + { + return row; + } + + public RangeTombstoneMarker applyToMarker(RangeTombstoneMarker marker) + { + return marker; + } + + public UnfilteredRowIterator applyToPartition(UnfilteredRowIterator partition) + { + return partition; + } + + public SearchIterator applyToPartition(SearchIterator partition) + { + return partition; + } + + public Iterator applyToPartition(Iterator partition) + { + return partition; + } + + public DeletionInfo applyToDeletionInfo(DeletionInfo deletionInfo) + { + return deletionInfo; + } + } +} http://git-wip-us.apache.org/repos/asf/cassandra/blob/863ad11c/test/unit/org/apache/cassandra/cql3/validation/operations/DeleteTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/863ad11c/test/unit/org/apache/cassandra/db/partition/PartitionImplementationTest.java ----------------------------------------------------------------------