Search in sources :

Example 6 with CommunityIdTypeConfigurationProvider

use of org.neo4j.kernel.impl.store.id.configuration.CommunityIdTypeConfigurationProvider in project neo4j by neo4j.

the class RecordStorageEngineRule method get.

private RecordStorageEngine get(FileSystemAbstraction fs, PageCache pageCache, SchemaIndexProvider schemaIndexProvider, DatabaseHealth databaseHealth, File storeDirectory, Function<BatchTransactionApplierFacade, BatchTransactionApplierFacade> transactionApplierTransformer) {
    if (!fs.fileExists(storeDirectory) && !fs.mkdir(storeDirectory)) {
        throw new IllegalStateException();
    }
    IdGeneratorFactory idGeneratorFactory = new EphemeralIdGenerator.Factory();
    LabelScanStoreProvider labelScanStoreProvider = nativeLabelScanStoreProvider(storeDirectory, fs, pageCache);
    LegacyIndexProviderLookup legacyIndexProviderLookup = mock(LegacyIndexProviderLookup.class);
    when(legacyIndexProviderLookup.all()).thenReturn(Iterables.empty());
    IndexConfigStore indexConfigStore = new IndexConfigStore(storeDirectory, fs);
    JobScheduler scheduler = life.add(new Neo4jJobScheduler());
    Config config = Config.defaults();
    Supplier<KernelTransactionsSnapshot> txSnapshotSupplier = () -> new KernelTransactionsSnapshot(Collections.emptySet(), 0);
    return life.add(new ExtendedRecordStorageEngine(storeDirectory, config, idGeneratorFactory, IdReuseEligibility.ALWAYS, new CommunityIdTypeConfigurationProvider(), pageCache, fs, NullLogProvider.getInstance(), mock(PropertyKeyTokenHolder.class), mock(LabelTokenHolder.class), mock(RelationshipTypeTokenHolder.class), () -> {
    }, new StandardConstraintSemantics(), scheduler, mock(TokenNameLookup.class), new ReentrantLockService(), schemaIndexProvider, IndexingService.NO_MONITOR, databaseHealth, labelScanStoreProvider, legacyIndexProviderLookup, indexConfigStore, new SynchronizedArrayIdOrderingQueue(20), txSnapshotSupplier, transactionApplierTransformer));
}
Also used : JobScheduler(org.neo4j.kernel.impl.util.JobScheduler) Neo4jJobScheduler(org.neo4j.kernel.impl.util.Neo4jJobScheduler) LabelScanStoreProvider(org.neo4j.kernel.impl.api.scan.LabelScanStoreProvider) NeoStoreDataSourceRule.nativeLabelScanStoreProvider(org.neo4j.test.rule.NeoStoreDataSourceRule.nativeLabelScanStoreProvider) LegacyIndexProviderLookup(org.neo4j.kernel.impl.api.LegacyIndexProviderLookup) Config(org.neo4j.kernel.configuration.Config) IndexConfigStore(org.neo4j.kernel.impl.index.IndexConfigStore) IdGeneratorFactory(org.neo4j.kernel.impl.store.id.IdGeneratorFactory) IdGeneratorFactory(org.neo4j.kernel.impl.store.id.IdGeneratorFactory) KernelTransactionsSnapshot(org.neo4j.kernel.impl.api.KernelTransactionsSnapshot) Neo4jJobScheduler(org.neo4j.kernel.impl.util.Neo4jJobScheduler) CommunityIdTypeConfigurationProvider(org.neo4j.kernel.impl.store.id.configuration.CommunityIdTypeConfigurationProvider) SynchronizedArrayIdOrderingQueue(org.neo4j.kernel.impl.util.SynchronizedArrayIdOrderingQueue) ReentrantLockService(org.neo4j.kernel.impl.locking.ReentrantLockService) StandardConstraintSemantics(org.neo4j.kernel.impl.constraints.StandardConstraintSemantics)

Aggregations

CommunityIdTypeConfigurationProvider (org.neo4j.kernel.impl.store.id.configuration.CommunityIdTypeConfigurationProvider)6 File (java.io.File)4 Test (org.junit.Test)4 Config (org.neo4j.kernel.configuration.Config)3 IdGeneratorFactory (org.neo4j.kernel.impl.store.id.IdGeneratorFactory)2 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 Iterator (java.util.Iterator)1 List (java.util.List)1 Map (java.util.Map)1 Set (java.util.Set)1 Function (java.util.function.Function)1 Collectors.toSet (java.util.stream.Collectors.toSet)1 Stream (java.util.stream.Stream)1 Nonnull (javax.annotation.Nonnull)1 Matchers.hasItems (org.hamcrest.Matchers.hasItems)1 Matchers.not (org.hamcrest.Matchers.not)1 Assert.assertEquals (org.junit.Assert.assertEquals)1 Assert.assertFalse (org.junit.Assert.assertFalse)1