/** * Union sorted {@literal sets} and store result in destination {@literal destinationKey} and apply weights to * individual sets. * * @param destinationKey must not be {@literal null}. * @param sets must not be {@literal null}. * @param weights must not be {@literal null}. * @return * @see <a href="http://redis.io/commands/zunionstore">Redis Documentation: ZUNIONSTORE</a> */ default Mono<Long> zUnionStore(ByteBuffer destinationKey, List<ByteBuffer> sets, List<Double> weights) { return zUnionStore(destinationKey, sets, weights, null); }
/** * Union sorted {@literal sets} and store result in destination {@literal destinationKey} and apply weights to * individual sets. * * @param destinationKey must not be {@literal null}. * @param sets must not be {@literal null}. * @param weights must not be {@literal null}. * @return * @since 2.1 * @see <a href="http://redis.io/commands/zunionstore">Redis Documentation: ZUNIONSTORE</a> */ default Mono<Long> zUnionStore(ByteBuffer destinationKey, List<ByteBuffer> sets, Weights weights) { return zUnionStore(destinationKey, sets, weights, null); }
/** * Union sorted {@literal sets} and store result in destination {@literal destinationKey}. * * @param destinationKey must not be {@literal null}. * @param sets must not be {@literal null}. * @return * @see <a href="http://redis.io/commands/zunionstore">Redis Documentation: ZUNIONSTORE</a> */ default Mono<Long> zUnionStore(ByteBuffer destinationKey, List<ByteBuffer> sets) { return zUnionStore(destinationKey, sets, Collections.emptyList()); }
@Override public Mono<Long> unionAndStore(K key, Collection<K> otherKeys, K destKey, Aggregate aggregate, Weights weights) { Assert.notNull(key, "Key must not be null!"); Assert.notNull(otherKeys, "Other keys must not be null!"); Assert.notNull(destKey, "Destination key must not be null!"); Assert.notNull(aggregate, "Aggregate must not be null!"); Assert.notNull(weights, "Weights must not be null!"); return createMono(connection -> Flux.fromIterable(getKeys(key, otherKeys)) // .map(this::rawKey) // .collectList() // .flatMap(serialized -> connection.zUnionStore(rawKey(destKey), serialized, weights, aggregate))); }
@Override public Mono<Long> unionAndStore(K key, Collection<K> otherKeys, K destKey) { Assert.notNull(key, "Key must not be null!"); Assert.notNull(otherKeys, "Other keys must not be null!"); Assert.notNull(destKey, "Destination key must not be null!"); return createMono(connection -> Flux.fromIterable(getKeys(key, otherKeys)) // .map(this::rawKey) // .collectList() // .flatMap(serialized -> connection.zUnionStore(rawKey(destKey), serialized))); }
/** * Union sorted {@literal sets} by applying {@literal aggregateFunction} and store result in destination * {@literal destinationKey} and apply weights to individual sets. * * @param destinationKey must not be {@literal null}. * @param sets must not be {@literal null}. * @param weights can be {@literal null}. * @param aggregateFunction can be {@literal null}. * @return * @see <a href="http://redis.io/commands/zunionstore">Redis Documentation: ZUNIONSTORE</a> */ default Mono<Long> zUnionStore(ByteBuffer destinationKey, List<ByteBuffer> sets, List<Double> weights, @Nullable Aggregate aggregateFunction) { Assert.notNull(destinationKey, "DestinationKey must not be null!"); Assert.notNull(sets, "Sets must not be null!"); return zUnionStore(Mono.just( ZUnionStoreCommand.sets(sets).aggregateUsing(aggregateFunction).applyWeights(weights).storeAs(destinationKey))) .next().map(NumericResponse::getOutput); }
/** * Union sorted {@literal sets} by applying {@literal aggregateFunction} and store result in destination * {@literal destinationKey} and apply weights to individual sets. * * @param destinationKey must not be {@literal null}. * @param sets must not be {@literal null}. * @param weights can be {@literal null}. * @param aggregateFunction can be {@literal null}. * @return * @since 2.1 * @see <a href="http://redis.io/commands/zunionstore">Redis Documentation: ZUNIONSTORE</a> */ default Mono<Long> zUnionStore(ByteBuffer destinationKey, List<ByteBuffer> sets, Weights weights, @Nullable Aggregate aggregateFunction) { Assert.notNull(destinationKey, "DestinationKey must not be null!"); Assert.notNull(sets, "Sets must not be null!"); return zUnionStore(Mono.just( ZUnionStoreCommand.sets(sets).aggregateUsing(aggregateFunction).applyWeights(weights).storeAs(destinationKey))) .next().map(NumericResponse::getOutput); }
/** * Union sorted {@literal sets} and store result in destination {@literal destinationKey} and apply weights to * individual sets. * * @param destinationKey must not be {@literal null}. * @param sets must not be {@literal null}. * @param weights must not be {@literal null}. * @return * @since 2.1 * @see <a href="http://redis.io/commands/zunionstore">Redis Documentation: ZUNIONSTORE</a> */ default Mono<Long> zUnionStore(ByteBuffer destinationKey, List<ByteBuffer> sets, Weights weights) { return zUnionStore(destinationKey, sets, weights, null); }
/** * Union sorted {@literal sets} and store result in destination {@literal destinationKey} and apply weights to * individual sets. * * @param destinationKey must not be {@literal null}. * @param sets must not be {@literal null}. * @param weights must not be {@literal null}. * @return * @see <a href="http://redis.io/commands/zunionstore">Redis Documentation: ZUNIONSTORE</a> */ default Mono<Long> zUnionStore(ByteBuffer destinationKey, List<ByteBuffer> sets, List<Double> weights) { return zUnionStore(destinationKey, sets, weights, null); }
/** * Union sorted {@literal sets} and store result in destination {@literal destinationKey} and apply weights to * individual sets. * * @param destinationKey must not be {@literal null}. * @param sets must not be {@literal null}. * @param weights must not be {@literal null}. * @return * @see <a href="http://redis.io/commands/zunionstore">Redis Documentation: ZUNIONSTORE</a> */ default Mono<Long> zUnionStore(ByteBuffer destinationKey, List<ByteBuffer> sets, List<Double> weights) { return zUnionStore(destinationKey, sets, weights, null); }
/** * Union sorted {@literal sets} and store result in destination {@literal destinationKey} and apply weights to * individual sets. * * @param destinationKey must not be {@literal null}. * @param sets must not be {@literal null}. * @param weights must not be {@literal null}. * @return * @since 2.1 * @see <a href="http://redis.io/commands/zunionstore">Redis Documentation: ZUNIONSTORE</a> */ default Mono<Long> zUnionStore(ByteBuffer destinationKey, List<ByteBuffer> sets, Weights weights) { return zUnionStore(destinationKey, sets, weights, null); }
/** * Union sorted {@literal sets} and store result in destination {@literal destinationKey}. * * @param destinationKey must not be {@literal null}. * @param sets must not be {@literal null}. * @return * @see <a href="http://redis.io/commands/zunionstore">Redis Documentation: ZUNIONSTORE</a> */ default Mono<Long> zUnionStore(ByteBuffer destinationKey, List<ByteBuffer> sets) { return zUnionStore(destinationKey, sets, Collections.emptyList()); }
/** * Union sorted {@literal sets} and store result in destination {@literal destinationKey}. * * @param destinationKey must not be {@literal null}. * @param sets must not be {@literal null}. * @return * @see <a href="http://redis.io/commands/zunionstore">Redis Documentation: ZUNIONSTORE</a> */ default Mono<Long> zUnionStore(ByteBuffer destinationKey, List<ByteBuffer> sets) { return zUnionStore(destinationKey, sets, Collections.emptyList()); }
@Override public Mono<Long> unionAndStore(K key, Collection<K> otherKeys, K destKey, Aggregate aggregate, Weights weights) { Assert.notNull(key, "Key must not be null!"); Assert.notNull(otherKeys, "Other keys must not be null!"); Assert.notNull(destKey, "Destination key must not be null!"); Assert.notNull(aggregate, "Aggregate must not be null!"); Assert.notNull(weights, "Weights must not be null!"); return createMono(connection -> Flux.fromIterable(getKeys(key, otherKeys)) // .map(this::rawKey) // .collectList() // .flatMap(serialized -> connection.zUnionStore(rawKey(destKey), serialized, weights, aggregate))); }
@Override public Mono<Long> unionAndStore(K key, Collection<K> otherKeys, K destKey, Aggregate aggregate, Weights weights) { Assert.notNull(key, "Key must not be null!"); Assert.notNull(otherKeys, "Other keys must not be null!"); Assert.notNull(destKey, "Destination key must not be null!"); Assert.notNull(aggregate, "Aggregate must not be null!"); Assert.notNull(weights, "Weights must not be null!"); return createMono(connection -> Flux.fromIterable(getKeys(key, otherKeys)) // .map(this::rawKey) // .collectList() // .flatMap(serialized -> connection.zUnionStore(rawKey(destKey), serialized, weights, aggregate))); }
@Override public Mono<Long> unionAndStore(K key, Collection<K> otherKeys, K destKey) { Assert.notNull(key, "Key must not be null!"); Assert.notNull(otherKeys, "Other keys must not be null!"); Assert.notNull(destKey, "Destination key must not be null!"); return createMono(connection -> Flux.fromIterable(getKeys(key, otherKeys)) // .map(this::rawKey) // .collectList() // .flatMap(serialized -> connection.zUnionStore(rawKey(destKey), serialized))); }
@Override public Mono<Long> unionAndStore(K key, Collection<K> otherKeys, K destKey) { Assert.notNull(key, "Key must not be null!"); Assert.notNull(otherKeys, "Other keys must not be null!"); Assert.notNull(destKey, "Destination key must not be null!"); return createMono(connection -> Flux.fromIterable(getKeys(key, otherKeys)) // .map(this::rawKey) // .collectList() // .flatMap(serialized -> connection.zUnionStore(rawKey(destKey), serialized))); }
/** * Union sorted {@literal sets} by applying {@literal aggregateFunction} and store result in destination * {@literal destinationKey} and apply weights to individual sets. * * @param destinationKey must not be {@literal null}. * @param sets must not be {@literal null}. * @param weights can be {@literal null}. * @param aggregateFunction can be {@literal null}. * @return * @since 2.1 * @see <a href="http://redis.io/commands/zunionstore">Redis Documentation: ZUNIONSTORE</a> */ default Mono<Long> zUnionStore(ByteBuffer destinationKey, List<ByteBuffer> sets, Weights weights, @Nullable Aggregate aggregateFunction) { Assert.notNull(destinationKey, "DestinationKey must not be null!"); Assert.notNull(sets, "Sets must not be null!"); return zUnionStore(Mono.just( ZUnionStoreCommand.sets(sets).aggregateUsing(aggregateFunction).applyWeights(weights).storeAs(destinationKey))) .next().map(NumericResponse::getOutput); }
/** * Union sorted {@literal sets} by applying {@literal aggregateFunction} and store result in destination * {@literal destinationKey} and apply weights to individual sets. * * @param destinationKey must not be {@literal null}. * @param sets must not be {@literal null}. * @param weights can be {@literal null}. * @param aggregateFunction can be {@literal null}. * @return * @see <a href="http://redis.io/commands/zunionstore">Redis Documentation: ZUNIONSTORE</a> */ default Mono<Long> zUnionStore(ByteBuffer destinationKey, List<ByteBuffer> sets, List<Double> weights, @Nullable Aggregate aggregateFunction) { Assert.notNull(destinationKey, "DestinationKey must not be null!"); Assert.notNull(sets, "Sets must not be null!"); return zUnionStore(Mono.just( ZUnionStoreCommand.sets(sets).aggregateUsing(aggregateFunction).applyWeights(weights).storeAs(destinationKey))) .next().map(NumericResponse::getOutput); }
/** * Union sorted {@literal sets} by applying {@literal aggregateFunction} and store result in destination * {@literal destinationKey} and apply weights to individual sets. * * @param destinationKey must not be {@literal null}. * @param sets must not be {@literal null}. * @param weights can be {@literal null}. * @param aggregateFunction can be {@literal null}. * @return * @see <a href="http://redis.io/commands/zunionstore">Redis Documentation: ZUNIONSTORE</a> */ default Mono<Long> zUnionStore(ByteBuffer destinationKey, List<ByteBuffer> sets, List<Double> weights, @Nullable Aggregate aggregateFunction) { Assert.notNull(destinationKey, "DestinationKey must not be null!"); Assert.notNull(sets, "Sets must not be null!"); return zUnionStore(Mono.just( ZUnionStoreCommand.sets(sets).aggregateUsing(aggregateFunction).applyWeights(weights).storeAs(destinationKey))) .next().map(NumericResponse::getOutput); }