@Override public ClusterInfo clusterGetClusterInfo() { RFuture<Map<String, String>> f = executorService.readAsync((String)null, StringCodec.INSTANCE, RedisCommands.CLUSTER_INFO); syncFuture(f); Properties props = new Properties(); for (Entry<String, String> entry : f.getNow().entrySet()) { props.setProperty(entry.getKey(), entry.getValue()); } return new ClusterInfo(props); }
@Override public ClusterInfo clusterGetClusterInfo() { RFuture<Map<String, String>> f = executorService.readAsync((String)null, StringCodec.INSTANCE, RedisCommands.CLUSTER_INFO); syncFuture(f); Properties props = new Properties(); for (Entry<String, String> entry : f.getNow().entrySet()) { props.setProperty(entry.getKey(), entry.getValue()); } return new ClusterInfo(props); }
@Override public ClusterInfo clusterGetClusterInfo() { RFuture<Map<String, String>> f = executorService.readAsync((String)null, StringCodec.INSTANCE, RedisCommands.CLUSTER_INFO); syncFuture(f); Properties props = new Properties(); for (Entry<String, String> entry : f.getNow().entrySet()) { props.setProperty(entry.getKey(), entry.getValue()); } return new ClusterInfo(props); }
private <T> void syncExecute(RemotePromise<T> promise) { RFuture<Boolean> addFuture = promise.getAddFuture(); addFuture.syncUninterruptibly(); Boolean res = addFuture.getNow(); if (!res) { throw new RejectedExecutionException("Task rejected. ExecutorService is in shutdown state"); } }
private <T> void syncExecute(RemotePromise<T> promise) { RFuture<Boolean> addFuture = promise.getAddFuture(); addFuture.syncUninterruptibly(); Boolean res = addFuture.getNow(); if (!res) { throw new RejectedExecutionException("Task rejected. ExecutorService is in shutdown state"); } }
@Override public void execute() { options.getWriter().write(key, future.getNow()); } };
@Override public void execute() { options.getWriter().write(key, future.getNow()); } };
public RedisConnection connect() { try { return connectAsync().syncUninterruptibly().getNow(); } catch (Exception e) { throw new RedisConnectionException("Unable to connect to: " + uri, e); } }
public RedisPubSubConnection connectPubSub() { try { return connectPubSubAsync().syncUninterruptibly().getNow(); } catch (Exception e) { throw new RedisConnectionException("Unable to connect to: " + uri, e); } }
public RedisConnection connect() { try { return connectAsync().syncUninterruptibly().getNow(); } catch (Exception e) { throw new RedisConnectionException("Unable to connect to: " + uri, e); } }
public RedisPubSubConnection connectPubSub() { try { return connectPubSubAsync().syncUninterruptibly().getNow(); } catch (Exception e) { throw new RedisConnectionException("Unable to connect to: " + uri, e); } }
@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))); }
private void unsubscribe(RFuture<RedissonLockEntry> future) { semaphorePubSub.unsubscribe(future.getNow(), getName(), getChannelName(), commandExecutor.getConnectionManager().getSubscribeService()); }
private void unsubscribe(RFuture<RedissonCountDownLatchEntry> future) { PUBSUB.unsubscribe(future.getNow(), getEntryName(), getChannelName(), commandExecutor.getConnectionManager().getSubscribeService()); }
private void unsubscribe(RFuture<RedissonLockEntry> future) { semaphorePubSub.unsubscribe(future.getNow(), getName(), getChannelName(), commandExecutor.getConnectionManager().getSubscribeService()); }
protected void unsubscribe(RFuture<RedissonLockEntry> future, long threadId) { PUBSUB.unsubscribe(future.getNow(), getEntryName(), getChannelName(), commandExecutor.getConnectionManager().getSubscribeService()); }
private void unsubscribe(RFuture<RedissonCountDownLatchEntry> future) { PUBSUB.unsubscribe(future.getNow(), getEntryName(), getChannelName(), commandExecutor.getConnectionManager().getSubscribeService()); }
@Override protected void unsubscribe(RFuture<RedissonLockEntry> future, long threadId) { PUBSUB.unsubscribe(future.getNow(), getEntryName() + ":" + threadId, getChannelName() + ":" + getLockName(threadId), commandExecutor.getConnectionManager().getSubscribeService()); }
@Override protected void unsubscribe(RFuture<RedissonLockEntry> future, long threadId) { PUBSUB.unsubscribe(future.getNow(), getEntryName() + ":" + threadId, getChannelName() + ":" + getLockName(threadId), commandExecutor.getConnectionManager().getSubscribeService()); }