lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r1196146 - /lucene/dev/branches/lucene2621/lucene/src/java/org/apache/lucene/index/codecs/perfield/PerFieldPostingsFormat.java
Date Tue, 01 Nov 2011 17:09:37 GMT
Author: mikemccand
Date: Tue Nov  1 17:09:37 2011
New Revision: 1196146

URL: http://svn.apache.org/viewvc?rev=1196146&view=rev
Log:
PFPF: FNFE in .files() means there are no files

Modified:
    lucene/dev/branches/lucene2621/lucene/src/java/org/apache/lucene/index/codecs/perfield/PerFieldPostingsFormat.java

Modified: lucene/dev/branches/lucene2621/lucene/src/java/org/apache/lucene/index/codecs/perfield/PerFieldPostingsFormat.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene2621/lucene/src/java/org/apache/lucene/index/codecs/perfield/PerFieldPostingsFormat.java?rev=1196146&r1=1196145&r2=1196146&view=diff
==============================================================================
--- lucene/dev/branches/lucene2621/lucene/src/java/org/apache/lucene/index/codecs/perfield/PerFieldPostingsFormat.java
(original)
+++ lucene/dev/branches/lucene2621/lucene/src/java/org/apache/lucene/index/codecs/perfield/PerFieldPostingsFormat.java
Tue Nov  1 17:09:37 2011
@@ -18,6 +18,7 @@ package org.apache.lucene.index.codecs.p
  */
 
 import java.io.Closeable;
+import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.util.HashMap;
 import java.util.IdentityHashMap;
@@ -363,16 +364,23 @@ public abstract class PerFieldPostingsFo
     final String mapFileName = IndexFileNames.segmentFileName(info.name, formatId, PER_FIELD_EXTENSION);
     files.add(mapFileName);
 
-    new VisitPerFieldFile(dir, info.name) {
-      @Override
-      protected void visitOneFormat(int formatID, PostingsFormat format) throws IOException
{
-        format.files(dir, info, formatID, files);
-      }
-
-      @Override
-      protected void visitOneField(String field, PostingsFormat format) {
-      }
-    };
+    try {
+      new VisitPerFieldFile(dir, info.name) {
+        @Override
+          protected void visitOneFormat(int formatID, PostingsFormat format) throws IOException
{
+          format.files(dir, info, formatID, files);
+        }
+
+        @Override
+          protected void visitOneField(String field, PostingsFormat format) {
+        }
+      };
+    } catch (FileNotFoundException fnfe) {
+      // nocommit this is shady:
+      // Don't add any files (if the _X.per file has been
+      // deleted then no files for this segment are
+      // "available").
+    }
   }
 
   // nocommit: do we really need to pass fieldInfo here?



Mime
View raw message