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

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

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

import java.lang.reflect.Type;

import io.quarkus.redis.datasource.ReactiveRedisDataSource;
import io.quarkus.redis.datasource.hyperloglog.ReactiveHyperLogLogCommands;
import io.smallrye.mutiny.Uni;
import io.vertx.mutiny.redis.client.Response;

public class ReactiveHyperLogLogCommandsImpl extends AbstractHyperLogLogCommands
        implements ReactiveHyperLogLogCommands {

    private final ReactiveRedisDataSource reactive;

    public ReactiveHyperLogLogCommandsImpl(ReactiveRedisDataSourceImpl redis, Type k, Type v) {
        super(redis, k, v);
        this.reactive = redis;
    }

    @Override
    public ReactiveRedisDataSource getDataSource() {
        return reactive;
    }

    @SafeVarargs
    @Override
    public final Uni pfadd(K key, V... values) {
        return super._pfadd(key, values)
                .map(Response::toBoolean);
    }

    @SafeVarargs
    @Override
    public final Uni pfmerge(K destination, K... sources) {
        return super._pfmerge(destination, sources)
                .replaceWithVoid();
    }

    @SafeVarargs
    @Override
    public final Uni pfcount(K... keys) {
        return super._pfcount(keys)
                .map(Response::toLong);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy