@Override MultiColumnRestriction toMultiColumnRestriction() { return new MultiColumnRestriction.SliceRestriction(Collections.singletonList(columnDef), slice); }
@Override public MultiCBuilder appendBoundTo(MultiCBuilder builder, Bound bound, QueryOptions options) boolean reversed = getFirstColumn().isReversedType(); componentBounds.put(Bound.START, componentBounds(Bound.START, options)); componentBounds.put(Bound.END, componentBounds(Bound.END, options)); if (!hasComponent(b, i, componentBounds)) continue; if (hasComponent(b.reverse(), i, componentBounds)) toAdd.add(values); if (!hasComponent(b, i, componentBounds)) continue;
@Override public MultiCBuilder appendBoundTo(MultiCBuilder builder, Bound bound, QueryOptions options) boolean reversed = getFirstColumn().isReversedType(); componentBounds.put(Bound.START, componentBounds(Bound.START, options)); componentBounds.put(Bound.END, componentBounds(Bound.END, options)); if (!hasComponent(b, i, componentBounds)) continue; if (hasComponent(b.reverse(), i, componentBounds)) toAdd.add(values); if (!hasComponent(b, i, componentBounds)) continue;
@Override public MultiCBuilder appendBoundTo(MultiCBuilder builder, Bound bound, QueryOptions options) boolean reversed = getFirstColumn().isReversedType(); componentBounds.put(Bound.START, componentBounds(Bound.START, options)); componentBounds.put(Bound.END, componentBounds(Bound.END, options)); if (!hasComponent(b, i, componentBounds)) continue; if (hasComponent(b.reverse(), i, componentBounds)) toAdd.add(values); if (!hasComponent(b, i, componentBounds)) continue;
@Override public SingleRestriction doMergeWith(SingleRestriction otherRestriction) { checkTrue(otherRestriction.isSlice(), "Column \"%s\" cannot be restricted by both an equality and an inequality relation", getColumnsInCommons(otherRestriction)); if (!getFirstColumn().equals(otherRestriction.getFirstColumn())) { ColumnDefinition column = getFirstColumn().position() > otherRestriction.getFirstColumn().position() ? getFirstColumn() : otherRestriction.getFirstColumn(); throw invalidRequest("Column \"%s\" cannot be restricted by two inequalities not starting with the same column", column.name); } checkFalse(hasBound(Bound.START) && otherRestriction.hasBound(Bound.START), "More than one restriction was found for the start bound on %s", getColumnsInCommons(otherRestriction)); checkFalse(hasBound(Bound.END) && otherRestriction.hasBound(Bound.END), "More than one restriction was found for the end bound on %s", getColumnsInCommons(otherRestriction)); SliceRestriction otherSlice = (SliceRestriction) otherRestriction; List<ColumnDefinition> newColumnDefs = columnDefs.size() >= otherSlice.columnDefs.size() ? columnDefs : otherSlice.columnDefs; return new SliceRestriction(newColumnDefs, 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", getColumnsInCommons(otherRestriction)); if (!getFirstColumn().equals(otherRestriction.getFirstColumn())) { ColumnDefinition column = getFirstColumn().position() > otherRestriction.getFirstColumn().position() ? getFirstColumn() : otherRestriction.getFirstColumn(); throw invalidRequest("Column \"%s\" cannot be restricted by two inequalities not starting with the same column", column.name); } checkFalse(hasBound(Bound.START) && otherRestriction.hasBound(Bound.START), "More than one restriction was found for the start bound on %s", getColumnsInCommons(otherRestriction)); checkFalse(hasBound(Bound.END) && otherRestriction.hasBound(Bound.END), "More than one restriction was found for the end bound on %s", getColumnsInCommons(otherRestriction)); SliceRestriction otherSlice = (SliceRestriction) otherRestriction; List<ColumnDefinition> newColumnDefs = columnDefs.size() >= otherSlice.columnDefs.size() ? columnDefs : otherSlice.columnDefs; return new SliceRestriction(newColumnDefs, 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", getColumnsInCommons(otherRestriction)); if (!getFirstColumn().equals(otherRestriction.getFirstColumn())) { ColumnDefinition column = getFirstColumn().position() > otherRestriction.getFirstColumn().position() ? getFirstColumn() : otherRestriction.getFirstColumn(); throw invalidRequest("Column \"%s\" cannot be restricted by two inequalities not starting with the same column", column.name); } checkFalse(hasBound(Bound.START) && otherRestriction.hasBound(Bound.START), "More than one restriction was found for the start bound on %s", getColumnsInCommons(otherRestriction)); checkFalse(hasBound(Bound.END) && otherRestriction.hasBound(Bound.END), "More than one restriction was found for the end bound on %s", getColumnsInCommons(otherRestriction)); SliceRestriction otherSlice = (SliceRestriction) otherRestriction; List<ColumnDefinition> newColumnDefs = columnDefs.size() >= otherSlice.columnDefs.size() ? columnDefs : otherSlice.columnDefs; return new SliceRestriction(newColumnDefs, slice.merge(otherSlice.slice)); }
@Override protected Restriction newSliceRestriction(CFMetaData cfm, VariableSpecifications boundNames, Bound bound, boolean inclusive) throws InvalidRequestException { List<ColumnDefinition> receivers = receivers(cfm); Term term = toTerm(receivers, getValue(), cfm.ksName, boundNames); return new MultiColumnRestriction.SliceRestriction(receivers, bound, inclusive, term); }
@Override protected Restriction newSliceRestriction(CFMetaData cfm, VariableSpecifications boundNames, Bound bound, boolean inclusive) throws InvalidRequestException { List<ColumnDefinition> receivers = receivers(cfm); Term term = toTerm(receivers, getValue(), cfm.ksName, boundNames); return new MultiColumnRestriction.SliceRestriction(receivers, bound, inclusive, term); }
@Override MultiColumnRestriction toMultiColumnRestriction() { return new MultiColumnRestriction.SliceRestriction(Collections.singletonList(columnDef), slice); }
@Override MultiColumnRestriction toMultiColumnRestriction() { return new MultiColumnRestriction.SliceRestriction(Collections.singletonList(columnDef), slice); }
@Override protected Restriction newSliceRestriction(CFMetaData cfm, VariableSpecifications boundNames, Bound bound, boolean inclusive) throws InvalidRequestException { List<ColumnDefinition> receivers = receivers(cfm); Term term = toTerm(receivers, getValue(), cfm.ksName, boundNames); return new MultiColumnRestriction.SliceRestriction(receivers, bound, inclusive, term); }