refactoring

pull/2691/head
Nikita Koksharov 5 years ago
parent efba350f8b
commit bad582f96e

@ -237,11 +237,11 @@ public class RedissonConnection extends AbstractRedisConnection {
final AtomicReference<Throwable> failed = new AtomicReference<Throwable>();
final AtomicLong count = new AtomicLong();
final AtomicLong executed = new AtomicLong(range2key.size());
BiConsumer<List<?>, Throwable> listener = new BiConsumer<List<?>, Throwable>() {
BiConsumer<BatchResult<?>, Throwable> listener = new BiConsumer<BatchResult<?>, Throwable>() {
@Override
public void accept(List<?> r, Throwable u) {
public void accept(BatchResult<?> r, Throwable u) {
if (u == null) {
List<Long> result = (List<Long>) r;
List<Long> result = (List<Long>) r.getResponses();
for (Long res : result) {
if (res != null) {
count.addAndGet(res);
@ -261,7 +261,7 @@ public class RedissonConnection extends AbstractRedisConnection {
es.writeAsync(entry.getKey(), null, command, key);
}
RFuture<List<?>> future = es.executeAsync();
RFuture<BatchResult<?>> future = es.executeAsync();
future.onComplete(listener);
}

@ -273,11 +273,11 @@ public class RedissonConnection extends AbstractRedisConnection {
final AtomicReference<Throwable> failed = new AtomicReference<Throwable>();
final AtomicLong count = new AtomicLong();
final AtomicLong executed = new AtomicLong(range2key.size());
BiConsumer<List<?>, Throwable> listener = new BiConsumer<List<?>, Throwable>() {
BiConsumer<BatchResult<?>, Throwable> listener = new BiConsumer<BatchResult<?>, Throwable>() {
@Override
public void accept(List<?> r, Throwable u) {
public void accept(BatchResult<?> r, Throwable u) {
if (u == null) {
List<Long> result = (List<Long>) r;
List<Long> result = (List<Long>) r.getResponses();
for (Long res : result) {
if (res != null) {
count.addAndGet(res);
@ -297,7 +297,7 @@ public class RedissonConnection extends AbstractRedisConnection {
es.writeAsync(entry.getKey(), null, command, key);
}
RFuture<List<?>> future = es.executeAsync();
RFuture<BatchResult<?>> future = es.executeAsync();
future.onComplete(listener);
}

@ -240,11 +240,11 @@ public class RedissonConnection extends AbstractRedisConnection {
final AtomicReference<Throwable> failed = new AtomicReference<Throwable>();
final AtomicLong count = new AtomicLong();
final AtomicLong executed = new AtomicLong(range2key.size());
BiConsumer<List<?>, Throwable> listener = new BiConsumer<List<?>, Throwable>() {
BiConsumer<BatchResult<?>, Throwable> listener = new BiConsumer<BatchResult<?>, Throwable>() {
@Override
public void accept(List<?> r, Throwable u) {
public void accept(BatchResult<?> r, Throwable u) {
if (u == null) {
List<Long> result = (List<Long>) r;
List<Long> result = (List<Long>) r.getResponses();
for (Long res : result) {
if (res != null) {
count.addAndGet(res);
@ -264,7 +264,7 @@ public class RedissonConnection extends AbstractRedisConnection {
es.writeAsync(entry.getKey(), null, command, key);
}
RFuture<List<?>> future = es.executeAsync();
RFuture<BatchResult<?>> future = es.executeAsync();
future.onComplete(listener);
}

@ -270,11 +270,11 @@ public class RedissonConnection extends AbstractRedisConnection {
final AtomicReference<Throwable> failed = new AtomicReference<Throwable>();
final AtomicLong count = new AtomicLong();
final AtomicLong executed = new AtomicLong(range2key.size());
BiConsumer<List<?>, Throwable> listener = new BiConsumer<List<?>, Throwable>() {
BiConsumer<BatchResult<?>, Throwable> listener = new BiConsumer<BatchResult<?>, Throwable>() {
@Override
public void accept(List<?> r, Throwable u) {
public void accept(BatchResult<?> r, Throwable u) {
if (u == null) {
List<Long> result = (List<Long>) r;
List<Long> result = (List<Long>) r.getResponses();
for (Long res : result) {
if (res != null) {
count.addAndGet(res);
@ -294,7 +294,7 @@ public class RedissonConnection extends AbstractRedisConnection {
es.writeAsync(entry.getKey(), null, command, key);
}
RFuture<List<?>> future = es.executeAsync();
RFuture<BatchResult<?>> future = es.executeAsync();
future.onComplete(listener);
}

@ -262,11 +262,11 @@ public class RedissonConnection extends AbstractRedisConnection {
final AtomicReference<Throwable> failed = new AtomicReference<Throwable>();
final AtomicLong count = new AtomicLong();
final AtomicLong executed = new AtomicLong(range2key.size());
BiConsumer<List<?>, Throwable> listener = new BiConsumer<List<?>, Throwable>() {
BiConsumer<BatchResult<?>, Throwable> listener = new BiConsumer<BatchResult<?>, Throwable>() {
@Override
public void accept(List<?> r, Throwable u) {
public void accept(BatchResult<?> r, Throwable u) {
if (u == null) {
List<Long> result = (List<Long>) r;
List<Long> result = (List<Long>) r.getResponses();
for (Long res : result) {
if (res != null) {
count.addAndGet(res);
@ -286,7 +286,7 @@ public class RedissonConnection extends AbstractRedisConnection {
es.writeAsync(entry.getKey(), null, command, key);
}
RFuture<List<?>> future = es.executeAsync();
RFuture<BatchResult<?>> future = es.executeAsync();
future.onComplete(listener);
}

Loading…
Cancel
Save