improve javadocs

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1559103 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2014-01-17 13:37:14 +00:00
parent 50682f5ab7
commit a3c48b5ac4
1 changed files with 14 additions and 7 deletions

View File

@ -1112,7 +1112,11 @@ public class IndexWriter implements Closeable, TwoPhaseCommit{
} }
/** /**
* Returns true if this index has deletions (including buffered deletions). * Returns true if this index has deletions (including
* buffered deletions). Note that this will return true
* if there are buffered Term/Query deletions, even if it
* turns out those buffered deletions don't match any
* documents.
*/ */
public synchronized boolean hasDeletions() { public synchronized boolean hasDeletions() {
ensureOpen(); ensureOpen();
@ -2893,12 +2897,15 @@ public class IndexWriter implements Closeable, TwoPhaseCommit{
commitInternal(); commitInternal();
} }
/** Returns true if there are changes that have not been /** Returns true if there may be changes that have not been
* committed. Note that if a merge kicked off as a * committed. There are cases where this may return true
* result of flushing a new segment during {@link * when there are no actual "real" changes to the index,
* #commit}, or a concurrent merged finished, * for example if you've deleted by Term or Query but
* this method may return true right after you * that Term or Query does not match any documents.
* had just called {@link #commit}. */ * Also, if a merge kicked off as a result of flushing a
* new segment during {@link #commit}, or a concurrent
* merged finished, this method may return true right
* after you had just called {@link #commit}. */
public final boolean hasUncommittedChanges() { public final boolean hasUncommittedChanges() {
return changeCount != lastCommitChangeCount || docWriter.anyChanges() || bufferedUpdatesStream.any(); return changeCount != lastCommitChangeCount || docWriter.anyChanges() || bufferedUpdatesStream.any();
} }