mirror of https://github.com/apache/lucene.git
LUCENE-1367: add IndexCommit.isDeleted()
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@689791 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
82c70c018e
commit
4661a1b02b
|
@ -122,6 +122,9 @@ API Changes
|
|||
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
|
||||
|
|
|
@ -401,6 +401,9 @@ abstract class DirectoryIndexReader extends IndexReader {
|
|||
public long getGeneration() {
|
||||
return generation;
|
||||
}
|
||||
public boolean isDeleted() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -74,6 +74,10 @@ public abstract class IndexCommit implements IndexCommitPoint {
|
|||
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.
|
||||
*/
|
||||
|
|
|
@ -637,6 +637,10 @@ final class IndexFileDeleter {
|
|||
}
|
||||
}
|
||||
|
||||
public boolean isDeleted() {
|
||||
return deleted;
|
||||
}
|
||||
|
||||
public int compareTo(Object obj) {
|
||||
CommitPoint commit = (CommitPoint) obj;
|
||||
if (gen < commit.gen) {
|
||||
|
|
|
@ -109,6 +109,9 @@ public class SnapshotDeletionPolicy implements IndexDeletionPolicy {
|
|||
cp.delete();
|
||||
}
|
||||
}
|
||||
public boolean isDeleted() {
|
||||
return cp.isDeleted();
|
||||
}
|
||||
public long getVersion() {
|
||||
return cp.getVersion();
|
||||
}
|
||||
|
|
|
@ -89,7 +89,9 @@ public class TestDeletionPolicy extends LuceneTestCase
|
|||
// 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) {
|
||||
|
|
Loading…
Reference in New Issue