/** * Return the index writer to the pool * * @param index - the primary index used to create the writer * @param writer * @throws Exception */ public void releaseIndexWriter(final AdapterToIndexMapping mapping, final IndexWriter writer) throws Exception { indexWriterPool.returnObject(mapping, writer); }
@Override public void close() throws IOException { indexWriterPool.close(); }
/** * Return an index writer from the pool. The pool will create a new one The pool will not be * cleaned up until the end. (No items will be cleaned up until the end) * * @param index * @return * @throws Exception */ public IndexWriter getIndexWriter(final AdapterToIndexMapping mapping) throws Exception { return indexWriterPool.borrowObject(mapping); }