This is an automated email from the ASF dual-hosted git repository.
zhangduo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/master by this push:
new 0247466 HBASE-22179 Fix RawAsyncHBaseAdmin.getCompactionState
0247466 is described below
commit 02474662105189f4ea7778cbcc11a9580c11d79e
Author: zhangduo <[email protected]>
AuthorDate: Sat Apr 6 22:17:46 2019 +0800
HBASE-22179 Fix RawAsyncHBaseAdmin.getCompactionState
---
.../java/org/apache/hadoop/hbase/client/RawAsyncHBaseAdmin.java | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RawAsyncHBaseAdmin.java
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RawAsyncHBaseAdmin.java
index 8cd4588..8537ffe 100644
---
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RawAsyncHBaseAdmin.java
+++
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RawAsyncHBaseAdmin.java
@@ -36,6 +36,7 @@ import java.util.Optional;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.BiConsumer;
@@ -2937,7 +2938,7 @@ class RawAsyncHBaseAdmin implements AsyncAdmin {
future.completeExceptionally(err);
return;
}
- List<CompactionState> regionStates = new ArrayList<>();
+ ConcurrentLinkedQueue<CompactionState> regionStates = new
ConcurrentLinkedQueue<>();
List<CompletableFuture<CompactionState>> futures = new ArrayList<>();
locations.stream().filter(loc -> loc.getServerName() != null)
.filter(loc -> loc.getRegion() != null).filter(loc ->
!loc.getRegion().isOffline())
@@ -2979,9 +2980,9 @@ class RawAsyncHBaseAdmin implements AsyncAdmin {
case NONE:
default:
}
- if (!future.isDone()) {
- future.complete(state);
- }
+ }
+ if (!future.isDone()) {
+ future.complete(state);
}
}
});