Merge branch 'master' into 3.0.0

pull/1821/head
Nikita Koksharov 6 years ago
commit 8722aa3a85

@ -25,10 +25,6 @@ import java.util.Map;
*/ */
public interface ClusterNode extends Node { public interface ClusterNode extends Node {
// Use {@link #clusterInfo()}
@Deprecated
Map<String, String> info();
/** /**
* Execute CLUSTER INFO operation. * Execute CLUSTER INFO operation.
* *

@ -27,6 +27,11 @@ import org.redisson.client.codec.StringCodec;
import org.redisson.client.protocol.RedisCommands; import org.redisson.client.protocol.RedisCommands;
import org.redisson.client.protocol.Time; import org.redisson.client.protocol.Time;
import org.redisson.command.CommandSyncService; import org.redisson.command.CommandSyncService;
import org.redisson.misc.RPromise;
import org.redisson.misc.RedissonPromise;
import io.netty.util.concurrent.Future;
import io.netty.util.concurrent.FutureListener;
/** /**
* *
@ -61,7 +66,20 @@ public class RedisClientEntry implements ClusterNode {
} }
public RFuture<Boolean> pingAsync() { public RFuture<Boolean> pingAsync() {
return commandExecutor.readAsync(client, null, RedisCommands.PING_BOOL); 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 @Override
@ -149,9 +167,4 @@ public class RedisClientEntry implements ClusterNode {
throw new IllegalStateException(); throw new IllegalStateException();
} }
@Override
public Map<String, String> info() {
return clusterInfo();
}
} }

Loading…
Cancel
Save