@Override public PartitionKeyRestrictions mergeWith(Restriction restriction) throws InvalidRequestException { if (restriction.isOnToken()) return new TokenFilter(restrictions, (TokenRestriction) tokenRestriction.mergeWith(restriction)); return new TokenFilter(restrictions.mergeWith(restriction), tokenRestriction); }
@Override public PartitionKeyRestrictions mergeWith(Restriction restriction) { if (restriction.isOnToken()) { if (isEmpty()) return (PartitionKeyRestrictions) restriction; return new TokenFilter(this, (TokenRestriction) restriction); } return new PartitionKeySingleRestrictionSet(this, (SingleRestriction) restriction); }
@Override public final SingleRestriction mergeWith(SingleRestriction otherRestriction) { // We want to allow query like: b > ? AND (b,c) < (?, ?) if (otherRestriction.isMultiColumn() && canBeConvertedToMultiColumnRestriction()) { return toMultiColumnRestriction().mergeWith(otherRestriction); } return doMergeWith(otherRestriction); }
@Override public final SingleRestriction mergeWith(SingleRestriction otherRestriction) { // We want to allow query like: (b,c) > (?, ?) AND b < ? if (!otherRestriction.isMultiColumn() && ((SingleColumnRestriction) otherRestriction).canBeConvertedToMultiColumnRestriction()) { return doMergeWith(((SingleColumnRestriction) otherRestriction).toMultiColumnRestriction()); } return doMergeWith(otherRestriction); }
@Override public final PartitionKeyRestrictions mergeWith(Restriction otherRestriction) throws InvalidRequestException { if (!otherRestriction.isOnToken()) return new TokenFilter(toPartitionKeyRestrictions(otherRestriction), this); return doMergeWith((TokenRestriction) otherRestriction); }
public void addFunctionsTo(List<Function> functions) { partitionKeyRestrictions.addFunctionsTo(functions); clusteringColumnsRestrictions.addFunctionsTo(functions); nonPrimaryKeyRestrictions.addFunctionsTo(functions); }
@Override public boolean isOnToken() { // if all partition key columns have non-token restrictions and do not need filtering, // we can simply use the token range to filter those restrictions and then ignore the token range return needFiltering(tokenRestriction.metadata) || restrictions.size() < tokenRestriction.size(); }
@Override public boolean isInclusive(Bound bound) { return isOnToken() ? tokenRestriction.isInclusive(bound) : restrictions.isInclusive(bound); }
@Override public boolean isInclusive(Bound b) { if (isEmpty()) return false; return restrictions.lastRestriction().isInclusive(b); }
@Override public PartitionKeyRestrictions mergeWith(Restriction restriction) throws InvalidRequestException { if (restriction.isOnToken()) return new TokenFilter(restrictions, (TokenRestriction) tokenRestriction.mergeWith(restriction)); return new TokenFilter(restrictions.mergeWith(restriction), tokenRestriction); }
@Override public PartitionKeyRestrictions mergeWith(Restriction restriction) { if (restriction.isOnToken()) { if (isEmpty()) return (PartitionKeyRestrictions) restriction; return new TokenFilter(this, (TokenRestriction) restriction); } return new PartitionKeySingleRestrictionSet(this, (SingleRestriction) restriction); }
@Override public final SingleRestriction mergeWith(SingleRestriction otherRestriction) { // We want to allow query like: (b,c) > (?, ?) AND b < ? if (!otherRestriction.isMultiColumn() && ((SingleColumnRestriction) otherRestriction).canBeConvertedToMultiColumnRestriction()) { return doMergeWith(((SingleColumnRestriction) otherRestriction).toMultiColumnRestriction()); } return doMergeWith(otherRestriction); }
@Override public final PartitionKeyRestrictions mergeWith(Restriction otherRestriction) throws InvalidRequestException { if (!otherRestriction.isOnToken()) return new TokenFilter(toPartitionKeyRestrictions(otherRestriction), this); return doMergeWith((TokenRestriction) otherRestriction); }
public void addFunctionsTo(List<Function> functions) { partitionKeyRestrictions.addFunctionsTo(functions); clusteringColumnsRestrictions.addFunctionsTo(functions); nonPrimaryKeyRestrictions.addFunctionsTo(functions); }
@Override public boolean isOnToken() { // if all partition key columns have non-token restrictions and do not need filtering, // we can simply use the token range to filter those restrictions and then ignore the token range return needFiltering(tokenRestriction.metadata) || restrictions.size() < tokenRestriction.size(); }
@Override public boolean isInclusive(Bound bound) { return isOnToken() ? tokenRestriction.isInclusive(bound) : restrictions.isInclusive(bound); }