You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by sh...@apache.org on 2015/02/03 07:56:10 UTC

svn commit: r1656631 - in /lucene/dev/branches/branch_5x: ./ solr/ solr/core/ solr/core/src/java/org/apache/solr/handler/SnapPuller.java

Author: shalin
Date: Tue Feb  3 06:56:09 2015
New Revision: 1656631

URL: http://svn.apache.org/r1656631
Log:
SOLR-6640: Use SegmentInfos.files in unused file check

Modified:
    lucene/dev/branches/branch_5x/   (props changed)
    lucene/dev/branches/branch_5x/solr/   (props changed)
    lucene/dev/branches/branch_5x/solr/core/   (props changed)
    lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/SnapPuller.java

Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/SnapPuller.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/SnapPuller.java?rev=1656631&r1=1656630&r2=1656631&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/SnapPuller.java (original)
+++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/SnapPuller.java Tue Feb  3 06:56:09 2015
@@ -569,13 +569,9 @@ public class SnapPuller {
   }
 
   private boolean hasUnusedFiles(Directory indexDir, IndexCommit commit) throws IOException {
-    Set<String> currentFiles = new HashSet<>();
     String segmentsFileName = commit.getSegmentsFileName();
     SegmentInfos infos = SegmentInfos.readCommit(indexDir, segmentsFileName);
-    for (SegmentCommitInfo info : infos.asList()) {
-      Set<String> files = info.info.files(); // All files that belong to this segment
-      currentFiles.addAll(files);
-    }
+    Set<String> currentFiles = new HashSet<>(infos.files(indexDir, true));
     String[] allFiles = indexDir.listAll();
     for (String file : allFiles) {
       if (!file.equals(segmentsFileName) && !currentFiles.contains(file) && !file.endsWith(".lock")) {