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:
Simon Willnauer 2011-04-01 12:42:07 +00:00
parent cf37cec0c6
commit 44e74e4bbc
2 changed files with 4 additions and 7 deletions

View File

@ -119,6 +119,8 @@ final class DocumentsWriter {
final BufferedDeletesStream bufferedDeletesStream;
// TODO: cutover to BytesRefHash
private final BufferedDeletes pendingDeletes = new BufferedDeletes(false);
private Collection<String> abortedFiles; // List of files that were written before last abort()
final IndexingChain chain;
final DocumentsWriterPerThreadPool perThreadPool;
@ -214,7 +216,7 @@ final class DocumentsWriter {
pendingDeletes.addTerm(term, BufferedDeletes.MAX_INT);
}
Iterator<ThreadState> threadsIterator = perThreadPool.getActivePerThreadsIterator();
final Iterator<ThreadState> threadsIterator = perThreadPool.getActivePerThreadsIterator();
while (threadsIterator.hasNext()) {
ThreadState state = threadsIterator.next();
@ -239,19 +241,16 @@ final class DocumentsWriter {
indexWriter.flushCount.incrementAndGet();
}
/** If non-null, various details of indexing are printed
* here. */
synchronized void setInfoStream(PrintStream infoStream) {
this.infoStream = infoStream;
pushConfigChange();
}
private final void pushConfigChange() {
Iterator<ThreadState> it = perThreadPool.getAllPerThreadsIterator();
final Iterator<ThreadState> it = perThreadPool.getAllPerThreadsIterator();
while (it.hasNext()) {
DocumentsWriterPerThread perThread = it.next().perThread;
perThread.docState.infoStream = this.infoStream;
perThread.docState.similarityProvider = this.similarityProvider;
}
}
@ -259,7 +258,6 @@ final class DocumentsWriter {
int getNumDocs() {
return numDocsInRAM.get();
}
private Collection<String> abortedFiles; // List of files that were written before last abort()
Collection<String> abortedFiles() {
return abortedFiles;

View File

@ -132,7 +132,6 @@ public abstract class DocumentsWriterPerThreadPool {
} else {
threadState.resetWriter(null);
}
clearThreadBindings(threadState); // TODO - do we need to clear ThreadBindings here since we swap DWPT this is not necessary
return dwpt;
}