private boolean includeKeyBound(Bound b) { for (Restriction r : keyRestrictions) { if (r == null) return true; else if (r.isSlice()) { assert !r.isMultiColumn() : "Unexpectedly got multi-column restriction on partition key"; return ((SingleColumnRestriction.Slice)r).isInclusive(b); } } // All equality return true; }
"PRIMARY KEY column \"%s\" cannot be restricted (preceding column \"%s\" is not restricted)", cdef.name, previous.name)); if (previousRestriction.isMultiColumn() && previousRestriction.isIN()) throw new InvalidRequestException(String.format( "PRIMARY KEY column \"%s\" cannot be restricted (preceding column \"%s\" is restricted by an IN tuple notation)", cdef.name, previous.name)); if (!restriction.isMultiColumn() && i != stmt.columnRestrictions.length - 1) throw new InvalidRequestException(String.format("Clustering column \"%s\" cannot be restricted by an IN relation", cdef.name)); throw new InvalidRequestException(String.format("Cannot restrict column \"%s\" by IN relation as a collection is selected by the query", cdef.name)); if (restriction.isMultiColumn()) canRestrictFurtherComponents = false;
ByteBuffer value = restriction.isMultiColumn() ? ((MultiColumnRestriction.Slice) restriction).componentBounds(Bound.END, options).get(0) : ((Slice) restriction).bound(Bound.END, options);
if (r.isMultiColumn()) if (!r.isMultiColumn())
private Token getTokenBound(Bound b, QueryOptions options, IPartitioner p) throws InvalidRequestException { assert onToken; Restriction restriction = keyRestrictions[0]; assert !restriction.isMultiColumn() : "Unexpectedly got a multi-column restriction on a partition key for a range query"; SingleColumnRestriction keyRestriction = (SingleColumnRestriction)restriction; ByteBuffer value; if (keyRestriction.isEQ()) { value = keyRestriction.values(options).get(0); } else { SingleColumnRestriction.Slice slice = (SingleColumnRestriction.Slice)keyRestriction; if (!slice.hasBound(b)) return p.getMinimumToken(); value = slice.bound(b, options); } if (value == null) throw new InvalidRequestException("Invalid null token value"); return p.getTokenFactory().fromByteArray(value); }
if (r.isMultiColumn()) if (r.isMultiColumn()) if (r.isMultiColumn())
if (restriction.isMultiColumn())