[ 
https://issues.apache.org/jira/browse/HBASE-25324?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Guanghao Zhang resolved HBASE-25324.
------------------------------------
    Fix Version/s: 2.4.0
                   3.0.0-alpha-1
       Resolution: Fixed

Pushed to branch-2 and master. Thanks [~yuqi] for contributing.

> Remove unnecessary array to list conversion in SplitLogManager
> --------------------------------------------------------------
>
>                 Key: HBASE-25324
>                 URL: https://issues.apache.org/jira/browse/HBASE-25324
>             Project: HBase
>          Issue Type: Improvement
>            Reporter: yuqi
>            Assignee: yuqi
>            Priority: Minor
>             Fix For: 3.0.0-alpha-1, 2.4.0
>
>
> {code:java}
>   public static List<FileStatus> getFileList(final Configuration conf, final 
> List<Path> logDirs,
>       final PathFilter filter)
>       throws IOException {
>     List<FileStatus> fileStatus = new ArrayList<>();
>     ....
>     FileStatus[] a = new FileStatus[fileStatus.size()];
>     //list to array
>     return fileStatus.toArray(a);
>   }
>   public List<FileStatus> getWALsToSplit(ServerName serverName, boolean 
> splitMeta)
>       throws IOException {
>     List<Path> logDirs = 
> master.getMasterWalManager().getLogDirs(Collections.singleton(serverName));
>     FileStatus[] fileStatuses =
>         SplitLogManager.getFileList(this.conf, logDirs, splitMeta ? 
> META_FILTER : NON_META_FILTER);
>     LOG.info("{} WAL count={}, meta={}", serverName, fileStatuses.length, 
> splitMeta);
>     //array convert to list which is just contrary to the logic of  
> getFileList
>     return Lists.newArrayList(fileStatuses);
>   
> {code}
> After judge the logic, there seems no need to make such a conversion.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to