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

io.quarkus.redis.runtime.datasource.BlockingCountMinCommandsImpl 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.List;
import java.util.Map;

import io.quarkus.redis.datasource.RedisDataSource;
import io.quarkus.redis.datasource.countmin.CountMinCommands;
import io.quarkus.redis.datasource.countmin.ReactiveCountMinCommands;

public class BlockingCountMinCommandsImpl extends AbstractRedisCommandGroup implements CountMinCommands {

    private final ReactiveCountMinCommands reactive;

    public BlockingCountMinCommandsImpl(RedisDataSource ds, ReactiveCountMinCommands reactive, Duration timeout) {
        super(ds, timeout);
        this.reactive = reactive;
    }

    @Override
    public long cmsIncrBy(K key, V value, long increment) {
        return reactive.cmsIncrBy(key, value, increment).await().atMost(timeout);
    }

    @Override
    public Map cmsIncrBy(K key, Map couples) {
        return reactive.cmsIncrBy(key, couples).await().atMost(timeout);
    }

    @Override
    public void cmsInitByDim(K key, long width, long depth) {
        reactive.cmsInitByDim(key, width, depth).await().atMost(timeout);
    }

    @Override
    public void cmsInitByProb(K key, double error, double probability) {
        reactive.cmsInitByProb(key, error, probability).await().atMost(timeout);
    }

    @Override
    public long cmsQuery(K key, V item) {
        return reactive.cmsQuery(key, item).await().atMost(timeout);
    }

    @Override
    public List cmsQuery(K key, V... items) {
        return reactive.cmsQuery(key, items).await().atMost(timeout);
    }

    @Override
    public void cmsMerge(K dest, List src, List weight) {
        reactive.cmsMerge(dest, src, weight).await().atMost(timeout);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy