java - Hibernate Search synchronous execution in main thread -


Text after "

It looks like Hibernate Search uses synchronous execution other formulas other than calling thread for parallel execution.

How? I execute hanging serial search hibernate sequence in the thread

Problem in being the org.hibernate.search.backend.impl.lucene.QueueProcessors class looks:

  Private zero runoff () throws blocking exceptions {list & lt; Future & lt; Object & gt; & Gt; Futures = New Arrestist & lt; Future & lt; Object & gt; & Gt; (DPProcessor size ()); // Perform all the tasks in parallel on each directory provider; // Each DP has its own Executioners service. (PerDPQueueProcessor Process: dpProcessors.values ​​()) {Executor Services Exporter = process.getOwningExecutor (); // Wrap every runner in every future future & lt; Object & gt; F = new futuristic & lt; Object & gt; (Process, empty); Futures.ed (F); Executor.execute (f); } // And then wait for all tasks to be completed: For (future  gt; f: futures) {if (! F.isDone ()) {try {f.get ()}} Grip (ignore cancellationException ignore) {// ignored as, java.util.concurrent.AbstractExecutorService.invokeAll (collections of & lt; repayable & lt; t & gt; & gt; // functions)} (ExecutionException error) {// Reithrow reason to thread threading - This can hide more exceptions: Throwable Cause = Error. Gel reason (); New search exception throw (reason); }}}}   

A serial synchronous execution will reveal what the thread will be in thread and disclose reference information such as the authentication information for the underlying DirectoryProvider.

"itemprop =" text ">

is a very old question, but I can also answer it ...

< P> Find Hibernate to make a single threaded access to Lucene IndexWriter (which is required by Lucene) for a directory. I had a way of dealing with queue problem using a single threaded executor of per-directory imagery.

If you want to run all this in the thread, then you need to re-apply the code> LuceneBackendQueueProcessorFactory and in the hibernate properties hibernate.search.worker.backend < Bind to / code>. Not trivial, but tax-worthy.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -