public AbstractBounds<T> withNewRight(T newRight) { return new ExcludingBounds<T>(left, newRight); } }
public AbstractBounds<T> withNewRight(T newRight) { return new ExcludingBounds<T>(left, newRight); } }
public AbstractBounds<T> withNewRight(T newRight) { return new ExcludingBounds<T>(left, newRight); } }
public Pair<AbstractBounds<T>, AbstractBounds<T>> split(T position) { assert contains(position) || left.equals(position); if (left.equals(position)) return null; AbstractBounds<T> lb = new Range<T>(left, position); AbstractBounds<T> rb = new ExcludingBounds<T>(position, right); return Pair.create(lb, rb); }
public Pair<AbstractBounds<T>, AbstractBounds<T>> split(T position) { assert contains(position) || left.equals(position); if (left.equals(position)) return null; AbstractBounds<T> lb = new Range<T>(left, position); AbstractBounds<T> rb = new ExcludingBounds<T>(position, right); return Pair.create(lb, rb); }
/** * Compute a bounds of keys corresponding to a given bounds of token. */ private static ExcludingBounds<RowPosition> makeRowBounds(Token left, Token right, IPartitioner partitioner) { return new ExcludingBounds<RowPosition>(left.maxKeyBound(partitioner), right.minKeyBound(partitioner), partitioner); }
@SuppressWarnings("unchecked") public AbstractBounds<Token> toTokenBounds() { return (left instanceof RowPosition) ? new ExcludingBounds<Token>(((RowPosition)left).getToken(), ((RowPosition)right).getToken(), partitioner) : (ExcludingBounds<Token>)this; }
public Pair<AbstractBounds<T>, AbstractBounds<T>> split(T position) { assert contains(position) || left.equals(position); if (left.equals(position)) return null; AbstractBounds<T> lb = new Range<T>(left, position); AbstractBounds<T> rb = new ExcludingBounds<T>(position, right); return Pair.create(lb, rb); }
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 Pair<AbstractBounds<T>, AbstractBounds<T>> split(T position) { assert contains(position); AbstractBounds<T> lb = new Bounds<T>(left, position); AbstractBounds<T> rb = new ExcludingBounds<T>(position, right); return Pair.create(lb, rb); }
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 Pair<AbstractBounds<T>, AbstractBounds<T>> split(T position) { assert contains(position); AbstractBounds<T> lb = new Bounds<T>(left, position); AbstractBounds<T> rb = new ExcludingBounds<T>(position, right); return Pair.create(lb, rb); }
public Pair<AbstractBounds<T>, AbstractBounds<T>> split(T position) { assert contains(position); AbstractBounds<T> lb = new Bounds<T>(left, position); AbstractBounds<T> rb = new ExcludingBounds<T>(position, right); return Pair.create(lb, rb); }
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 Pair<AbstractBounds<T>, AbstractBounds<T>> split(T position) { assert contains(position); AbstractBounds<T> lb = new Bounds<T>(left, position); AbstractBounds<T> rb = new ExcludingBounds<T>(position, right); return Pair.create(lb, rb); }
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 PartitionRangeReadCommand makeFetchAdditionalPartitionReadCommand(int toQuery) { PartitionRangeReadCommand cmd = (PartitionRangeReadCommand) command; DataLimits newLimits = cmd.limits().forShortReadRetry(toQuery); AbstractBounds<PartitionPosition> bounds = cmd.dataRange().keyRange(); AbstractBounds<PartitionPosition> newBounds = bounds.inclusiveRight() ? new Range<>(lastPartitionKey, bounds.right) : new ExcludingBounds<>(lastPartitionKey, bounds.right); DataRange newDataRange = cmd.dataRange().forSubRange(newBounds); return cmd.withUpdatedLimitsAndDataRange(newLimits, newDataRange); }
private PartitionRangeReadCommand makeFetchAdditionalPartitionReadCommand(int toQuery) { PartitionRangeReadCommand cmd = (PartitionRangeReadCommand) command; DataLimits newLimits = cmd.limits().forShortReadRetry(toQuery); AbstractBounds<PartitionPosition> bounds = cmd.dataRange().keyRange(); AbstractBounds<PartitionPosition> newBounds = bounds.inclusiveRight() ? new Range<>(lastPartitionKey, bounds.right) : new ExcludingBounds<>(lastPartitionKey, bounds.right); DataRange newDataRange = cmd.dataRange().forSubRange(newBounds); return cmd.withUpdatedLimitsAndDataRange(newLimits, newDataRange); }
private PartitionRangeReadCommand makeFetchAdditionalPartitionReadCommand(int toQuery) { PartitionRangeReadCommand cmd = (PartitionRangeReadCommand) command; DataLimits newLimits = cmd.limits().forShortReadRetry(toQuery); AbstractBounds<PartitionPosition> bounds = cmd.dataRange().keyRange(); AbstractBounds<PartitionPosition> newBounds = bounds.inclusiveRight() ? new Range<>(lastPartitionKey, bounds.right) : new ExcludingBounds<>(lastPartitionKey, bounds.right); DataRange newDataRange = cmd.dataRange().forSubRange(newBounds); return cmd.withUpdatedLimitsAndDataRange(newLimits, newDataRange); }