@Override public long count() { CommandBatchService executorService = new CommandBatchService(commandExecutor.getConnectionManager()); 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))); }
@Override public long count() { CommandBatchService executorService = new CommandBatchService(commandExecutor.getConnectionManager()); 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))); }
@Override public long count() { CommandBatchService executorService = new CommandBatchService(commandExecutor.getConnectionManager()); 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))); }