public PagingState state() { return lastReturnedKey == null ? null : new PagingState(lastReturnedKey.getKey(), lastReturnedRow, maxRemaining(), remainingInPartition()); }
public PagingState state() { return lastReturnedKey == null ? null : new PagingState(lastReturnedKey.getKey(), lastReturnedRow, maxRemaining(), remainingInPartition()); }
public PartitionRangeQueryPager withUpdatedLimit(DataLimits newLimits) { return new PartitionRangeQueryPager(command.withUpdatedLimit(newLimits), protocolVersion, lastReturnedKey, lastReturnedRow, maxRemaining(), remainingInPartition()); }
public PartitionRangeQueryPager withUpdatedLimit(DataLimits newLimits) { return new PartitionRangeQueryPager(command.withUpdatedLimit(newLimits), protocolVersion, lastReturnedKey, lastReturnedRow, maxRemaining(), remainingInPartition()); }
public PartitionRangeQueryPager withUpdatedLimit(DataLimits newLimits) { return new PartitionRangeQueryPager(command.withUpdatedLimit(newLimits), protocolVersion, lastReturnedKey, lastReturnedRow, maxRemaining(), remainingInPartition()); }
public PagingState state() { return lastReturnedKey == null ? null : new PagingState(lastReturnedKey.getKey(), lastReturnedRow, maxRemaining(), remainingInPartition()); }
protected ReadCommand nextPageReadCommand(int pageSize) throws RequestExecutionException { DataLimits limits; DataRange fullRange = ((PartitionRangeReadCommand)command).dataRange(); DataRange pageRange; if (lastReturnedKey == null) { pageRange = fullRange; limits = command.limits().forPaging(pageSize); } else { // We want to include the last returned key only if we haven't achieved our per-partition limit, otherwise, don't bother. boolean includeLastKey = remainingInPartition() > 0 && lastReturnedRow != null; AbstractBounds<PartitionPosition> bounds = makeKeyBounds(lastReturnedKey, includeLastKey); if (includeLastKey) { pageRange = fullRange.forPaging(bounds, command.metadata().comparator, lastReturnedRow.clustering(command.metadata()), false); limits = command.limits().forPaging(pageSize, lastReturnedKey.getKey(), remainingInPartition()); } else { pageRange = fullRange.forSubRange(bounds); limits = command.limits().forPaging(pageSize); } } return ((PartitionRangeReadCommand) command).withUpdatedLimitsAndDataRange(limits, pageRange); }
protected ReadCommand nextPageReadCommand(int pageSize) throws RequestExecutionException { DataLimits limits; DataRange fullRange = ((PartitionRangeReadCommand)command).dataRange(); DataRange pageRange; if (lastReturnedKey == null) { pageRange = fullRange; limits = command.limits().forPaging(pageSize); } else { // We want to include the last returned key only if we haven't achieved our per-partition limit, otherwise, don't bother. boolean includeLastKey = remainingInPartition() > 0 && lastReturnedRow != null; AbstractBounds<PartitionPosition> bounds = makeKeyBounds(lastReturnedKey, includeLastKey); if (includeLastKey) { pageRange = fullRange.forPaging(bounds, command.metadata().comparator, lastReturnedRow.clustering(command.metadata()), false); limits = command.limits().forPaging(pageSize, lastReturnedKey.getKey(), remainingInPartition()); } else { pageRange = fullRange.forSubRange(bounds); limits = command.limits().forPaging(pageSize); } } return ((PartitionRangeReadCommand) command).withUpdatedLimitsAndDataRange(limits, pageRange); }
protected ReadCommand nextPageReadCommand(int pageSize) throws RequestExecutionException { DataLimits limits; DataRange fullRange = ((PartitionRangeReadCommand)command).dataRange(); DataRange pageRange; if (lastReturnedKey == null) { pageRange = fullRange; limits = command.limits().forPaging(pageSize); } else { // We want to include the last returned key only if we haven't achieved our per-partition limit, otherwise, don't bother. boolean includeLastKey = remainingInPartition() > 0 && lastReturnedRow != null; AbstractBounds<PartitionPosition> bounds = makeKeyBounds(lastReturnedKey, includeLastKey); if (includeLastKey) { pageRange = fullRange.forPaging(bounds, command.metadata().comparator, lastReturnedRow.clustering(command.metadata()), false); limits = command.limits().forPaging(pageSize, lastReturnedKey.getKey(), remainingInPartition()); } else { pageRange = fullRange.forSubRange(bounds); limits = command.limits().forPaging(pageSize); } } return ((PartitionRangeReadCommand) command).withUpdatedLimitsAndDataRange(limits, pageRange); }