use of org.neo4j.internal.id.DefaultIdGeneratorFactory in project neo4j by neo4j.
the class RecordPropertyCursorTest method setup.
@BeforeEach
void setup() {
idGeneratorFactory = new DefaultIdGeneratorFactory(fs, immediate(), databaseLayout.getDatabaseName());
neoStores = new StoreFactory(databaseLayout, Config.defaults(), idGeneratorFactory, pageCache, fs, getRecordFormats(), NullLogProvider.getInstance(), PageCacheTracer.NULL, writable(), Sets.immutable.empty()).openAllNeoStores(true);
creator = new PropertyCreator(neoStores.getPropertyStore(), new PropertyTraverser(NULL), NULL, INSTANCE);
owner = neoStores.getNodeStore().newRecord();
}
use of org.neo4j.internal.id.DefaultIdGeneratorFactory in project neo4j by neo4j.
the class PropertyPhysicalToLogicalConverterTest method before.
@BeforeEach
void before() {
StoreFactory storeFactory = new StoreFactory(databaseLayout, Config.defaults(), new DefaultIdGeneratorFactory(fs, immediate(), databaseLayout.getDatabaseName()), pageCache, fs, NullLogProvider.getInstance(), PageCacheTracer.NULL, writable());
neoStores = storeFactory.openAllNeoStores(true);
store = neoStores.getPropertyStore();
converter = new PropertyPhysicalToLogicalConverter(store, NULL);
}
use of org.neo4j.internal.id.DefaultIdGeneratorFactory in project neo4j by neo4j.
the class ManyPropertyKeysIT method databaseWithManyPropertyKeys.
private GraphDatabaseAPI databaseWithManyPropertyKeys(int propertyKeyCount) throws IOException {
var cacheTracer = PageCacheTracer.NULL;
var cursorContext = new CursorContext(cacheTracer.createPageCursorTracer("databaseWithManyPropertyKeys"));
StoreFactory storeFactory = new StoreFactory(databaseLayout, Config.defaults(), new DefaultIdGeneratorFactory(fileSystem, immediate(), databaseLayout.getDatabaseName()), pageCache, fileSystem, NullLogProvider.getInstance(), cacheTracer, writable());
NeoStores neoStores = storeFactory.openAllNeoStores(true);
PropertyKeyTokenStore store = neoStores.getPropertyKeyTokenStore();
for (int i = 0; i < propertyKeyCount; i++) {
PropertyKeyTokenRecord record = new PropertyKeyTokenRecord((int) store.nextId(cursorContext));
record.setInUse(true);
Collection<DynamicRecord> nameRecords = store.allocateNameRecords(PropertyStore.encodeString(key(i)), cursorContext, INSTANCE);
record.addNameRecords(nameRecords);
record.setNameId((int) Iterables.first(nameRecords).getId());
store.updateRecord(record, NULL);
}
neoStores.flush(cursorContext);
neoStores.close();
return database();
}
use of org.neo4j.internal.id.DefaultIdGeneratorFactory in project neo4j by neo4j.
the class RecordStorageEngineFactory method transactionMetaDataStore.
@Override
public MetadataProvider transactionMetaDataStore(FileSystemAbstraction fs, DatabaseLayout databaseLayout, Config config, PageCache pageCache, PageCacheTracer cacheTracer) {
RecordFormats recordFormats = selectForStoreOrConfig(Config.defaults(), databaseLayout, fs, pageCache, NullLogProvider.getInstance(), cacheTracer);
var readOnlyChecker = new DatabaseReadOnlyChecker.Default(new DbmsReadOnlyChecker.Default(config), databaseLayout.getDatabaseName());
var idGeneratorFactory = readOnlyChecker.isReadOnly() ? new ScanOnOpenReadOnlyIdGeneratorFactory() : new DefaultIdGeneratorFactory(fs, immediate(), databaseLayout.getDatabaseName());
return new StoreFactory(databaseLayout, config, idGeneratorFactory, pageCache, fs, recordFormats, NullLogProvider.getInstance(), cacheTracer, readOnlyChecker, immutable.empty()).openNeoStores(META_DATA).getMetaDataStore();
}
use of org.neo4j.internal.id.DefaultIdGeneratorFactory in project neo4j by neo4j.
the class RecordStorageEngineFactory method schemaRuleMigrationAccess.
@Override
public SchemaRuleMigrationAccess schemaRuleMigrationAccess(FileSystemAbstraction fs, PageCache pageCache, Config config, DatabaseLayout databaseLayout, LogService logService, String recordFormats, PageCacheTracer cacheTracer, CursorContext cursorContext, MemoryTracker memoryTracker) {
RecordFormats formats = selectForVersion(recordFormats);
StoreFactory factory = new StoreFactory(databaseLayout, config, new DefaultIdGeneratorFactory(fs, immediate(), databaseLayout.getDatabaseName()), pageCache, fs, formats, logService.getInternalLogProvider(), cacheTracer, writable(), immutable.empty());
NeoStores stores = factory.openNeoStores(true, StoreType.SCHEMA, StoreType.PROPERTY_KEY_TOKEN, StoreType.PROPERTY);
try {
stores.start(cursorContext);
} catch (IOException e) {
throw new UncheckedIOException(e);
}
return createMigrationTargetSchemaRuleAccess(stores, cursorContext, memoryTracker);
}
Aggregations