private Pageable getPageableCommand(QueryOptions options, int limit, long now) throws RequestValidationException { if (isNotReturningAnyRows(options)) return null; int limitForQuery = updateLimitForQuery(limit); if (isKeyRange || usesSecondaryIndexing) return getRangeCommand(options, limitForQuery, now); List<ReadCommand> commands = getSliceCommands(options, limitForQuery, now); return commands == null ? null : new Pageable.ReadCommands(commands, limitForQuery); }