document what IW.close is doing and how to 'actually close' if you want that

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1372839 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2012-08-14 11:05:32 +00:00
parent 46b8a90c11
commit 0eda73aa3c
1 changed files with 9 additions and 2 deletions

View File

@ -763,8 +763,15 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {
}
/**
* Commits all changes to an index and closes all
* associated files. Note that this may be a costly
* Commits all changes to an index, waits for pending merges
* to complete, and closes all associated files.
* <p>
* This is a "slow graceful shutdown" which may take a long time
* especially if a big merge is pending: If you only want to close
* resources use {@link #rollback()}. If you only want to commit
* pending changes and close resources see {@link #close(boolean)}.
* <p>
* Note that this may be a costly
* operation, so, try to re-use a single writer instead of
* closing and opening a new one. See {@link #commit()} for
* caveats about write caching done by some IO devices.