[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-2932?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16240964#comment-16240964
 ] 

ASF GitHub Bot commented on ZOOKEEPER-2932:
-------------------------------------------

Github user afine commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/414#discussion_r149206744
  
    --- Diff: 
src/java/main/org/apache/zookeeper/server/persistence/FileTxnLog.java ---
    @@ -255,30 +255,19 @@ private void padFile(FileOutputStream out) throws 
IOException {
          */
         public static File[] getLogFiles(File[] logDirList,long snapshotZxid) {
             List<File> files = Util.sortDataDir(logDirList, "log", true);
    --- End diff --
    
    couldn't we make the last param false and then we can use a simpler `for 
(File f : files)` loop?


> Performance enhancement about purging task
> ------------------------------------------
>
>                 Key: ZOOKEEPER-2932
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2932
>             Project: ZooKeeper
>          Issue Type: Improvement
>          Components: server
>            Reporter: OuYang Liang
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> The method FileTxnLog.getLogFiles is used to find out the target log files to 
> be retained base on the given zxid when purging task is running. The current 
> implementation of this method is trivial to understand, and iterate the log 
> files twice to achieve its purchase. It could be improved from both 
> performance and readability.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to