mirror of
https://github.com/apache/lucene.git
synced 2025-02-11 04:25:40 +00:00
do not clear threadbindings when DWPT is swapped out for flushing
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/realtime_search@1087687 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
cf37cec0c6
commit
44e74e4bbc
@ -119,6 +119,8 @@ final class DocumentsWriter {
|
|||||||
final BufferedDeletesStream bufferedDeletesStream;
|
final BufferedDeletesStream bufferedDeletesStream;
|
||||||
// TODO: cutover to BytesRefHash
|
// TODO: cutover to BytesRefHash
|
||||||
private final BufferedDeletes pendingDeletes = new BufferedDeletes(false);
|
private final BufferedDeletes pendingDeletes = new BufferedDeletes(false);
|
||||||
|
private Collection<String> abortedFiles; // List of files that were written before last abort()
|
||||||
|
|
||||||
final IndexingChain chain;
|
final IndexingChain chain;
|
||||||
|
|
||||||
final DocumentsWriterPerThreadPool perThreadPool;
|
final DocumentsWriterPerThreadPool perThreadPool;
|
||||||
@ -214,7 +216,7 @@ final class DocumentsWriter {
|
|||||||
pendingDeletes.addTerm(term, BufferedDeletes.MAX_INT);
|
pendingDeletes.addTerm(term, BufferedDeletes.MAX_INT);
|
||||||
}
|
}
|
||||||
|
|
||||||
Iterator<ThreadState> threadsIterator = perThreadPool.getActivePerThreadsIterator();
|
final Iterator<ThreadState> threadsIterator = perThreadPool.getActivePerThreadsIterator();
|
||||||
|
|
||||||
while (threadsIterator.hasNext()) {
|
while (threadsIterator.hasNext()) {
|
||||||
ThreadState state = threadsIterator.next();
|
ThreadState state = threadsIterator.next();
|
||||||
@ -239,19 +241,16 @@ final class DocumentsWriter {
|
|||||||
indexWriter.flushCount.incrementAndGet();
|
indexWriter.flushCount.incrementAndGet();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** If non-null, various details of indexing are printed
|
|
||||||
* here. */
|
|
||||||
synchronized void setInfoStream(PrintStream infoStream) {
|
synchronized void setInfoStream(PrintStream infoStream) {
|
||||||
this.infoStream = infoStream;
|
this.infoStream = infoStream;
|
||||||
pushConfigChange();
|
pushConfigChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
private final void pushConfigChange() {
|
private final void pushConfigChange() {
|
||||||
Iterator<ThreadState> it = perThreadPool.getAllPerThreadsIterator();
|
final Iterator<ThreadState> it = perThreadPool.getAllPerThreadsIterator();
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
DocumentsWriterPerThread perThread = it.next().perThread;
|
DocumentsWriterPerThread perThread = it.next().perThread;
|
||||||
perThread.docState.infoStream = this.infoStream;
|
perThread.docState.infoStream = this.infoStream;
|
||||||
perThread.docState.similarityProvider = this.similarityProvider;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -259,7 +258,6 @@ final class DocumentsWriter {
|
|||||||
int getNumDocs() {
|
int getNumDocs() {
|
||||||
return numDocsInRAM.get();
|
return numDocsInRAM.get();
|
||||||
}
|
}
|
||||||
private Collection<String> abortedFiles; // List of files that were written before last abort()
|
|
||||||
|
|
||||||
Collection<String> abortedFiles() {
|
Collection<String> abortedFiles() {
|
||||||
return abortedFiles;
|
return abortedFiles;
|
||||||
|
@ -132,7 +132,6 @@ public abstract class DocumentsWriterPerThreadPool {
|
|||||||
} else {
|
} else {
|
||||||
threadState.resetWriter(null);
|
threadState.resetWriter(null);
|
||||||
}
|
}
|
||||||
clearThreadBindings(threadState); // TODO - do we need to clear ThreadBindings here since we swap DWPT this is not necessary
|
|
||||||
return dwpt;
|
return dwpt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user