public final class LTRThreadModule extends Object implements NamedListInitializedPlugin
LTRQParserPlugin and
 LTRFeatureLoggerTransformerFactory
 classes to parallelize the creation of Feature.FeatureWeight
 objects.
 Example configuration:
  <queryParser name="ltr" class="org.apache.solr.ltr.search.LTRQParserPlugin">
     <int name="threadModule.totalPoolThreads">10</int>
     <int name="threadModule.numThreadsPerRequest">5</int>
  </queryParser>
  <transformer name="features" class="org.apache.solr.ltr.response.transform.LTRFeatureLoggerTransformerFactory">
     <int name="threadModule.totalPoolThreads">10</int>
     <int name="threadModule.numThreadsPerRequest">5</int>
  </transformer>
 If an individual solr instance is expected to receive no more than one query at a time, it is best
 to set totalPoolThreads and numThreadsPerRequest to the same value.
 If multiple queries need to be serviced simultaneously then totalPoolThreads and
 numThreadsPerRequest can be adjusted based on the expected response times.
 If the value of numThreadsPerRequest is higher, the response time for a single query
 will be improved up to a point. If multiple queries are serviced simultaneously, the value of
 totalPoolThreads imposes a contention between the queries if
 (totalPoolThreads < numThreadsPerRequest * total parallel queries).| Constructor and Description | 
|---|
| LTRThreadModule() | 
| Modifier and Type | Method and Description | 
|---|---|
| void | acquireLTRSemaphore() | 
| Semaphore | createQuerySemaphore() | 
| void | execute(Runnable command) | 
| static LTRThreadModule | getInstance(NamedList args) | 
| void | init(NamedList args) | 
| void | releaseLTRSemaphore() | 
| void | setKeepAliveTimeSeconds(long keepAliveTimeSeconds) | 
| void | setMaxPoolSize(int maxPoolSize) | 
| void | setNumThreadsPerRequest(int numThreadsPerRequest) | 
| void | setThreadNamePrefix(String threadNamePrefix) | 
| void | setTotalPoolThreads(int totalPoolThreads) | 
public static LTRThreadModule getInstance(NamedList args)
public void init(NamedList args)
init in interface NamedListInitializedPluginpublic void setTotalPoolThreads(int totalPoolThreads)
public void setNumThreadsPerRequest(int numThreadsPerRequest)
public void setMaxPoolSize(int maxPoolSize)
public void setKeepAliveTimeSeconds(long keepAliveTimeSeconds)
public void setThreadNamePrefix(String threadNamePrefix)
public Semaphore createQuerySemaphore()
public void acquireLTRSemaphore()
                         throws InterruptedException
InterruptedExceptionpublic void releaseLTRSemaphore()
                         throws InterruptedException
InterruptedExceptionpublic void execute(Runnable command)
Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.