use of org.neo4j.kernel.impl.api.scan.LabelScanStoreProvider 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);
}
use of org.neo4j.kernel.impl.api.scan.LabelScanStoreProvider in project neo4j by neo4j.
the class NamedLabelScanStoreSelectionStrategyTest method shouldAutoSelectDefaultProviderIfNoProviderWithPresentStore.
@Test
public void shouldAutoSelectDefaultProviderIfNoProviderWithPresentStore() throws Exception {
// GIVEN
NamedLabelScanStoreSelectionStrategy strategy = strategy(LabelIndex.AUTO);
LabelScanStoreProvider nativeProvider = provider(LabelIndex.NATIVE, store(false));
LabelScanStoreProvider luceneProvider = provider(LabelIndex.LUCENE, store(false));
// WHEN
LabelScanStoreProvider selected = select(strategy, nativeProvider, luceneProvider);
// THEN
assertEquals(GraphDatabaseSettings.label_index.getDefaultValue(), selected.getName());
}
use of org.neo4j.kernel.impl.api.scan.LabelScanStoreProvider in project neo4j by neo4j.
the class NamedLabelScanStoreSelectionStrategyTest method shouldAutoSelectSingleProviderWithPresentStoreAmongMultipleProviders.
@Test
public void shouldAutoSelectSingleProviderWithPresentStoreAmongMultipleProviders() throws Exception {
// GIVEN
NamedLabelScanStoreSelectionStrategy strategy = strategy(LabelIndex.AUTO);
LabelScanStoreProvider nativeProvider = provider(LabelIndex.NATIVE, store(false));
LabelScanStoreProvider luceneProvider = provider(LabelIndex.LUCENE, store(true));
// WHEN
LabelScanStoreProvider selected = select(strategy, nativeProvider, luceneProvider);
// THEN
assertSame(luceneProvider, selected);
}
use of org.neo4j.kernel.impl.api.scan.LabelScanStoreProvider in project neo4j by neo4j.
the class NamedLabelScanStoreSelectionStrategyTest method shouldAutoSelectProviderWithPresentStoreEvenIfSomeOtherReportedIOException.
@Test
public void shouldAutoSelectProviderWithPresentStoreEvenIfSomeOtherReportedIOException() throws Exception {
// GIVEN
NamedLabelScanStoreSelectionStrategy strategy = strategy(LabelIndex.AUTO);
LabelScanStoreProvider nativeProvider = provider(LabelIndex.NATIVE, store(true));
LabelScanStoreProvider luceneProvider = provider(LabelIndex.LUCENE, store(null));
// WHEN
LabelScanStoreProvider selected = select(strategy, nativeProvider, luceneProvider);
// THEN
assertSame(nativeProvider, selected);
}
use of org.neo4j.kernel.impl.api.scan.LabelScanStoreProvider in project neo4j by neo4j.
the class NamedLabelScanStoreSelectionStrategyTest method shouldSelectSpecificallyConfiguredProviderWhenSingle.
@Test
public void shouldSelectSpecificallyConfiguredProviderWhenSingle() throws Exception {
// GIVEN
NamedLabelScanStoreSelectionStrategy strategy = strategy(LabelIndex.NATIVE);
LabelScanStoreProvider single = provider(LabelIndex.NATIVE, store(false));
// WHEN
LabelScanStoreProvider selected = select(strategy, single);
// THEN
assertSame(single, selected);
}
Aggregations