Search in sources :

Example 1 with JCasPool

use of org.apache.uima.util.JCasPool in project lucene-solr by apache.

the class UIMAUpdateRequestProcessorFactory method getInstance.

@Override
public UpdateRequestProcessor getInstance(SolrQueryRequest req, SolrQueryResponse rsp, UpdateRequestProcessor next) {
    SolrUIMAConfiguration configuration = new SolrUIMAConfigurationReader(args).readSolrUIMAConfiguration();
    synchronized (this) {
        if (ae == null && pool == null) {
            AEProvider aeProvider = AEProviderFactory.getInstance().getAEProvider(req.getCore().getName(), configuration.getAePath(), configuration.getRuntimeParameters());
            try {
                ae = aeProvider.getAE();
                pool = new JCasPool(10, ae);
            } catch (ResourceInitializationException e) {
                throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, e);
            }
        }
    }
    return new UIMAUpdateRequestProcessor(next, req.getCore().getName(), configuration, ae, pool);
}
Also used : AEProvider(org.apache.lucene.analysis.uima.ae.AEProvider) ResourceInitializationException(org.apache.uima.resource.ResourceInitializationException) JCasPool(org.apache.uima.util.JCasPool) SolrException(org.apache.solr.common.SolrException)

Aggregations

AEProvider (org.apache.lucene.analysis.uima.ae.AEProvider)1 SolrException (org.apache.solr.common.SolrException)1 ResourceInitializationException (org.apache.uima.resource.ResourceInitializationException)1 JCasPool (org.apache.uima.util.JCasPool)1