use of org.neo4j.kernel.api.labelscan.LoggingMonitor in project neo4j by neo4j.
the class NativeLabelScanStoreExtension method newInstance.
@Override
public Lifecycle newInstance(KernelContext context, Dependencies dependencies) throws Throwable {
Log log = dependencies.getLogService().getInternalLog(NativeLabelScanStore.class);
Monitor monitor = new LoggingMonitor(log, this.monitor);
NativeLabelScanStore labelScanStore = new NativeLabelScanStore(dependencies.pageCache(), context.storeDir(), new FullLabelStream(dependencies.indexStoreView()), dependencies.getConfig().get(GraphDatabaseSettings.read_only), monitor);
return new LabelScanStoreProvider(NAME, labelScanStore);
}
use of org.neo4j.kernel.api.labelscan.LoggingMonitor 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;
}
use of org.neo4j.kernel.api.labelscan.LoggingMonitor 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);
}
Aggregations