accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] keith-turner commented on a change in pull request #389: ACCUMULO-4805 Optimize file manager when no files to open
Date Thu, 01 Jan 1970 00:00:00 GMT
keith-turner commented on a change in pull request #389: ACCUMULO-4805 Optimize file manager
when no files to open
URL: https://github.com/apache/accumulo/pull/389#discussion_r169537331
 
 

 ##########
 File path: server/tserver/src/main/java/org/apache/accumulo/tserver/FileManager.java
 ##########
 @@ -245,20 +245,21 @@ private void closeReaders(Collection<FileSKVIterator> filesToClose)
{
   }
 
   private List<String> takeOpenFiles(Collection<String> files, Map<FileSKVIterator,String>
readersReserved) {
-    List<String> filesToOpen = new LinkedList<>(files);
-    for (Iterator<String> iterator = filesToOpen.iterator(); iterator.hasNext();) {
-      String file = iterator.next();
-
+    List<String> filesToOpen = Collections.emptyList();
+    for (String file : files) {
       List<OpenReader> ofl = openFiles.get(file);
       if (ofl != null && ofl.size() > 0) {
         OpenReader openReader = ofl.remove(ofl.size() - 1);
         readersReserved.put(openReader.reader, file);
         if (ofl.size() == 0) {
           openFiles.remove(file);
         }
-        iterator.remove();
+      } else {
+        if(filesToOpen.size() == 0) {
 
 Review comment:
   yeah

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


With regards,
Apache Git Services

Mime
View raw message