belugabehr commented on a change in pull request #912: HBASE-23380: General 
Cleanup of FSUtil
URL: https://github.com/apache/hbase/pull/912#discussion_r357277171
 
 

 ##########
 File path: hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java
 ##########
 @@ -965,11 +964,10 @@ public abstract void recoverFileLease(final FileSystem 
fs, final Path p,
 
   public static List<Path> getTableDirs(final FileSystem fs, final Path 
rootdir)
       throws IOException {
-    List<Path> tableDirs = new LinkedList<>();
+    List<Path> tableDirs = new ArrayList<>();
 
 Review comment:
   Generally speaking ArrayList should be the default choice.
   
   
https://stackoverflow.com/questions/322715/when-to-use-linkedlist-over-arraylist-in-java
   
   In this case, it makes sense because it there is the advantage of using 
`addAll` method on the Collection.  The array can be resized very accurately 
since it's not coming in one-by-one.  Also, if the list returned is large, it 
is much faster to copy the references into `tableDirs` instead of having to 
instantiate a LinkedList Node for each value.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to