[44/50] [abbrv] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/465496f3 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/465496f3 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/465496f3 Branch: refs/heads/cassandra-3.0 Commit: 465496f3a356f44d3754adbc1cbe305100854956 Parents: ad4a91d 6fb89b9 Author: Nate McCallAuthored: Tue Sep 20 14:10:10 2016 +1200 Committer: Nate McCall Committed: Tue Sep 20 14:11:33 2016 +1200 -- CHANGES.txt | 3 ++- .../org/apache/cassandra/transport/RequestThreadPoolExecutor.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/465496f3/CHANGES.txt -- diff --cc CHANGES.txt index fae713e,1438e98..6c5fded --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,33 -1,7 +1,34 @@@ -2.1.16 +2.2.8 + * Add local address entry in PropertyFileSnitch (CASSANDRA-11332) + * cqlshlib tests: increase default execute timeout (CASSANDRA-12481) + * Forward writes to replacement node when replace_address != broadcast_address (CASSANDRA-8523) + * Enable repair -pr and -local together (fix regression of CASSANDRA-7450) (CASSANDRA-12522) + * Fail repair on non-existing table (CASSANDRA-12279) + * cqlsh copy: fix missing counter values (CASSANDRA-12476) + * Move migration tasks to non-periodic queue, assure flush executor shutdown after non-periodic executor (CASSANDRA-12251) + * cqlsh copy: fixed possible race in initializing feeding thread (CASSANDRA-11701) + * Only set broadcast_rpc_address on Ec2MultiRegionSnitch if it's not set (CASSANDRA-11357) + * Update StorageProxy range metrics for timeouts, failures and unavailables (CASSANDRA-9507) + * Add Sigar to classes included in clientutil.jar (CASSANDRA-11635) + * Add decay to histograms and timers used for metrics (CASSANDRA-11752) + * Fix hanging stream session (CASSANDRA-10992) + * Add byteman support for testing (CASSANDRA-12377) + * Fix INSERT JSON, fromJson() support of smallint, tinyint types (CASSANDRA-12371) + * Restore JVM metric export for metric reporters (CASSANDRA-12312) + * Release sstables of failed stream sessions only when outgoing transfers are finished (CASSANDRA-11345) + * Revert CASSANDRA-11427 (CASSANDRA-12351) + * Wait for tracing events before returning response and query at same consistency level client side (CASSANDRA-11465) + * cqlsh copyutil should get host metadata by connected address (CASSANDRA-11979) + * Fixed cqlshlib.test.remove_test_db (CASSANDRA-12214) + * Synchronize ThriftServer::stop() (CASSANDRA-12105) + * Use dedicated thread for JMX notifications (CASSANDRA-12146) + * NPE when trying to remove purgable tombstones from result (CASSANDRA-12143) + * Improve streaming synchronization and fault tolerance (CASSANDRA-11414) + * MemoryUtil.getShort() should return an unsigned short also for architectures not supporting unaligned memory accesses (CASSANDRA-11973) + * Don't write shadowed range tombstone (CASSANDRA-12030) +Merged from 2.1: - * Fix queries with empty ByteBuffer values in clustering column restrictions (CASSANDRA-12127) + * Add system property to set the max number of native transport requests in queue (CASSANDRA-11363) - * Include column family parameter when -st and -et are provided (CASSANDRA-11866) + * Fix queries with empty ByteBuffer values in clustering column restrictions (CASSANDRA-12127) * Disable passing control to post-flush after flush failure to prevent data loss (CASSANDRA-11828) * Allow STCS-in-L0 compactions to reduce scope with LCS (CASSANDRA-12040) * cannot use cql since upgrading python to 2.7.11+ (CASSANDRA-11850) http://git-wip-us.apache.org/repos/asf/cassandra/blob/465496f3/src/java/org/apache/cassandra/transport/RequestThreadPoolExecutor.java -- diff --cc src/java/org/apache/cassandra/transport/RequestThreadPoolExecutor.java index 289f3e3,75b983a..75dd05d --- a/src/java/org/apache/cassandra/transport/RequestThreadPoolExecutor.java +++ b/src/java/org/apache/cassandra/transport/RequestThreadPoolExecutor.java @@@ -30,12 -30,12 +30,12 @@@ import static org.apache.cassandra.conc public class RequestThreadPoolExecutor extends AbstractEventExecutor { - private final static int MAX_QUEUED_REQUESTS = 128; + private final static int MAX_QUEUED_REQUESTS = Integer.getInteger("cassandra.max_queued_native_transport_requests", 128); private final static String THREAD_FACTORY_ID = "Native-Transport-Requests"; -private final TracingAwareExecutorService
[44/50] [abbrv] cassandra git commit: Merge branch cassandra-2.1 into cassandra-2.2
http://git-wip-us.apache.org/repos/asf/cassandra/blob/9583b6b3/src/java/org/apache/cassandra/cql3/restrictions/SingleColumnRestriction.java -- diff --cc src/java/org/apache/cassandra/cql3/restrictions/SingleColumnRestriction.java index 735a2e2,000..1f4960b mode 100644,00..100644 --- a/src/java/org/apache/cassandra/cql3/restrictions/SingleColumnRestriction.java +++ b/src/java/org/apache/cassandra/cql3/restrictions/SingleColumnRestriction.java @@@ -1,626 -1,0 +1,669 @@@ +/* + * 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.cql3.restrictions; + +import java.nio.ByteBuffer; +import java.util.*; + +import com.google.common.collect.Iterables; + ++import org.apache.cassandra.config.CFMetaData; +import org.apache.cassandra.config.ColumnDefinition; +import org.apache.cassandra.cql3.*; +import org.apache.cassandra.cql3.Term.Terminal; +import org.apache.cassandra.cql3.functions.Function; +import org.apache.cassandra.cql3.statements.Bound; +import org.apache.cassandra.db.IndexExpression; +import org.apache.cassandra.db.composites.CompositesBuilder; +import org.apache.cassandra.db.index.SecondaryIndex; +import org.apache.cassandra.db.index.SecondaryIndexManager; +import org.apache.cassandra.db.marshal.CompositeType; +import org.apache.cassandra.exceptions.InvalidRequestException; +import static org.apache.cassandra.cql3.statements.RequestValidations.checkBindValueSet; +import static org.apache.cassandra.cql3.statements.RequestValidations.checkFalse; +import static org.apache.cassandra.cql3.statements.RequestValidations.checkNotNull; +import static org.apache.cassandra.cql3.statements.RequestValidations.checkTrue; +import static org.apache.cassandra.cql3.statements.RequestValidations.invalidRequest; + +public abstract class SingleColumnRestriction extends AbstractRestriction +{ +/** + * The definition of the column to which apply the restriction. + */ +protected final ColumnDefinition columnDef; + +public SingleColumnRestriction(ColumnDefinition columnDef) +{ +this.columnDef = columnDef; +} + +@Override +public List getColumnDefs() +{ +return Collections.singletonList(columnDef); +} + +@Override +public ColumnDefinition getFirstColumn() +{ +return columnDef; +} + +@Override +public ColumnDefinition getLastColumn() +{ +return columnDef; +} + +@Override +public boolean hasSupportingIndex(SecondaryIndexManager indexManager) +{ +SecondaryIndex index = indexManager.getIndexForColumn(columnDef.name.bytes); +return index != null && isSupportedBy(index); +} + +@Override +public final Restriction mergeWith(Restriction otherRestriction) throws InvalidRequestException +{ +// We want to allow query like: b > ? AND (b,c) < (?, ?) +if (otherRestriction.isMultiColumn() && canBeConvertedToMultiColumnRestriction()) +{ +return toMultiColumnRestriction().mergeWith(otherRestriction); +} + +return doMergeWith(otherRestriction); +} + +protected abstract Restriction doMergeWith(Restriction otherRestriction) throws InvalidRequestException; + +/** + * Converts this SingleColumnRestriction into a {@link MultiColumnRestriction} + * + * @return the MultiColumnRestriction corresponding to this + */ +abstract MultiColumnRestriction toMultiColumnRestriction(); + +/** + * Checks if this Restriction can be converted into a {@link MultiColumnRestriction} + * + * @return true if this Restriction can be converted into a + * {@link MultiColumnRestriction}, false otherwise. + */ +boolean canBeConvertedToMultiColumnRestriction() +{ +return true; +} + +/** + * Check if this type of restriction is supported by the specified index. + * + * @param index the Secondary index + * @return true this type of restriction is supported by the specified index, + * false otherwise. +