class IndexWriter {
/**
* Flush all in-memory buffered updates (adds and deletes)
* to the Directory.
* <p>Note: while this will force buffered docs to be
* pushed into the index, it will not make these docs
* visible to a reader. Use {@link #commit()} instead
*
* <p><b>NOTE</b>: if this method hits an OutOfMemoryError
* you should immediately close the writer. See <a
* href="#OOME">above</a> for details.</p>
*
* @deprecated please call {@link #commit()}) instead
*
* @throws CorruptIndexException if the index is corrupt
* @throws IOException if there is a low-level IO error
*/
public final void flush() throws CorruptIndexException, IOException {
if (hitOOM) {
throw new IllegalStateException("this writer hit an OutOfMemoryError; cannot flush");
}
flush(true, false, true);
}
}