PakhomovAlexander commented on code in PR #1929:
URL: https://github.com/apache/ignite-3/pull/1929#discussion_r1176140252
##########
modules/runner/src/main/java/org/apache/ignite/internal/configuration/storage/LocalFileConfigurationStorage.java:
##########
@@ -147,49 +139,40 @@ private Config readHoconFromFile() {
@Override
public CompletableFuture<Map<String, ? extends Serializable>>
readAllLatest(String prefix) {
- return async(() -> {
- lock.readLock().lock();
- try {
- return latest.entrySet()
- .stream()
- .filter(entry -> entry.getKey().startsWith(prefix))
- .collect(toMap(Entry::getKey, Entry::getValue));
- } finally {
- lock.readLock().unlock();
- }
- });
+ lock.readLock().lock();
+ try {
+ return CompletableFuture.completedFuture(
+ latest.entrySet()
+ .stream()
+ .filter(entry -> entry.getKey().startsWith(prefix))
+ .collect(toMap(Entry::getKey, Entry::getValue))
+ );
+ } finally {
+ lock.readLock().unlock();
+ }
}
@Override
public CompletableFuture<Serializable> readLatest(String key) {
- return async(() -> {
- lock.readLock().lock();
- try {
- return latest.get(key);
- } finally {
- lock.readLock().unlock();
- }
- });
+ return CompletableFuture.completedFuture(latest.get(key));
Review Comment:
Thank you for the clarification, I misunderstood the `latest` meaning. My
fault.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]