[ https://issues.apache.org/jira/browse/HBASE-20732?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16524434#comment-16524434 ]
Chia-Ping Tsai commented on HBASE-20732: ---------------------------------------- {code:java} + @Nullable private List<FileStatus> getFilteredStatus(Predicate<FileStatus> function) throws IOException { return FSUtils.listStatusWithStatusFilter(fs, dir, status -> function.test(status)); }{code} Is it better to use empty list to replace the null value? Returning a empty list can simplify the following code. {code:java} + subDirs = Optional.ofNullable(getFilteredStatus(FileStatus::isDirectory)) + .orElseGet(Collections::emptyList); + files = Optional.ofNullable(getFilteredStatus(FileStatus::isFile)) + .orElseGet(Collections::emptyList);{code} > Shutdown scan pool when master is stopped. > ------------------------------------------ > > Key: HBASE-20732 > URL: https://issues.apache.org/jira/browse/HBASE-20732 > Project: HBase > Issue Type: Bug > Reporter: Reid Chan > Assignee: Reid Chan > Priority: Minor > Fix For: 3.0.0, 2.1.0, 1.5.0, 1.4.6, 2.0.2 > > Attachments: HBASE-20732.master.001.patch, > HBASE-20732.master.002.patch, HBASE-20732.master.003.patch, > HBASE-20732.master.004.patch, HBASE-20732.master.005.patch, > HBASE-20732.master.006.patch, HBASE-20732.master.007.patch > > > If master is stopped, {{DirScanPool}} is kept open. This is found by > [~chia7712] when reviewing HBASE-20352. -- This message was sent by Atlassian JIRA (v7.6.3#76005)