lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r762684 - in /lucene/java/trunk/src/java/org/apache/lucene/search: ExtendedFieldCacheImpl.java FieldCache.java FieldCacheImpl.java
Date Tue, 07 Apr 2009 10:59:23 GMT
Author: mikemccand
Date: Tue Apr  7 10:59:22 2009
New Revision: 762684

URL: http://svn.apache.org/viewvc?rev=762684&view=rev
Log:
LUCENE-1582: enable FieldCache.Parser to stop early

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/search/ExtendedFieldCacheImpl.java
    lucene/java/trunk/src/java/org/apache/lucene/search/FieldCache.java
    lucene/java/trunk/src/java/org/apache/lucene/search/FieldCacheImpl.java

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/ExtendedFieldCacheImpl.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/ExtendedFieldCacheImpl.java?rev=762684&r1=762683&r2=762684&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/ExtendedFieldCacheImpl.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/ExtendedFieldCacheImpl.java Tue Apr
 7 10:59:22 2009
@@ -73,6 +73,7 @@
             retArray[termDocs.doc()] = termval;
           }
         } while (termEnum.next());
+      } catch (StopFillCacheException stop) {
       } finally {
         termDocs.close();
         termEnum.close();
@@ -113,6 +114,7 @@
             retArray[termDocs.doc()] = termval;
           }
         } while (termEnum.next());
+      } catch (StopFillCacheException stop) {
       } finally {
         termDocs.close();
         termEnum.close();

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/FieldCache.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/FieldCache.java?rev=762684&r1=762683&r2=762684&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/FieldCache.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/FieldCache.java Tue Apr  7 10:59:22
2009
@@ -82,6 +82,18 @@
   public interface Parser {
   }
 
+  /**
+   * Expert: when thrown from a custom Parser, this stops
+   * processing terms and returns the current FieldCache
+   * array.
+   * 
+   * <p><b>NOTE</b>: This API is experimental and likely to
+   * change in incompatible ways, or be removed entirely, in
+   * the next release.
+   */
+  public static class StopFillCacheException extends RuntimeException {
+  }
+
   /** Interface to parse bytes from document fields.
    * @see FieldCache#getBytes(IndexReader, String, FieldCache.ByteParser)
    */

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/FieldCacheImpl.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/FieldCacheImpl.java?rev=762684&r1=762683&r2=762684&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/FieldCacheImpl.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/FieldCacheImpl.java Tue Apr  7 10:59:22
2009
@@ -196,6 +196,7 @@
             retArray[termDocs.doc()] = termval;
           }
         } while (termEnum.next());
+      } catch (StopFillCacheException stop) {
       } finally {
         termDocs.close();
         termEnum.close();
@@ -235,6 +236,7 @@
             retArray[termDocs.doc()] = termval;
           }
         } while (termEnum.next());
+      } catch (StopFillCacheException stop) {
       } finally {
         termDocs.close();
         termEnum.close();
@@ -274,6 +276,7 @@
             retArray[termDocs.doc()] = termval;
           }
         } while (termEnum.next());
+      } catch (StopFillCacheException stop) {
       } finally {
         termDocs.close();
         termEnum.close();
@@ -315,6 +318,7 @@
             retArray[termDocs.doc()] = termval;
           }
         } while (termEnum.next());
+      } catch (StopFillCacheException stop) {
       } finally {
         termDocs.close();
         termEnum.close();



Mime
View raw message