refactoring

pull/3215/merge
Nikita Koksharov 3 years ago
parent 732b28fade
commit cd240943ca

@ -226,7 +226,7 @@ public abstract class RedissonBaseLock extends RedissonExpirable implements RLoc
new IllegalStateException("Only " + res.getSyncedSlaves() + " of " + availableSlaves + " slaves were synced"));
}
return result.getNow();
return commandExecutor.getNow(result.toCompletableFuture());
});
return new CompletableFutureWrapper<>(f);
}

@ -207,9 +207,9 @@ public class RedissonBloomFilter<T> extends RedissonExpirable implements RBloomF
RFuture<Long> cardinalityFuture = bs.cardinalityAsync();
executorService.execute();
readConfig(configFuture.getNow());
readConfig(commandExecutor.getNow(configFuture.toCompletableFuture()));
return Math.round(-size / ((double) hashIterations) * Math.log(1 - cardinalityFuture.getNow() / ((double) size)));
return Math.round(-size / ((double) hashIterations) * Math.log(1 - commandExecutor.getNow(cardinalityFuture.toCompletableFuture()) / ((double) size)));
}
@Override

@ -1450,7 +1450,7 @@ public class RedissonMap<K, V> extends RedissonExpirable implements RMap<K, V> {
return mapWriterFuture(future, new MapWriterTask.Add() {
@Override
public Map<K, V> getMap() {
return Collections.singletonMap(key, future.getNow());
return Collections.singletonMap(key, commandExecutor.getNow(future.toCompletableFuture()));
}
});
}

@ -148,7 +148,7 @@ public class LoadBalancerManager {
return;
}
log.info("Unfreezed entry: {}", entry);
log.debug("Unfreezed entry: {}", entry);
entry.setFreezeReason(null);
});
return true;

@ -128,7 +128,7 @@ public class LiveObjectInterceptor {
RFuture<Long> deleteFuture = service.delete(idd, me.getClass().getSuperclass(), namingScheme, ce);
ce.execute();
return deleteFuture.getNow() > 0;
return commandExecutor.get(deleteFuture.toCompletableFuture()) > 0;
}
try {

@ -97,7 +97,7 @@ public class RedissonExecutorServiceTest extends BaseTest {
new IncrementCallableTask("myCounter"), new IncrementCallableTask("myCounter"));
future.get(5, TimeUnit.SECONDS);
future.getTaskFutures().stream().forEach(x -> assertThat(x.getNow()).isEqualTo("1234"));
future.getTaskFutures().stream().forEach(x -> assertThat(x.toCompletableFuture().getNow(null)).isEqualTo("1234"));
redisson.getKeys().delete("myCounter");
assertThat(redisson.getKeys().count()).isZero();

Loading…
Cancel
Save