Example #1
0
 /**
  * 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);
 }
Example #2
0
 @Override
 public void close() throws IOException {
   indexWriterPool.close();
 }
Example #3
0
 /**
  * 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);
 }