@Override public RFuture<Time> timeAsync() { return commandExecutor.readAsync(client, LongCodec.INSTANCE, RedisCommands.TIME); }
@Override public RFuture<Map<String, String>> clusterInfoAsync() { return commandExecutor.readAsync(client, StringCodec.INSTANCE, RedisCommands.CLUSTER_INFO); }
@Override public RFuture<Time> timeAsync() { return commandExecutor.readAsync(client, LongCodec.INSTANCE, RedisCommands.TIME); }
@Override public RFuture<Map<String, String>> clusterInfoAsync() { return commandExecutor.readAsync(client, StringCodec.INSTANCE, RedisCommands.CLUSTER_INFO); }
@Override public RFuture<Map<String, String>> infoAsync(InfoSection section) { if (section == InfoSection.ALL) { return commandExecutor.readAsync(client, StringCodec.INSTANCE, RedisCommands.INFO_ALL); } else if (section == InfoSection.DEFAULT) { return commandExecutor.readAsync(client, StringCodec.INSTANCE, RedisCommands.INFO_DEFAULT); } else if (section == InfoSection.SERVER) { return commandExecutor.readAsync(client, StringCodec.INSTANCE, RedisCommands.INFO_SERVER); } else if (section == InfoSection.CLIENTS) { return commandExecutor.readAsync(client, StringCodec.INSTANCE, RedisCommands.INFO_CLIENTS); } else if (section == InfoSection.MEMORY) { return commandExecutor.readAsync(client, StringCodec.INSTANCE, RedisCommands.INFO_MEMORY); } else if (section == InfoSection.PERSISTENCE) { return commandExecutor.readAsync(client, StringCodec.INSTANCE, RedisCommands.INFO_PERSISTENCE); } else if (section == InfoSection.STATS) { return commandExecutor.readAsync(client, StringCodec.INSTANCE, RedisCommands.INFO_STATS); } else if (section == InfoSection.REPLICATION) { return commandExecutor.readAsync(client, StringCodec.INSTANCE, RedisCommands.INFO_REPLICATION); } else if (section == InfoSection.CPU) { return commandExecutor.readAsync(client, StringCodec.INSTANCE, RedisCommands.INFO_CPU); } else if (section == InfoSection.COMMANDSTATS) { return commandExecutor.readAsync(client, StringCodec.INSTANCE, RedisCommands.INFO_COMMANDSTATS); } else if (section == InfoSection.CLUSTER) { return commandExecutor.readAsync(client, StringCodec.INSTANCE, RedisCommands.INFO_CLUSTER); } else if (section == InfoSection.KEYSPACE) { return commandExecutor.readAsync(client, StringCodec.INSTANCE, RedisCommands.INFO_KEYSPACE); } throw new IllegalStateException(); }
@Override public RFuture<Map<String, String>> infoAsync(InfoSection section) { if (section == InfoSection.ALL) { return commandExecutor.readAsync(client, StringCodec.INSTANCE, RedisCommands.INFO_ALL); } else if (section == InfoSection.DEFAULT) { return commandExecutor.readAsync(client, StringCodec.INSTANCE, RedisCommands.INFO_DEFAULT); } else if (section == InfoSection.SERVER) { return commandExecutor.readAsync(client, StringCodec.INSTANCE, RedisCommands.INFO_SERVER); } else if (section == InfoSection.CLIENTS) { return commandExecutor.readAsync(client, StringCodec.INSTANCE, RedisCommands.INFO_CLIENTS); } else if (section == InfoSection.MEMORY) { return commandExecutor.readAsync(client, StringCodec.INSTANCE, RedisCommands.INFO_MEMORY); } else if (section == InfoSection.PERSISTENCE) { return commandExecutor.readAsync(client, StringCodec.INSTANCE, RedisCommands.INFO_PERSISTENCE); } else if (section == InfoSection.STATS) { return commandExecutor.readAsync(client, StringCodec.INSTANCE, RedisCommands.INFO_STATS); } else if (section == InfoSection.REPLICATION) { return commandExecutor.readAsync(client, StringCodec.INSTANCE, RedisCommands.INFO_REPLICATION); } else if (section == InfoSection.CPU) { return commandExecutor.readAsync(client, StringCodec.INSTANCE, RedisCommands.INFO_CPU); } else if (section == InfoSection.COMMANDSTATS) { return commandExecutor.readAsync(client, StringCodec.INSTANCE, RedisCommands.INFO_COMMANDSTATS); } else if (section == InfoSection.CLUSTER) { return commandExecutor.readAsync(client, StringCodec.INSTANCE, RedisCommands.INFO_CLUSTER); } else if (section == InfoSection.KEYSPACE) { return commandExecutor.readAsync(client, StringCodec.INSTANCE, RedisCommands.INFO_KEYSPACE); } throw new IllegalStateException(); }
@Override public <T, R> R read(String key, Codec codec, RedisCommand<T> command, Object ... params) { RFuture<R> res = readAsync(key, codec, command, params); return get(res); }
@Override public <T, R> R read(String key, Codec codec, RedisCommand<T> command, Object ... params) { RFuture<R> res = readAsync(key, codec, command, params); return get(res); }
public RFuture<Boolean> pingAsync() { final RPromise<Boolean> result = new RedissonPromise<Boolean>(); RFuture<Boolean> f = commandExecutor.readAsync(client, null, RedisCommands.PING_BOOL); f.addListener(new FutureListener<Boolean>() { @Override public void operationComplete(Future<Boolean> future) throws Exception { if (!future.isSuccess()) { result.trySuccess(false); return; } result.trySuccess(future.getNow()); } }); return result; }
public RFuture<Boolean> pingAsync() { final RPromise<Boolean> result = new RedissonPromise<Boolean>(); RFuture<Boolean> f = commandExecutor.readAsync(client, null, RedisCommands.PING_BOOL); f.addListener(new FutureListener<Boolean>() { @Override public void operationComplete(Future<Boolean> future) throws Exception { if (!future.isSuccess()) { result.trySuccess(false); return; } result.trySuccess(future.getNow()); } }); return result; }
@Override public RFuture<Map<String, String>> clusterInfoAsync() { return commandExecutor.readAsync(client, StringCodec.INSTANCE, RedisCommands.CLUSTER_INFO); }
@Override public RFuture<Time> timeAsync() { return commandExecutor.readAsync(client, LongCodec.INSTANCE, RedisCommands.TIME); }
@Override public RFuture<Map<String, String>> infoAsync(InfoSection section) { if (section == InfoSection.ALL) { return commandExecutor.readAsync(client, StringCodec.INSTANCE, RedisCommands.INFO_ALL); } else if (section == InfoSection.DEFAULT) { return commandExecutor.readAsync(client, StringCodec.INSTANCE, RedisCommands.INFO_DEFAULT); } else if (section == InfoSection.SERVER) { return commandExecutor.readAsync(client, StringCodec.INSTANCE, RedisCommands.INFO_SERVER); } else if (section == InfoSection.CLIENTS) { return commandExecutor.readAsync(client, StringCodec.INSTANCE, RedisCommands.INFO_CLIENTS); } else if (section == InfoSection.MEMORY) { return commandExecutor.readAsync(client, StringCodec.INSTANCE, RedisCommands.INFO_MEMORY); } else if (section == InfoSection.PERSISTENCE) { return commandExecutor.readAsync(client, StringCodec.INSTANCE, RedisCommands.INFO_PERSISTENCE); } else if (section == InfoSection.STATS) { return commandExecutor.readAsync(client, StringCodec.INSTANCE, RedisCommands.INFO_STATS); } else if (section == InfoSection.REPLICATION) { return commandExecutor.readAsync(client, StringCodec.INSTANCE, RedisCommands.INFO_REPLICATION); } else if (section == InfoSection.CPU) { return commandExecutor.readAsync(client, StringCodec.INSTANCE, RedisCommands.INFO_CPU); } else if (section == InfoSection.COMMANDSTATS) { return commandExecutor.readAsync(client, StringCodec.INSTANCE, RedisCommands.INFO_COMMANDSTATS); } else if (section == InfoSection.CLUSTER) { return commandExecutor.readAsync(client, StringCodec.INSTANCE, RedisCommands.INFO_CLUSTER); } else if (section == InfoSection.KEYSPACE) { return commandExecutor.readAsync(client, StringCodec.INSTANCE, RedisCommands.INFO_KEYSPACE); } throw new IllegalStateException(); }
@Override public <T, R> R read(String key, Codec codec, RedisCommand<T> command, Object ... params) { RFuture<R> res = readAsync(key, codec, command, params); return get(res); }
public RFuture<Boolean> pingAsync() { final RPromise<Boolean> result = new RedissonPromise<Boolean>(); RFuture<Boolean> f = commandExecutor.readAsync(client, null, RedisCommands.PING_BOOL); f.addListener(new FutureListener<Boolean>() { @Override public void operationComplete(Future<Boolean> future) throws Exception { if (!future.isSuccess()) { result.trySuccess(false); return; } result.trySuccess(future.getNow()); } }); return result; }