Merge branch 'master' into 3.0.0

pull/1821/head
Nikita Koksharov 6 years ago
commit 6b0d6eb240

@ -15,15 +15,10 @@
*/
package org.redisson;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectOutput;
import java.io.ObjectOutputStream;
import java.lang.invoke.SerializedLambda;
import java.lang.ref.ReferenceQueue;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Arrays;
@ -415,29 +410,6 @@ public class RedissonExecutorService implements RScheduledExecutorService {
InputStream classStream = c.getClassLoader().getResourceAsStream(classAsPath);
byte[] lambdaBody = null;
if (classStream == null) {
ByteArrayOutputStream os = new ByteArrayOutputStream();
try {
ObjectOutput oo = new ObjectOutputStream(os);
oo.writeObject(task);
} catch (Exception e) {
throw new IllegalArgumentException("Unable to serialize lambda", e);
}
lambdaBody = os.toByteArray();
SerializedLambda lambda;
try {
Method writeReplace = task.getClass().getDeclaredMethod("writeReplace");
writeReplace.setAccessible(true);
lambda = (SerializedLambda) writeReplace.invoke(task);
} catch (Exception ex) {
throw new IllegalArgumentException("Lambda should implement java.io.Serializable interface", ex);
}
className = lambda.getCapturingClass().replace('/', '.');
classStream = task.getClass().getClassLoader().getResourceAsStream(lambda.getCapturingClass() + ".class");
}
byte[] classBody;
try {
DataInputStream s = new DataInputStream(classStream);

@ -66,7 +66,7 @@ public class RedisClientEntry implements ClusterNode {
}
public RFuture<Boolean> pingAsync() {
RPromise<Boolean> result = new RedissonPromise<Boolean>();
final RPromise<Boolean> result = new RedissonPromise<Boolean>();
RFuture<Boolean> f = commandExecutor.readAsync(client, null, RedisCommands.PING_BOOL);
f.addListener(new FutureListener<Boolean>() {
@Override

@ -817,20 +817,6 @@ public class RedissonTest {
assertThat(c.toYAML()).isEqualTo(t);
}
// @Test
public void testCluster() {
NodesGroup<ClusterNode> nodes = redisson.getClusterNodesGroup();
Assert.assertEquals(2, nodes.getNodes().size());
nodes.getNodes().stream().forEach((node) -> {
Map<String, String> params = node.info();
Assert.assertNotNull(params);
Assert.assertTrue(node.ping());
});
Assert.assertTrue(nodes.pingAll());
}
@Test
public void testNodesInCluster() throws Exception {
RedisRunner master1 = new RedisRunner().randomPort().randomDir().nosave();

Loading…
Cancel
Save