use of org.redisson.client.protocol.decoder.ObjectMapReplayDecoder in project redisson by redisson.
the class RedissonBloomFilter method count.
@Override
public long count() {
CommandBatchService executorService = new CommandBatchService(commandExecutor);
RFuture<Map<String, String>> configFuture = executorService.readAsync(configName, StringCodec.INSTANCE, new RedisCommand<Map<Object, Object>>("HGETALL", new ObjectMapReplayDecoder()), configName);
RBitSetAsync bs = createBitSet(executorService);
RFuture<Long> cardinalityFuture = bs.cardinalityAsync();
executorService.execute();
readConfig(configFuture.getNow());
return Math.round(-size / ((double) hashIterations) * Math.log(1 - cardinalityFuture.getNow() / ((double) size)));
}
Aggregations