public AbstractBounds<T> withNewRight(T newRight) { return new IncludingExcludingBounds<T>(left, newRight); } }
public AbstractBounds<T> withNewRight(T newRight) { return new IncludingExcludingBounds<T>(left, newRight); } }
public AbstractBounds<T> withNewRight(T newRight) { return new IncludingExcludingBounds<T>(left, newRight); } }
public AbstractBounds<T> withNewRight(T newRight) { return new IncludingExcludingBounds<T>(left, newRight); } }
public AbstractBounds<T> withNewRight(T newRight) { return new IncludingExcludingBounds<T>(left, newRight); } }
private AbstractBounds<RowPosition> makeIncludingKeyBounds(RowPosition lastReturnedKey) { // We always include lastReturnedKey since we may still be paging within a row, // and PagedRangeCommand will move over if we're not anyway AbstractBounds<RowPosition> bounds = command.keyRange; if (bounds instanceof Range || bounds instanceof Bounds) { return new Bounds<RowPosition>(lastReturnedKey, bounds.right); } else { return new IncludingExcludingBounds<RowPosition>(lastReturnedKey, bounds.right); } } }
/** * Compute a bounds of keys corresponding to a given bounds of token. */ private static IncludingExcludingBounds<RowPosition> makeRowBounds(Token left, Token right, IPartitioner partitioner) { return new IncludingExcludingBounds<RowPosition>(left.maxKeyBound(partitioner), right.minKeyBound(partitioner), partitioner); }
@SuppressWarnings("unchecked") public AbstractBounds<Token> toTokenBounds() { return (left instanceof RowPosition) ? new IncludingExcludingBounds<Token>(((RowPosition)left).getToken(), ((RowPosition)right).getToken(), partitioner) : (IncludingExcludingBounds<Token>)this; }
public static <T extends RingPosition<T>> AbstractBounds<T> bounds(T min, boolean inclusiveMin, T max, boolean inclusiveMax) { if (inclusiveMin && inclusiveMax) return new Bounds<T>(min, max); else if (inclusiveMax) return new Range<T>(min, max); else if (inclusiveMin) return new IncludingExcludingBounds<T>(min, max); else return new ExcludingBounds<T>(min, max); }
public static <T extends RingPosition<T>> AbstractBounds<T> bounds(T min, boolean inclusiveMin, T max, boolean inclusiveMax) { if (inclusiveMin && inclusiveMax) return new Bounds<T>(min, max); else if (inclusiveMax) return new Range<T>(min, max); else if (inclusiveMin) return new IncludingExcludingBounds<T>(min, max); else return new ExcludingBounds<T>(min, max); }
public static <T extends RingPosition<T>> AbstractBounds<T> bounds(T min, boolean inclusiveMin, T max, boolean inclusiveMax) { if (inclusiveMin && inclusiveMax) return new Bounds<T>(min, max); else if (inclusiveMax) return new Range<T>(min, max); else if (inclusiveMin) return new IncludingExcludingBounds<T>(min, max); else return new ExcludingBounds<T>(min, max); }
public static <T extends RingPosition<T>> AbstractBounds<T> bounds(T min, boolean inclusiveMin, T max, boolean inclusiveMax) { if (inclusiveMin && inclusiveMax) return new Bounds<T>(min, max); else if (inclusiveMax) return new Range<T>(min, max); else if (inclusiveMin) return new IncludingExcludingBounds<T>(min, max); else return new ExcludingBounds<T>(min, max); }
public static <T extends RingPosition<T>> AbstractBounds<T> bounds(T min, boolean inclusiveMin, T max, boolean inclusiveMax) { if (inclusiveMin && inclusiveMax) return new Bounds<T>(min, max); else if (inclusiveMax) return new Range<T>(min, max); else if (inclusiveMin) return new IncludingExcludingBounds<T>(min, max); else return new ExcludingBounds<T>(min, max); }
private AbstractBounds<PartitionPosition> makeKeyBounds(PartitionPosition lastReturnedKey, boolean includeLastKey) { AbstractBounds<PartitionPosition> bounds = ((PartitionRangeReadCommand)command).dataRange().keyRange(); if (bounds instanceof Range || bounds instanceof Bounds) { return includeLastKey ? new Bounds<PartitionPosition>(lastReturnedKey, bounds.right) : new Range<PartitionPosition>(lastReturnedKey, bounds.right); } else { return includeLastKey ? new IncludingExcludingBounds<PartitionPosition>(lastReturnedKey, bounds.right) : new ExcludingBounds<PartitionPosition>(lastReturnedKey, bounds.right); } } }
private AbstractBounds<PartitionPosition> makeKeyBounds(PartitionPosition lastReturnedKey, boolean includeLastKey) { AbstractBounds<PartitionPosition> bounds = ((PartitionRangeReadCommand)command).dataRange().keyRange(); if (bounds instanceof Range || bounds instanceof Bounds) { return includeLastKey ? new Bounds<PartitionPosition>(lastReturnedKey, bounds.right) : new Range<PartitionPosition>(lastReturnedKey, bounds.right); } else { return includeLastKey ? new IncludingExcludingBounds<PartitionPosition>(lastReturnedKey, bounds.right) : new ExcludingBounds<PartitionPosition>(lastReturnedKey, bounds.right); } } }
private AbstractBounds<PartitionPosition> makeKeyBounds(PartitionPosition lastReturnedKey, boolean includeLastKey) { AbstractBounds<PartitionPosition> bounds = ((PartitionRangeReadCommand)command).dataRange().keyRange(); if (bounds instanceof Range || bounds instanceof Bounds) { return includeLastKey ? new Bounds<PartitionPosition>(lastReturnedKey, bounds.right) : new Range<PartitionPosition>(lastReturnedKey, bounds.right); } else { return includeLastKey ? new IncludingExcludingBounds<PartitionPosition>(lastReturnedKey, bounds.right) : new ExcludingBounds<PartitionPosition>(lastReturnedKey, bounds.right); } } }
@Override public ReadCommand build() { PartitionPosition start = startKey; if (start == null) { start = cfs.getPartitioner().getMinimumToken().maxKeyBound(); startInclusive = false; } PartitionPosition end = endKey; if (end == null) { end = cfs.getPartitioner().getMinimumToken().maxKeyBound(); endInclusive = true; } AbstractBounds<PartitionPosition> bounds; if (startInclusive && endInclusive) bounds = new Bounds<>(start, end); else if (startInclusive && !endInclusive) bounds = new IncludingExcludingBounds<>(start, end); else if (!startInclusive && endInclusive) bounds = new Range<>(start, end); else bounds = new ExcludingBounds<>(start, end); return PartitionRangeReadCommand.create(false, cfs.metadata, nowInSeconds, makeColumnFilter(), filter, makeLimits(), new DataRange(bounds, makeFilter())); }
private AbstractBounds<PartitionPosition> getPartitionKeyBounds(IPartitioner p, QueryOptions options) { // Deal with unrestricted partition key components (special-casing is required to deal with 2i queries on the // first component of a composite partition key) queries that filter on the partition key. if (partitionKeyRestrictions.needFiltering(cfm)) return new Range<>(p.getMinimumToken().minKeyBound(), p.getMinimumToken().maxKeyBound()); ByteBuffer startKeyBytes = getPartitionKeyBound(Bound.START, options); ByteBuffer finishKeyBytes = getPartitionKeyBound(Bound.END, options); PartitionPosition startKey = PartitionPosition.ForKey.get(startKeyBytes, p); PartitionPosition finishKey = PartitionPosition.ForKey.get(finishKeyBytes, p); if (startKey.compareTo(finishKey) > 0 && !finishKey.isMinimum()) return null; if (partitionKeyRestrictions.isInclusive(Bound.START)) { return partitionKeyRestrictions.isInclusive(Bound.END) ? new Bounds<>(startKey, finishKey) : new IncludingExcludingBounds<>(startKey, finishKey); } return partitionKeyRestrictions.isInclusive(Bound.END) ? new Range<>(startKey, finishKey) : new ExcludingBounds<>(startKey, finishKey); }
private AbstractBounds<PartitionPosition> getPartitionKeyBounds(IPartitioner p, QueryOptions options) { // Deal with unrestricted partition key components (special-casing is required to deal with 2i queries on the // first component of a composite partition key) queries that filter on the partition key. if (partitionKeyRestrictions.needFiltering(cfm)) return new Range<>(p.getMinimumToken().minKeyBound(), p.getMinimumToken().maxKeyBound()); ByteBuffer startKeyBytes = getPartitionKeyBound(Bound.START, options); ByteBuffer finishKeyBytes = getPartitionKeyBound(Bound.END, options); PartitionPosition startKey = PartitionPosition.ForKey.get(startKeyBytes, p); PartitionPosition finishKey = PartitionPosition.ForKey.get(finishKeyBytes, p); if (startKey.compareTo(finishKey) > 0 && !finishKey.isMinimum()) return null; if (partitionKeyRestrictions.isInclusive(Bound.START)) { return partitionKeyRestrictions.isInclusive(Bound.END) ? new Bounds<>(startKey, finishKey) : new IncludingExcludingBounds<>(startKey, finishKey); } return partitionKeyRestrictions.isInclusive(Bound.END) ? new Range<>(startKey, finishKey) : new ExcludingBounds<>(startKey, finishKey); }
private AbstractBounds<PartitionPosition> getPartitionKeyBounds(IPartitioner p, QueryOptions options) { // Deal with unrestricted partition key components (special-casing is required to deal with 2i queries on the // first component of a composite partition key) queries that filter on the partition key. if (partitionKeyRestrictions.needFiltering(cfm)) return new Range<>(p.getMinimumToken().minKeyBound(), p.getMinimumToken().maxKeyBound()); ByteBuffer startKeyBytes = getPartitionKeyBound(Bound.START, options); ByteBuffer finishKeyBytes = getPartitionKeyBound(Bound.END, options); PartitionPosition startKey = PartitionPosition.ForKey.get(startKeyBytes, p); PartitionPosition finishKey = PartitionPosition.ForKey.get(finishKeyBytes, p); if (startKey.compareTo(finishKey) > 0 && !finishKey.isMinimum()) return null; if (partitionKeyRestrictions.isInclusive(Bound.START)) { return partitionKeyRestrictions.isInclusive(Bound.END) ? new Bounds<>(startKey, finishKey) : new IncludingExcludingBounds<>(startKey, finishKey); } return partitionKeyRestrictions.isInclusive(Bound.END) ? new Range<>(startKey, finishKey) : new ExcludingBounds<>(startKey, finishKey); }