mirror of https://github.com/apache/lucene.git
fix IW infoStream to tell us when an NRT reader incRef/decRefs its segments
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1714017 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
eb0da10bb4
commit
456e17a8e4
|
@ -693,7 +693,7 @@ final class IndexFileDeleter implements Closeable {
|
|||
if (!refCounts.containsKey(fileName)) {
|
||||
rc = new RefCount(fileName);
|
||||
// We should never incRef a file we are already wanting to delete:
|
||||
assert deletable == null || deletable.contains(fileName) == false: "file \"" + fileName + "\" cannot be incRef'd: it's already pending delete";
|
||||
assert deletable.contains(fileName) == false: "file \"" + fileName + "\" cannot be incRef'd: it's already pending delete";
|
||||
refCounts.put(fileName, rc);
|
||||
} else {
|
||||
rc = refCounts.get(fileName);
|
||||
|
|
|
@ -4704,17 +4704,22 @@ public class IndexWriter implements Closeable, TwoPhaseCommit, Accountable {
|
|||
maybeMerge(config.getMergePolicy(), MergeTrigger.SEGMENT_FLUSH, UNBOUNDED_MAX_MERGE_SEGMENTS);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
synchronized void incRefDeleter(SegmentInfos segmentInfos) throws IOException {
|
||||
ensureOpen();
|
||||
deleter.incRef(segmentInfos, false);
|
||||
if (infoStream.isEnabled("IW")) {
|
||||
infoStream.message("IW", "incRefDeleter for NRT reader version=" + segmentInfos.getVersion() + " segments=" + segString(segmentInfos));
|
||||
}
|
||||
}
|
||||
|
||||
synchronized void decRefDeleter(SegmentInfos segmentInfos) throws IOException {
|
||||
ensureOpen();
|
||||
deleter.decRef(segmentInfos);
|
||||
if (infoStream.isEnabled("IW")) {
|
||||
infoStream.message("IW", "decRefDeleter for NRT reader version=" + segmentInfos.getVersion() + " segments=" + segString(segmentInfos));
|
||||
}
|
||||
}
|
||||
|
||||
private boolean processEvents(boolean triggerMerge, boolean forcePurge) throws IOException {
|
||||
|
|
Loading…
Reference in New Issue