use of org.neo4j.internal.id.DefaultIdGeneratorFactory in project neo4j by neo4j.
the class SchemaStorageReadAndWriteTest method before.
@BeforeAll
void before() throws Exception {
testDirectory.prepareDirectory(getClass(), "test");
var storeFactory = new StoreFactory(databaseLayout, Config.defaults(), new DefaultIdGeneratorFactory(fs, immediate(), databaseLayout.getDatabaseName()), pageCache, fs, NullLogProvider.getInstance(), PageCacheTracer.NULL, writable());
neoStores = storeFactory.openNeoStores(true, StoreType.SCHEMA, StoreType.PROPERTY_KEY_TOKEN, StoreType.LABEL_TOKEN, StoreType.RELATIONSHIP_TYPE_TOKEN);
AtomicInteger tokenIdCounter = new AtomicInteger();
TokenCreator tokenCreator = (name, internal) -> tokenIdCounter.incrementAndGet();
TokenHolders tokens = new TokenHolders(new DelegatingTokenHolder(tokenCreator, TokenHolder.TYPE_PROPERTY_KEY), new DelegatingTokenHolder(tokenCreator, TokenHolder.TYPE_LABEL), new DelegatingTokenHolder(tokenCreator, TokenHolder.TYPE_RELATIONSHIP_TYPE));
tokens.setInitialTokens(StoreTokens.allTokens(neoStores), NULL);
tokenIdCounter.set(Math.max(tokenIdCounter.get(), tokens.propertyKeyTokens().size()));
tokenIdCounter.set(Math.max(tokenIdCounter.get(), tokens.labelTokens().size()));
tokenIdCounter.set(Math.max(tokenIdCounter.get(), tokens.relationshipTypeTokens().size()));
storage = new SchemaStorage(neoStores.getSchemaStore(), tokens, () -> KernelVersion.LATEST);
}
use of org.neo4j.internal.id.DefaultIdGeneratorFactory in project neo4j by neo4j.
the class RecordNodeCursorIT method startNeoStores.
@BeforeEach
void startNeoStores() {
neoStores = new StoreFactory(DatabaseLayout.ofFlat(directory.homePath()), Config.defaults(), new DefaultIdGeneratorFactory(directory.getFileSystem(), immediate(), "db"), pageCache, directory.getFileSystem(), NullLogProvider.nullLogProvider(), PageCacheTracer.NULL, DatabaseReadOnlyChecker.writable()).openAllNeoStores(true);
nodeStore = neoStores.getNodeStore();
}
use of org.neo4j.internal.id.DefaultIdGeneratorFactory in project neo4j by neo4j.
the class RecordRelationshipTraversalCursorTest method setupStores.
@BeforeEach
void setupStores() {
DefaultIdGeneratorFactory idGeneratorFactory = new DefaultIdGeneratorFactory(fs, immediate(), databaseLayout.getDatabaseName());
StoreFactory storeFactory = new StoreFactory(databaseLayout, Config.defaults(), idGeneratorFactory, pageCache, fs, getRecordFormats(), NullLogProvider.getInstance(), PageCacheTracer.NULL, writable(), Sets.immutable.empty());
neoStores = storeFactory.openAllNeoStores(true);
}
Aggregations