Search in sources :

Example 1 with IOServiceIndexedImpl

use of org.uberfire.ext.metadata.io.IOServiceIndexedImpl in project kie-wb-common by kiegroup.

the class IndexingTest method ioService.

protected IOService ioService() {
    if (ioService == null) {
        final Map<String, Analyzer> analyzers = getAnalyzers();
        MetadataConfigBuilder configBuilder = new MetadataConfigBuilder().withInMemoryMetaModelStore().usingAnalyzers(analyzers).usingAnalyzerWrapperFactory(getAnalyzerWrapperFactory()).useInMemoryDirectory().useDirectoryBasedIndex();
        if (config == null) {
            config = configBuilder.build();
        }
        ExecutorService executorService = Executors.newCachedThreadPool(new DescriptiveThreadFactory());
        ioService = new IOServiceIndexedImpl(config.getIndexEngine(), executorService);
        final TestIndexer indexer = getIndexer();
        IndexersFactory.clear();
        IndexersFactory.addIndexer(indexer);
        // Mock CDI injection and setup
        indexer.setIOService(ioService);
        indexer.setModuleService(getModuleService());
        indexer.setResourceTypeDefinition(getResourceTypeDefinition());
    }
    return ioService;
}
Also used : MetadataConfigBuilder(org.uberfire.ext.metadata.io.MetadataConfigBuilder) ExecutorService(java.util.concurrent.ExecutorService) DescriptiveThreadFactory(org.uberfire.commons.async.DescriptiveThreadFactory) Analyzer(org.apache.lucene.analysis.Analyzer) IOServiceIndexedImpl(org.uberfire.ext.metadata.io.IOServiceIndexedImpl)

Example 2 with IOServiceIndexedImpl

use of org.uberfire.ext.metadata.io.IOServiceIndexedImpl in project kie-wb-common by kiegroup.

the class DefaultApplicationScopedProducer method setup.

@PostConstruct
public void setup() {
    this.ioService = new IOServiceIndexedImpl(watchService, config.getIndexEngine(), defaultIndexEngineObserver, executorService, DublinCoreView.class, VersionAttributeView.class, OtherMetaView.class);
    this.ioSearchService = new IOSearchServiceImpl(config.getSearchIndex(), ioService);
}
Also used : OtherMetaView(org.guvnor.common.services.backend.metadata.attribute.OtherMetaView) DublinCoreView(org.uberfire.io.attribute.DublinCoreView) VersionAttributeView(org.uberfire.java.nio.base.version.VersionAttributeView) IOSearchServiceImpl(org.uberfire.ext.metadata.io.IOSearchServiceImpl) IOServiceIndexedImpl(org.uberfire.ext.metadata.io.IOServiceIndexedImpl) PostConstruct(javax.annotation.PostConstruct)

Example 3 with IOServiceIndexedImpl

use of org.uberfire.ext.metadata.io.IOServiceIndexedImpl in project kie-wb-common by kiegroup.

the class BaseLibraryIndexingTest method ioService.

@SuppressWarnings("unchecked")
protected IOService ioService() {
    if (ioService == null) {
        final Map<String, Analyzer> analyzers = getAnalyzers();
        MetadataConfigBuilder configBuilder = new MetadataConfigBuilder().withInMemoryMetaModelStore().usingAnalyzers(analyzers).usingAnalyzerWrapperFactory(ImpactAnalysisAnalyzerWrapperFactory.getInstance()).useInMemoryDirectory().useDirectoryBasedIndex();
        if (config == null) {
            config = configBuilder.build();
        }
        ExecutorService executorService = Executors.newCachedThreadPool(new DescriptiveThreadFactory());
        ioService = new IOServiceIndexedImpl(config.getIndexEngine(), executorService);
        final LibraryIndexer indexer = new LibraryIndexer(new LibraryAssetTypeDefinition());
        IndexersFactory.clear();
        IndexersFactory.addIndexer(indexer);
        // Mock CDI injection and setup
        indexer.setIOService(ioService);
        indexer.setModuleService(getModuleService());
    }
    return ioService;
}
Also used : MetadataConfigBuilder(org.uberfire.ext.metadata.io.MetadataConfigBuilder) ExecutorService(java.util.concurrent.ExecutorService) DescriptiveThreadFactory(org.uberfire.commons.async.DescriptiveThreadFactory) FilenameAnalyzer(org.uberfire.ext.metadata.backend.lucene.analyzer.FilenameAnalyzer) LowerCaseOnlyAnalyzer(org.kie.workbench.common.services.refactoring.backend.server.indexing.LowerCaseOnlyAnalyzer) Analyzer(org.apache.lucene.analysis.Analyzer) IOServiceIndexedImpl(org.uberfire.ext.metadata.io.IOServiceIndexedImpl)

Aggregations

IOServiceIndexedImpl (org.uberfire.ext.metadata.io.IOServiceIndexedImpl)3 ExecutorService (java.util.concurrent.ExecutorService)2 Analyzer (org.apache.lucene.analysis.Analyzer)2 DescriptiveThreadFactory (org.uberfire.commons.async.DescriptiveThreadFactory)2 MetadataConfigBuilder (org.uberfire.ext.metadata.io.MetadataConfigBuilder)2 PostConstruct (javax.annotation.PostConstruct)1 OtherMetaView (org.guvnor.common.services.backend.metadata.attribute.OtherMetaView)1 LowerCaseOnlyAnalyzer (org.kie.workbench.common.services.refactoring.backend.server.indexing.LowerCaseOnlyAnalyzer)1 FilenameAnalyzer (org.uberfire.ext.metadata.backend.lucene.analyzer.FilenameAnalyzer)1 IOSearchServiceImpl (org.uberfire.ext.metadata.io.IOSearchServiceImpl)1 DublinCoreView (org.uberfire.io.attribute.DublinCoreView)1 VersionAttributeView (org.uberfire.java.nio.base.version.VersionAttributeView)1