Search in sources :

Example 1 with FullLabelStream

use of org.neo4j.kernel.impl.api.scan.FullLabelStream in project neo4j by neo4j.

the class LuceneLabelScanStoreBuilder method build.

public LabelScanStore build() {
    if (null == labelScanStore) {
        // TODO: Replace with kernel extension based lookup
        LabelScanStore.Monitor monitor = new LoggingMonitor(logProvider.getLog(LuceneLabelScanStore.class));
        LuceneLabelScanIndexBuilder indexBuilder = LuceneLabelScanIndexBuilder.create().withFileSystem(fileSystem).withIndexRootFolder(getStoreDirectory(storeDir)).withConfig(config).withOperationalMode(operationalMode);
        labelScanStore = new LuceneLabelScanStore(indexBuilder, new FullLabelStream(storeViewSupplier), monitor);
        try {
            labelScanStore.init();
            labelScanStore.start();
        } catch (IOException e) {
            // Throw better exception
            throw new RuntimeException(e);
        }
    }
    return labelScanStore;
}
Also used : LuceneLabelScanStore(org.neo4j.kernel.api.impl.labelscan.LuceneLabelScanStore) LabelScanStore(org.neo4j.kernel.api.labelscan.LabelScanStore) LoggingMonitor(org.neo4j.kernel.api.labelscan.LoggingMonitor) LuceneLabelScanIndexBuilder(org.neo4j.kernel.api.impl.labelscan.LuceneLabelScanIndexBuilder) FullLabelStream(org.neo4j.kernel.impl.api.scan.FullLabelStream) LuceneLabelScanStore(org.neo4j.kernel.api.impl.labelscan.LuceneLabelScanStore) IOException(java.io.IOException)

Example 2 with FullLabelStream

use of org.neo4j.kernel.impl.api.scan.FullLabelStream in project neo4j by neo4j.

the class LuceneLabelScanStoreExtension method newInstance.

@Override
public LabelScanStoreProvider newInstance(KernelContext context, Dependencies dependencies) throws Throwable {
    Config config = dependencies.getConfig();
    boolean ephemeral = config.get(GraphDatabaseFacadeFactory.Configuration.ephemeral);
    FileSystemAbstraction fileSystem = dependencies.fileSystem();
    DirectoryFactory directoryFactory = directoryFactory(ephemeral, fileSystem);
    LuceneLabelScanIndexBuilder indexBuilder = getIndexBuilder(context, directoryFactory, fileSystem, config);
    LogProvider logger = dependencies.getLogService().getInternalLogProvider();
    Monitor loggingMonitor = new LoggingMonitor(logger.getLog(LuceneLabelScanStore.class), monitor);
    LuceneLabelScanStore scanStore = new LuceneLabelScanStore(indexBuilder, new FullLabelStream(dependencies.indexStoreView()), loggingMonitor);
    return new LabelScanStoreProvider(NAME, scanStore);
}
Also used : LogProvider(org.neo4j.logging.LogProvider) FileSystemAbstraction(org.neo4j.io.fs.FileSystemAbstraction) LoggingMonitor(org.neo4j.kernel.api.labelscan.LoggingMonitor) Monitor(org.neo4j.kernel.api.labelscan.LabelScanStore.Monitor) LabelScanStoreProvider(org.neo4j.kernel.impl.api.scan.LabelScanStoreProvider) LoggingMonitor(org.neo4j.kernel.api.labelscan.LoggingMonitor) Config(org.neo4j.kernel.configuration.Config) DirectoryFactory(org.neo4j.kernel.api.impl.index.storage.DirectoryFactory) FullLabelStream(org.neo4j.kernel.impl.api.scan.FullLabelStream)

Aggregations

LoggingMonitor (org.neo4j.kernel.api.labelscan.LoggingMonitor)2 FullLabelStream (org.neo4j.kernel.impl.api.scan.FullLabelStream)2 IOException (java.io.IOException)1 FileSystemAbstraction (org.neo4j.io.fs.FileSystemAbstraction)1 DirectoryFactory (org.neo4j.kernel.api.impl.index.storage.DirectoryFactory)1 LuceneLabelScanIndexBuilder (org.neo4j.kernel.api.impl.labelscan.LuceneLabelScanIndexBuilder)1 LuceneLabelScanStore (org.neo4j.kernel.api.impl.labelscan.LuceneLabelScanStore)1 LabelScanStore (org.neo4j.kernel.api.labelscan.LabelScanStore)1 Monitor (org.neo4j.kernel.api.labelscan.LabelScanStore.Monitor)1 Config (org.neo4j.kernel.configuration.Config)1 LabelScanStoreProvider (org.neo4j.kernel.impl.api.scan.LabelScanStoreProvider)1 LogProvider (org.neo4j.logging.LogProvider)1