lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r689791 - in /lucene/java/trunk: ./ src/java/org/apache/lucene/index/ src/test/org/apache/lucene/index/
Date Thu, 28 Aug 2008 11:50:17 GMT
Author: mikemccand
Date: Thu Aug 28 04:50:15 2008
New Revision: 689791

URL: http://svn.apache.org/viewvc?rev=689791&view=rev
Log:
LUCENE-1367: add IndexCommit.isDeleted()

Modified:
    lucene/java/trunk/CHANGES.txt
    lucene/java/trunk/src/java/org/apache/lucene/index/DirectoryIndexReader.java
    lucene/java/trunk/src/java/org/apache/lucene/index/IndexCommit.java
    lucene/java/trunk/src/java/org/apache/lucene/index/IndexFileDeleter.java
    lucene/java/trunk/src/java/org/apache/lucene/index/SnapshotDeletionPolicy.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestDeletionPolicy.java

Modified: lucene/java/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/trunk/CHANGES.txt?rev=689791&r1=689790&r2=689791&view=diff
==============================================================================
--- lucene/java/trunk/CHANGES.txt (original)
+++ lucene/java/trunk/CHANGES.txt Thu Aug 28 04:50:15 2008
@@ -122,6 +122,9 @@
     3.0 the default will become true.  (Jason Rutherglen via Mike
     McCandless)
 
+19. LUCENE-1367: Add IndexCommit.isDeleted().  (Shalin Shekhar Mangar
+    via Mike McCandless)
+
 Bug fixes
     
  1. LUCENE-1134: Fixed BooleanQuery.rewrite to only optimize a single 

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/DirectoryIndexReader.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/DirectoryIndexReader.java?rev=689791&r1=689790&r2=689791&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/DirectoryIndexReader.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/DirectoryIndexReader.java Thu Aug 28
04:50:15 2008
@@ -401,6 +401,9 @@
     public long getGeneration() {
       return generation;
     }
+    public boolean isDeleted() {
+      return false;
+    }
   }
 
   /**

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/IndexCommit.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/IndexCommit.java?rev=689791&r1=689790&r2=689791&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/IndexCommit.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/IndexCommit.java Thu Aug 28 04:50:15
2008
@@ -74,6 +74,10 @@
     throw new UnsupportedOperationException("This IndexCommit does not support this method.");
   }
 
+  public boolean isDeleted() {
+    throw new UnsupportedOperationException("This IndexCommit does not support this method.");
+  }
+
   /**
    * Returns true if this commit is an optimized index.
    */

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/IndexFileDeleter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/IndexFileDeleter.java?rev=689791&r1=689790&r2=689791&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/IndexFileDeleter.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/IndexFileDeleter.java Thu Aug 28 04:50:15
2008
@@ -637,6 +637,10 @@
       }
     }
 
+    public boolean isDeleted() {
+      return deleted;
+    }
+
     public int compareTo(Object obj) {
       CommitPoint commit = (CommitPoint) obj;
       if (gen < commit.gen) {

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/SnapshotDeletionPolicy.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/SnapshotDeletionPolicy.java?rev=689791&r1=689790&r2=689791&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/SnapshotDeletionPolicy.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/SnapshotDeletionPolicy.java Thu Aug
28 04:50:15 2008
@@ -109,6 +109,9 @@
           cp.delete();
       }
     }
+    public boolean isDeleted() {
+      return cp.isDeleted();
+    }
     public long getVersion() {
       return cp.getVersion();
     }

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestDeletionPolicy.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestDeletionPolicy.java?rev=689791&r1=689790&r2=689791&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestDeletionPolicy.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestDeletionPolicy.java Thu Aug 28
04:50:15 2008
@@ -89,7 +89,9 @@
       // On init, delete all commit points:
       Iterator it = commits.iterator();
       while(it.hasNext()) {
-        ((IndexCommit) it.next()).delete();
+        final IndexCommit commit = (IndexCommit) it.next();
+        commit.delete();
+        assertTrue(commit.isDeleted());
       }
     }
     public void onCommit(List commits) {



Mime
View raw message