[
https://issues.apache.org/jira/browse/HBASE-29709?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
guluo resolved HBASE-29709.
---------------------------
Fix Version/s: 2.7.0
3.0.0-beta-2
2.6.5
2.5.14
Assignee: guluo
Resolution: Fixed
> NPE may occur when compacting table via RawAsyncHBaseAdmin
> ----------------------------------------------------------
>
> Key: HBASE-29709
> URL: https://issues.apache.org/jira/browse/HBASE-29709
> Project: HBase
> Issue Type: Bug
> Components: asyncclient
> Reporter: guluo
> Assignee: guluo
> Priority: Minor
> Labels: pull-request-available
> Fix For: 2.7.0, 3.0.0-beta-2, 2.6.5, 2.5.14
>
>
> NPE may occur when calling RawAsyncHBaseAdmin.compact(), as follows:
>
> {code:java}
> // RawAsyncHBaseAdmin.compact()
> if (locations == null || locations.isEmpty()) {
> future.completeExceptionally(new TableNotFoundException(tableName));
> }
> CompletableFuture<?>[] compactFutures =
> locations.stream().filter(l -> l.getRegion() != null)
> .filter(l -> !l.getRegion().isOffline()).filter(l ->
> l.getServerName() != null)
> .map(l -> compact(l.getServerName(), l.getRegion(), major,
> columnFamily))
> .toArray(CompletableFuture<?>[]::new); {code}
> The issue is that after completing the future exceptionally when locations is
> null or empty, there is no return statement.
> This allows the execution to continue, which may lead to NPE issue when
> locations.stream() is called.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)