private CellName makeExclusiveSliceBound(Bound bound, CellNameType type, QueryOptions options) throws InvalidRequestException { if (sliceRestriction.isInclusive(bound)) return null; // We can only reach that point if cfm.comparator.isCompound() = false and the table has some clustering columns. // By consequence, we know that the table is a COMPACT table with only one clustering column. ByteBuffer value = sliceRestriction.isMultiColumn() ? ((MultiColumnRestriction.Slice) sliceRestriction).componentBounds(bound, options).get(0) : sliceRestriction.bound(bound, options); // Dense non-compound tables do not accept empty ByteBuffers. By consequence, if the slice value is empty // we know that we can treat the slice as inclusive. return value.hasRemaining() ? type.makeCellName(value) : null; }
if (!cfm.comparator.isCompound() && (!slice.isInclusive(Bound.START) || !slice.isInclusive(Bound.END))) stmt.sliceRestriction = slice;
public void setBound(Restriction.Slice slice) throws InvalidRequestException { for (Bound bound : Bound.values()) if (slice.hasBound(bound)) setBound(bound, slice.isInclusive(bound), slice.bound(bound)); }
private int updateLimitForQuery(int limit) { // Internally, we don't support exclusive bounds for slices. Instead, we query one more element if necessary // and exclude it later (in processColumnFamily) return sliceRestriction != null && (!sliceRestriction.isInclusive(Bound.START) || !sliceRestriction.isInclusive(Bound.END)) && limit != Integer.MAX_VALUE ? limit + 1 : limit; }