public final boolean hasSlice() { for (SingleRestriction restriction : this) { if (restriction.isSlice()) return true; } return false; }
@Override public boolean hasSlice() { for (SingleRestriction restriction : restrictions) { if (restriction.isSlice()) return true; } return false; } }
public final boolean hasSlice() { for (SingleRestriction restriction : this) { if (restriction.isSlice()) return true; } return false; }
@Override public boolean hasSlice() { for (SingleRestriction restriction : restrictions) { if (restriction.isSlice()) return true; } return false; } }
public final boolean hasSlice() { for (SingleRestriction restriction : this) { if (restriction.isSlice()) return true; } return false; }
@Override public boolean hasSlice() { for (SingleRestriction restriction : restrictions) { if (restriction.isSlice()) return true; } return false; } }
/** * Checks if any of the underlying restriction is a slice restrictions. * * @return <code>true</code> if any of the underlying restriction is a slice restrictions, * <code>false</code> otherwise */ public final boolean hasSlice() { for (SingleRestriction restriction : restrictions) { if (restriction.isSlice()) return true; } return false; }
/** * Checks if any of the underlying restriction is a slice restrictions. * * @return <code>true</code> if any of the underlying restriction is a slice restrictions, * <code>false</code> otherwise */ public final boolean hasSlice() { for (SingleRestriction restriction : restrictions) { if (restriction.isSlice()) return true; } return false; }
/** * Checks if any of the underlying restriction is a slice restrictions. * * @return <code>true</code> if any of the underlying restriction is a slice restrictions, * <code>false</code> otherwise */ public final boolean hasSlice() { for (SingleRestriction restriction : restrictions) { if (restriction.isSlice()) return true; } return false; }
private boolean hasMultiColumnSlice() { for (SingleRestriction restriction : restrictions) { if (restriction.isMultiColumn() && restriction.isSlice()) return true; } return false; }
private boolean hasMultiColumnSlice() { for (SingleRestriction restriction : restrictions) { if (restriction.isMultiColumn() && restriction.isSlice()) return true; } return false; }
private boolean hasMultiColumnSlice() { for (SingleRestriction restriction : restrictions) { if (restriction.isMultiColumn() && restriction.isSlice()) return true; } return false; }
/** * Checks if underlying restrictions would require filtering * * @return <code>true</code> if any underlying restrictions require filtering, <code>false</code> * otherwise */ public final boolean needFiltering() { int position = 0; for (SingleRestriction restriction : restrictions) { if (handleInFilter(restriction, position)) return true; if (!restriction.isSlice()) position = restriction.getLastColumn().position() + 1; } return hasContains(); }
/** * Checks if underlying restrictions would require filtering * * @return <code>true</code> if any underlying restrictions require filtering, <code>false</code> * otherwise */ public final boolean needFiltering() { int position = 0; for (SingleRestriction restriction : restrictions) { if (handleInFilter(restriction, position)) return true; if (!restriction.isSlice()) position = restriction.getLastColumn().position() + 1; } return hasContains(); }
@Override public void addRowFilterTo(RowFilter filter, SecondaryIndexManager indexManager, QueryOptions options) throws InvalidRequestException { int position = 0; for (SingleRestriction restriction : restrictions) { // We ignore all the clustering columns that can be handled by slices. if (handleInFilter(restriction, position) || restriction.hasSupportingIndex(indexManager)) { restriction.addRowFilterTo(filter, indexManager, options); continue; } if (!restriction.isSlice()) position = restriction.getLastColumn().position() + 1; } }
@Override public void addRowFilterTo(RowFilter filter, SecondaryIndexManager indexManager, QueryOptions options) throws InvalidRequestException { int position = 0; for (SingleRestriction restriction : restrictions) { // We ignore all the clustering columns that can be handled by slices. if (handleInFilter(restriction, position) || restriction.hasSupportingIndex(indexManager)) { restriction.addRowFilterTo(filter, indexManager, options); continue; } if (!restriction.isSlice()) position = restriction.getLastColumn().position() + 1; } }
public ClusteringColumnRestrictions mergeWith(Restriction restriction) throws InvalidRequestException { SingleRestriction newRestriction = (SingleRestriction) restriction; RestrictionSet newRestrictionSet = restrictions.addRestriction(newRestriction); if (!isEmpty() && !allowFiltering) { SingleRestriction lastRestriction = restrictions.lastRestriction(); ColumnDefinition lastRestrictionStart = lastRestriction.getFirstColumn(); ColumnDefinition newRestrictionStart = restriction.getFirstColumn(); checkFalse(lastRestriction.isSlice() && newRestrictionStart.position() > lastRestrictionStart.position(), "Clustering column \"%s\" cannot be restricted (preceding column \"%s\" is restricted by a non-EQ relation)", newRestrictionStart.name, lastRestrictionStart.name); if (newRestrictionStart.position() < lastRestrictionStart.position() && newRestriction.isSlice()) throw invalidRequest("PRIMARY KEY column \"%s\" cannot be restricted (preceding column \"%s\" is restricted by a non-EQ relation)", restrictions.nextColumn(newRestrictionStart).name, newRestrictionStart.name); } return new ClusteringColumnRestrictions(this.comparator, newRestrictionSet, allowFiltering); }
@Override public SingleRestriction doMergeWith(SingleRestriction otherRestriction) { checkTrue(otherRestriction.isSlice(), "Column \"%s\" cannot be restricted by both an equality and an inequality relation", columnDef.name); SingleColumnRestriction.SliceRestriction otherSlice = (SingleColumnRestriction.SliceRestriction) otherRestriction; checkFalse(hasBound(Bound.START) && otherSlice.hasBound(Bound.START), "More than one restriction was found for the start bound on %s", columnDef.name); checkFalse(hasBound(Bound.END) && otherSlice.hasBound(Bound.END), "More than one restriction was found for the end bound on %s", columnDef.name); return new SliceRestriction(columnDef, slice.merge(otherSlice.slice)); }
@Override public SingleRestriction doMergeWith(SingleRestriction otherRestriction) { checkTrue(otherRestriction.isSlice(), "Column \"%s\" cannot be restricted by both an equality and an inequality relation", columnDef.name); SingleColumnRestriction.SliceRestriction otherSlice = (SingleColumnRestriction.SliceRestriction) otherRestriction; checkFalse(hasBound(Bound.START) && otherSlice.hasBound(Bound.START), "More than one restriction was found for the start bound on %s", columnDef.name); checkFalse(hasBound(Bound.END) && otherSlice.hasBound(Bound.END), "More than one restriction was found for the end bound on %s", columnDef.name); return new SliceRestriction(columnDef, slice.merge(otherSlice.slice)); }
@Override public SingleRestriction doMergeWith(SingleRestriction otherRestriction) { checkTrue(otherRestriction.isSlice(), "Column \"%s\" cannot be restricted by both an equality and an inequality relation", columnDef.name); SingleColumnRestriction.SliceRestriction otherSlice = (SingleColumnRestriction.SliceRestriction) otherRestriction; checkFalse(hasBound(Bound.START) && otherSlice.hasBound(Bound.START), "More than one restriction was found for the start bound on %s", columnDef.name); checkFalse(hasBound(Bound.END) && otherSlice.hasBound(Bound.END), "More than one restriction was found for the end bound on %s", columnDef.name); return new SliceRestriction(columnDef, slice.merge(otherSlice.slice)); }