class TermVectorsTermsWriter {
synchronized void flush(Map threadsAndFields, final SegmentWriteState state) throws IOException {
if (tvx != null) {
if (state.numDocsInStore > 0)
// In case there are some final documents that we
// didn't see (because they hit a non-aborting exception):
fill(state.numDocsInStore - docWriter.getDocStoreOffset());
tvx.flush();
tvd.flush();
tvf.flush();
}
Iterator it = threadsAndFields.entrySet().iterator();
while(it.hasNext()) {
Map.Entry entry = (Map.Entry) it.next();
Iterator it2 = ((Collection) entry.getValue()).iterator();
while(it2.hasNext()) {
TermVectorsTermsWriterPerField perField = (TermVectorsTermsWriterPerField) it2.next();
perField.termsHashPerField.reset();
perField.shrinkHash();
}
TermVectorsTermsWriterPerThread perThread = (TermVectorsTermsWriterPerThread) entry.getKey();
perThread.termsHashPerThread.reset(true);
}
}
}