HBASE-22179 Fix RawAsyncHBaseAdmin.getCompactionState
This commit is contained in:
parent
0ca97d482a
commit
0247466210
|
@ -36,6 +36,7 @@ import java.util.Optional;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
import java.util.function.BiConsumer;
|
import java.util.function.BiConsumer;
|
||||||
|
@ -2937,7 +2938,7 @@ class RawAsyncHBaseAdmin implements AsyncAdmin {
|
||||||
future.completeExceptionally(err);
|
future.completeExceptionally(err);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
List<CompactionState> regionStates = new ArrayList<>();
|
ConcurrentLinkedQueue<CompactionState> regionStates = new ConcurrentLinkedQueue<>();
|
||||||
List<CompletableFuture<CompactionState>> futures = new ArrayList<>();
|
List<CompletableFuture<CompactionState>> futures = new ArrayList<>();
|
||||||
locations.stream().filter(loc -> loc.getServerName() != null)
|
locations.stream().filter(loc -> loc.getServerName() != null)
|
||||||
.filter(loc -> loc.getRegion() != null).filter(loc -> !loc.getRegion().isOffline())
|
.filter(loc -> loc.getRegion() != null).filter(loc -> !loc.getRegion().isOffline())
|
||||||
|
@ -2979,11 +2980,11 @@ class RawAsyncHBaseAdmin implements AsyncAdmin {
|
||||||
case NONE:
|
case NONE:
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (!future.isDone()) {
|
if (!future.isDone()) {
|
||||||
future.complete(state);
|
future.complete(state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue