mirror of https://github.com/apache/lucene.git
- Changed code to use IndexWriter.WRITE_LOCK_NAME.
- Cleaned up indentation a bit. git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@150096 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9e968c9127
commit
485e3c336f
|
@ -68,6 +68,11 @@ import org.apache.lucene.store.Lock;
|
|||
import org.apache.lucene.store.Directory;
|
||||
import org.apache.lucene.util.BitVector;
|
||||
|
||||
/**
|
||||
* FIXME: Describe class <code>SegmentReader</code> here.
|
||||
*
|
||||
* @version $Id$
|
||||
*/
|
||||
final class SegmentReader extends IndexReader {
|
||||
private boolean closeDirectory = false;
|
||||
private String segment;
|
||||
|
@ -132,7 +137,8 @@ final class SegmentReader extends IndexReader {
|
|||
final synchronized void doClose() throws IOException {
|
||||
if (deletedDocsDirty) {
|
||||
synchronized (directory) { // in- & inter-process sync
|
||||
new Lock.With(directory.makeLock("commit.lock"), IndexWriter.COMMIT_LOCK_TIMEOUT) {
|
||||
new Lock.With(directory.makeLock("IndexWriter.COMMIT_LOCK_NAME"),
|
||||
IndexWriter.COMMIT_LOCK_TIMEOUT) {
|
||||
public Object doBody() throws IOException {
|
||||
deletedDocs.write(directory, segment + ".tmp");
|
||||
directory.renameFile(segment + ".tmp", segment + ".del");
|
||||
|
|
Loading…
Reference in New Issue