@Override public Flux<BooleanResponse<RangeCommand>> lTrim(Publisher<RangeCommand> commands) { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { Assert.notNull(command.getKey(), "Key must not be null!"); Assert.notNull(command.getRange(), "Range must not be null!"); Range<Long> range = command.getRange(); Mono<String> result = cmd.ltrim(command.getKey(), // LettuceConverters.getLowerBoundIndex(range), // LettuceConverters.getUpperBoundIndex(range)); return result .map(LettuceConverters::stringToBoolean).map(value -> new BooleanResponse<>(command, value)); })); }
@Override public Flux<CommandResponse<RangeCommand, Flux<ByteBuffer>>> lRange(Publisher<RangeCommand> commands) { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { Assert.notNull(command.getKey(), "Key must not be null!"); Assert.notNull(command.getRange(), "Range must not be null!"); Range<Long> range = command.getRange(); Flux<ByteBuffer> result = cmd.lrange(command.getKey(), // LettuceConverters.getLowerBoundIndex(range), // LettuceConverters.getUpperBoundIndex(range)); return Mono.just(new CommandResponse<>(command, result)); })); }
@Override public Flux<ByteBufferResponse<RangeCommand>> getRange(Publisher<RangeCommand> commands) { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { Assert.notNull(command.getKey(), "Key must not be null!"); Assert.notNull(command.getRange(), "Range must not be null!"); Range<Long> range = command.getRange(); Mono<ByteBuffer> result = cmd.getrange(command.getKey(), // LettuceConverters.getLowerBoundIndex(range), // LettuceConverters.getUpperBoundIndex(range)); return result.map((value) -> new ByteBufferResponse<>(command, value)); })); }
@Override public Flux<NumericResponse<ZRemRangeByRankCommand, Long>> zRemRangeByRank( Publisher<ZRemRangeByRankCommand> commands) { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { Assert.notNull(command.getKey(), "Key must not be null!"); Assert.notNull(command.getRange(), "Range must not be null!"); Mono<Long> result = cmd.zremrangebyrank(command.getKey(), // LettuceConverters.getLowerBoundIndex(command.getRange()), // LettuceConverters.getUpperBoundIndex(command.getRange())); return result .map(value -> new NumericResponse<>(command, value)); })); }
@Override public Flux<NumericResponse<BitCountCommand, Long>> bitCount(Publisher<BitCountCommand> commands) { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { Assert.notNull(command.getKey(), "Key must not be null!"); Range<Long> range = command.getRange(); return (!Range.unbounded().equals(range) ? cmd.bitcount(command.getKey(), LettuceConverters.getLowerBoundIndex(range), // LettuceConverters.getUpperBoundIndex(range)) // : cmd.bitcount(command.getKey())).map(responseValue -> new NumericResponse<>(command, responseValue)); })); }
long stop = LettuceConverters.getUpperBoundIndex(command.getRange());
@Override public Flux<BooleanResponse<RangeCommand>> lTrim(Publisher<RangeCommand> commands) { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { Assert.notNull(command.getKey(), "Key must not be null!"); Assert.notNull(command.getRange(), "Range must not be null!"); Range<Long> range = command.getRange(); Mono<String> result = cmd.ltrim(command.getKey(), // LettuceConverters.getLowerBoundIndex(range), // LettuceConverters.getUpperBoundIndex(range)); return result .map(LettuceConverters::stringToBoolean).map(value -> new BooleanResponse<>(command, value)); })); }
@Override public Flux<BooleanResponse<RangeCommand>> lTrim(Publisher<RangeCommand> commands) { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { Assert.notNull(command.getKey(), "Key must not be null!"); Assert.notNull(command.getRange(), "Range must not be null!"); Range<Long> range = command.getRange(); Mono<String> result = cmd.ltrim(command.getKey(), // LettuceConverters.getLowerBoundIndex(range), // LettuceConverters.getUpperBoundIndex(range)); return result .map(LettuceConverters::stringToBoolean).map(value -> new BooleanResponse<>(command, value)); })); }
@Override public Flux<CommandResponse<RangeCommand, Flux<ByteBuffer>>> lRange(Publisher<RangeCommand> commands) { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { Assert.notNull(command.getKey(), "Key must not be null!"); Assert.notNull(command.getRange(), "Range must not be null!"); Range<Long> range = command.getRange(); Flux<ByteBuffer> result = cmd.lrange(command.getKey(), // LettuceConverters.getLowerBoundIndex(range), // LettuceConverters.getUpperBoundIndex(range)); return Mono.just(new CommandResponse<>(command, result)); })); }
@Override public Flux<CommandResponse<RangeCommand, Flux<ByteBuffer>>> lRange(Publisher<RangeCommand> commands) { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { Assert.notNull(command.getKey(), "Key must not be null!"); Assert.notNull(command.getRange(), "Range must not be null!"); Range<Long> range = command.getRange(); Flux<ByteBuffer> result = cmd.lrange(command.getKey(), // LettuceConverters.getLowerBoundIndex(range), // LettuceConverters.getUpperBoundIndex(range)); return Mono.just(new CommandResponse<>(command, result)); })); }
@Override public Flux<ByteBufferResponse<RangeCommand>> getRange(Publisher<RangeCommand> commands) { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { Assert.notNull(command.getKey(), "Key must not be null!"); Assert.notNull(command.getRange(), "Range must not be null!"); Range<Long> range = command.getRange(); Mono<ByteBuffer> result = cmd.getrange(command.getKey(), // LettuceConverters.getLowerBoundIndex(range), // LettuceConverters.getUpperBoundIndex(range)); return result.map((value) -> new ByteBufferResponse<>(command, value)); })); }
@Override public Flux<ByteBufferResponse<RangeCommand>> getRange(Publisher<RangeCommand> commands) { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { Assert.notNull(command.getKey(), "Key must not be null!"); Assert.notNull(command.getRange(), "Range must not be null!"); Range<Long> range = command.getRange(); Mono<ByteBuffer> result = cmd.getrange(command.getKey(), // LettuceConverters.getLowerBoundIndex(range), // LettuceConverters.getUpperBoundIndex(range)); return result.map((value) -> new ByteBufferResponse<>(command, value)); })); }
@Override public Flux<NumericResponse<ZRemRangeByRankCommand, Long>> zRemRangeByRank( Publisher<ZRemRangeByRankCommand> commands) { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { Assert.notNull(command.getKey(), "Key must not be null!"); Assert.notNull(command.getRange(), "Range must not be null!"); Mono<Long> result = cmd.zremrangebyrank(command.getKey(), // LettuceConverters.getLowerBoundIndex(command.getRange()), // LettuceConverters.getUpperBoundIndex(command.getRange())); return result .map(value -> new NumericResponse<>(command, value)); })); }
@Override public Flux<NumericResponse<ZRemRangeByRankCommand, Long>> zRemRangeByRank( Publisher<ZRemRangeByRankCommand> commands) { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { Assert.notNull(command.getKey(), "Key must not be null!"); Assert.notNull(command.getRange(), "Range must not be null!"); Mono<Long> result = cmd.zremrangebyrank(command.getKey(), // LettuceConverters.getLowerBoundIndex(command.getRange()), // LettuceConverters.getUpperBoundIndex(command.getRange())); return result .map(value -> new NumericResponse<>(command, value)); })); }
@Override public Flux<NumericResponse<BitCountCommand, Long>> bitCount(Publisher<BitCountCommand> commands) { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { Assert.notNull(command.getKey(), "Key must not be null!"); Range<Long> range = command.getRange(); return (!Range.unbounded().equals(range) ? cmd.bitcount(command.getKey(), LettuceConverters.getLowerBoundIndex(range), // LettuceConverters.getUpperBoundIndex(range)) // : cmd.bitcount(command.getKey())).map(responseValue -> new NumericResponse<>(command, responseValue)); })); }
@Override public Flux<NumericResponse<BitCountCommand, Long>> bitCount(Publisher<BitCountCommand> commands) { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { Assert.notNull(command.getKey(), "Key must not be null!"); Range<Long> range = command.getRange(); return (!Range.unbounded().equals(range) ? cmd.bitcount(command.getKey(), LettuceConverters.getLowerBoundIndex(range), // LettuceConverters.getUpperBoundIndex(range)) // : cmd.bitcount(command.getKey())).map(responseValue -> new NumericResponse<>(command, responseValue)); })); }
long stop = LettuceConverters.getUpperBoundIndex(command.getRange());
long stop = LettuceConverters.getUpperBoundIndex(command.getRange());