All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.quarkus.redis.runtime.datasource.ReactiveTransactionalSortedSetCommandsImpl Maven / Gradle / Ivy

There is a newer version: 3.17.5
Show newest version
package io.quarkus.redis.runtime.datasource;

import java.time.Duration;
import java.util.Map;

import io.quarkus.redis.datasource.sortedset.Range;
import io.quarkus.redis.datasource.sortedset.ReactiveTransactionalSortedSetCommands;
import io.quarkus.redis.datasource.sortedset.ScoreRange;
import io.quarkus.redis.datasource.sortedset.ScoredValue;
import io.quarkus.redis.datasource.sortedset.ZAddArgs;
import io.quarkus.redis.datasource.sortedset.ZAggregateArgs;
import io.quarkus.redis.datasource.sortedset.ZRangeArgs;
import io.quarkus.redis.datasource.transactions.ReactiveTransactionalRedisDataSource;
import io.smallrye.mutiny.Uni;
import io.vertx.mutiny.redis.client.Response;

public class ReactiveTransactionalSortedSetCommandsImpl extends AbstractTransactionalCommands
        implements ReactiveTransactionalSortedSetCommands {

    private final ReactiveSortedSetCommandsImpl reactive;

    public ReactiveTransactionalSortedSetCommandsImpl(ReactiveTransactionalRedisDataSource ds,
            ReactiveSortedSetCommandsImpl reactive, TransactionHolder tx) {
        super(ds, tx);
        this.reactive = reactive;
    }

    @Override
    public Uni zadd(K key, double score, V member) {
        this.tx.enqueue(reactive::decodeIntAsBoolean);
        return this.reactive._zadd(key, score, member).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zadd(K key, Map items) {
        this.tx.enqueue(Response::toInteger);
        return this.reactive._zadd(key, items).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zadd(K key, ScoredValue... items) {
        this.tx.enqueue(Response::toInteger);
        return this.reactive._zadd(key, items).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zadd(K key, ZAddArgs zAddArgs, double score, V member) {
        this.tx.enqueue(Response::toBoolean);
        return this.reactive._zadd(key, zAddArgs, score, member).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zadd(K key, ZAddArgs zAddArgs, Map items) {
        this.tx.enqueue(Response::toInteger);
        return this.reactive._zadd(key, zAddArgs, items).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zadd(K key, ZAddArgs zAddArgs, ScoredValue... items) {
        this.tx.enqueue(Response::toInteger);
        return this.reactive._zadd(key, zAddArgs, items).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zaddincr(K key, double score, V member) {
        this.tx.enqueue(Response::toDouble);
        return this.reactive._zaddincr(key, score, member).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zaddincr(K key, ZAddArgs zAddArgs, double score, V member) {
        this.tx.enqueue(this.reactive::decodeAsDouble);
        return this.reactive._zaddincr(key, zAddArgs, score, member).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zcard(K key) {
        this.tx.enqueue(reactive::decodeLongOrZero);
        return this.reactive._zcard(key).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zcount(K key, ScoreRange range) {
        this.tx.enqueue(Response::toLong);
        return this.reactive._zcount(key, range).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zdiff(K... keys) {
        this.tx.enqueue(this.reactive::decodeAsListOfValues);
        return this.reactive._zdiff(keys).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zdiffWithScores(K... keys) {
        this.tx.enqueue(this.reactive::decodeAsListOfScoredValues);
        return this.reactive._zdiffWithScores(keys).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zdiffstore(K destination, K... keys) {
        this.tx.enqueue(Response::toLong);
        return this.reactive._zdiffstore(destination, keys).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zincrby(K key, double increment, V member) {
        this.tx.enqueue(Response::toDouble);
        return this.reactive._zincrby(key, increment, member).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zinter(ZAggregateArgs arguments, K... keys) {
        this.tx.enqueue(reactive::decodeAsListOfValues);
        return this.reactive._zinter(arguments, keys).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zinter(K... keys) {
        this.tx.enqueue(this.reactive::decodeAsListOfValues);
        return this.reactive._zinter(keys).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zinterWithScores(ZAggregateArgs arguments, K... keys) {
        this.tx.enqueue(this.reactive::decodeAsListOfScoredValues);
        return this.reactive._zinterWithScores(arguments, keys).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zinterWithScores(K... keys) {
        this.tx.enqueue(this.reactive::decodeAsListOfScoredValues);
        return this.reactive._zinterWithScores(keys).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zintercard(K... keys) {
        this.tx.enqueue(Response::toLong);
        return this.reactive._zintercard(keys).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zintercard(long limit, K... keys) {
        this.tx.enqueue(Response::toLong);
        return this.reactive._zintercard(limit, keys).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zinterstore(K destination, ZAggregateArgs arguments, K... keys) {
        this.tx.enqueue(Response::toLong);
        return this.reactive._zinterstore(destination, arguments, keys).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zinterstore(K destination, K... keys) {
        this.tx.enqueue(Response::toLong);
        return this.reactive._zinterstore(destination, keys).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zlexcount(K key, Range range) {
        this.tx.enqueue(Response::toLong);
        return this.reactive._zlexcount(key, range).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zmpopMin(K... keys) {
        this.tx.enqueue(this.reactive::decodePopResponse);
        return this.reactive._zmpopMin(keys).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zmpopMin(int count, K... keys) {
        this.tx.enqueue(this.reactive::decodePopResponseWithCount);
        return this.reactive._zmpopMin(count, keys).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zmpopMax(K... keys) {
        this.tx.enqueue(this.reactive::decodePopResponse);
        return this.reactive._zmpopMax(keys).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zmpopMax(int count, K... keys) {
        this.tx.enqueue(this.reactive::decodePopResponseWithCount);
        return this.reactive._zmpopMax(count, keys).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni bzmpopMin(Duration timeout, K... keys) {
        this.tx.enqueue(this.reactive::decodePopResponse);
        return this.reactive._bzmpopMin(timeout, keys).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni bzmpopMin(Duration timeout, int count, K... keys) {
        this.tx.enqueue(this.reactive::decodePopResponseWithCount);
        return this.reactive._bzmpopMin(timeout, count, keys).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni bzmpopMax(Duration timeout, K... keys) {
        this.tx.enqueue(this.reactive::decodePopResponse);
        return this.reactive._bzmpopMax(timeout, keys).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni bzmpopMax(Duration timeout, int count, K... keys) {
        this.tx.enqueue(this.reactive::decodePopResponseWithCount);
        return this.reactive._bzmpopMax(timeout, count, keys).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zmscore(K key, V... members) {
        this.tx.enqueue(this.reactive::decodeAsListOfDouble);
        return this.reactive._zmscore(key, members).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zpopmax(K key) {
        this.tx.enqueue(this.reactive::decodeAsScoredValue);
        return this.reactive._zpopmax(key).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zpopmax(K key, int count) {
        this.tx.enqueue(this.reactive::decodeAsListOfScoredValues);
        return this.reactive._zpopmax(key, count).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zpopmin(K key) {
        this.tx.enqueue(this.reactive::decodeAsScoredValue);
        return this.reactive._zpopmin(key).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zpopmin(K key, int count) {
        this.tx.enqueue(this.reactive::decodeAsListOfScoredValues);
        return this.reactive._zpopmin(key, count).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zrandmember(K key) {
        this.tx.enqueue(this.reactive::decodeV);
        return this.reactive._zrandmember(key).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zrandmember(K key, int count) {
        this.tx.enqueue(this.reactive::decodeAsListOfValues);
        return this.reactive._zrandmember(key, count).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zrandmemberWithScores(K key) {
        this.tx.enqueue(this.reactive::decodeAsScoredValueOrEmpty);
        return this.reactive._zrandmemberWithScores(key).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zrandmemberWithScores(K key, int count) {
        this.tx.enqueue(this.reactive::decodeAsListOfScoredValues);
        return this.reactive._zrandmemberWithScores(key, count).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni bzpopmin(Duration timeout, K... keys) {
        this.tx.enqueue(this.reactive::decodeAsKeyValue);
        return this.reactive._bzpopmin(timeout, keys).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni bzpopmax(Duration timeout, K... keys) {
        this.tx.enqueue(this.reactive::decodeAsKeyValue);
        return this.reactive._bzpopmax(timeout, keys).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zrange(K key, long start, long stop, ZRangeArgs args) {
        this.tx.enqueue(this.reactive::decodeAsListOfValues);
        return this.reactive._zrange(key, start, stop, args).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zrangeWithScores(K key, long start, long stop, ZRangeArgs args) {
        this.tx.enqueue(this.reactive::decodeAsListOfScoredValues);
        return this.reactive._zrangeWithScores(key, start, stop, args).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zrange(K key, long start, long stop) {
        this.tx.enqueue(this.reactive::decodeAsListOfValues);
        return this.reactive._zrange(key, start, stop).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zrangeWithScores(K key, long start, long stop) {
        this.tx.enqueue(this.reactive::decodeAsListOfScoredValues);
        return this.reactive._zrangeWithScores(key, start, stop).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zrangebylex(K key, Range range, ZRangeArgs args) {
        this.tx.enqueue(this.reactive::decodeAsListOfValues);
        return this.reactive._zrangebylex(key, range, args).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zrangebylex(K key, Range range) {
        this.tx.enqueue(this.reactive::decodeAsListOfValues);
        return this.reactive._zrangebylex(key, range).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zrangebyscore(K key, ScoreRange range, ZRangeArgs args) {
        this.tx.enqueue(this.reactive::decodeAsListOfValues);
        return this.reactive._zrangebyscore(key, range, args).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zrangebyscoreWithScores(K key, ScoreRange range, ZRangeArgs args) {
        this.tx.enqueue(this.reactive::decodeAsListOfScoredValues);
        return this.reactive._zrangebyscoreWithScores(key, range, args).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zrangebyscore(K key, ScoreRange range) {
        this.tx.enqueue(this.reactive::decodeAsListOfValues);
        return this.reactive._zrangebyscore(key, range).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zrangebyscoreWithScores(K key, ScoreRange range) {
        this.tx.enqueue(this.reactive::decodeAsListOfScoredValues);
        return this.reactive._zrangebyscoreWithScores(key, range).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zrangestore(K dst, K src, long min, long max, ZRangeArgs args) {
        this.tx.enqueue(Response::toLong);
        return this.reactive._zrangestore(dst, src, min, max, args).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zrangestore(K dst, K src, long min, long max) {
        this.tx.enqueue(Response::toLong);
        return this.reactive._zrangestore(dst, src, min, max).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zrangestorebylex(K dst, K src, Range range, ZRangeArgs args) {
        this.tx.enqueue(Response::toLong);
        return this.reactive._zrangestorebylex(dst, src, range, args).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zrangestorebylex(K dst, K src, Range range) {
        this.tx.enqueue(Response::toLong);
        return this.reactive._zrangestorebylex(dst, src, range).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zrangestorebyscore(K dst, K src, ScoreRange range, ZRangeArgs args) {
        this.tx.enqueue(Response::toLong);
        return this.reactive._zrangestorebyscore(dst, src, range, args).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zrangestorebyscore(K dst, K src, ScoreRange range) {
        this.tx.enqueue(Response::toLong);
        return this.reactive._zrangestorebyscore(dst, src, range).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zrank(K key, V member) {
        this.tx.enqueue(this.reactive::decodeAsLong);
        return this.reactive._zrank(key, member).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zrem(K key, V... members) {
        this.tx.enqueue(Response::toInteger);
        return this.reactive._zrem(key, members).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zremrangebylex(K key, Range range) {
        this.tx.enqueue(Response::toLong);
        return this.reactive._zremrangebylex(key, range).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zremrangebyrank(K key, long start, long stop) {
        this.tx.enqueue(Response::toLong);
        return this.reactive._zremrangebyrank(key, start, stop).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zremrangebyscore(K key, ScoreRange range) {
        this.tx.enqueue(Response::toLong);
        return this.reactive._zremrangebyscore(key, range).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zrevrank(K key, V member) {
        this.tx.enqueue(this.reactive::decodeAsLong);
        return this.reactive._zrevrank(key, member).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zscore(K key, V member) {
        this.tx.enqueue(this.reactive::decodeAsDouble);
        return this.reactive._zscore(key, member).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zunion(ZAggregateArgs args, K... keys) {
        this.tx.enqueue(this.reactive::decodeAsListOfValues);
        return this.reactive._zunion(args, keys).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zunion(K... keys) {
        this.tx.enqueue(this.reactive::decodeAsListOfValues);
        return this.reactive._zunion(keys).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zunionWithScores(ZAggregateArgs args, K... keys) {
        this.tx.enqueue(this.reactive::decodeAsListOfScoredValues);
        return this.reactive._zunionWithScores(args, keys).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zunionWithScores(K... keys) {
        this.tx.enqueue(this.reactive::decodeAsListOfScoredValues);
        return this.reactive._zunionWithScores(keys).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zunionstore(K destination, ZAggregateArgs args, K... keys) {
        this.tx.enqueue(Response::toLong);
        return this.reactive._zunionstore(destination, args, keys).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni zunionstore(K destination, K... keys) {
        this.tx.enqueue(Response::toLong);
        return this.reactive._zunionstore(destination, keys).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy