From 08060b32b10dfa1f7c51a9dab59b54a5f8e255ce Mon Sep 17 00:00:00 2001 From: zhangduo Date: Sat, 6 Apr 2019 22:17:46 +0800 Subject: [PATCH] HBASE-22179 Fix RawAsyncHBaseAdmin.getCompactionState --- .../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 4d544593a84..8f29f808250 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 @@ -34,6 +34,7 @@ import java.util.Map; import java.util.Optional; import java.util.Set; import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicReference; import java.util.function.BiConsumer; @@ -2856,7 +2857,7 @@ class RawAsyncHBaseAdmin implements AsyncAdmin { future.completeExceptionally(err); return; } - List regionStates = new ArrayList<>(); + ConcurrentLinkedQueue regionStates = new ConcurrentLinkedQueue<>(); List> futures = new ArrayList<>(); locations.stream().filter(loc -> loc.getServerName() != null) .filter(loc -> loc.getRegion() != null).filter(loc -> !loc.getRegion().isOffline()) @@ -2898,9 +2899,9 @@ class RawAsyncHBaseAdmin implements AsyncAdmin { case NONE: default: } - if (!future.isDone()) { - future.complete(state); - } + } + if (!future.isDone()) { + future.complete(state); } } });