private void CreateStore(DatabaseLayout migrationDirectoryStructure, RecordFormats newFormat) { IdGeneratorFactory idGeneratorFactory = new ReadOnlyIdGeneratorFactory(_fileSystem); NullLogProvider logProvider = NullLogProvider.Instance; StoreFactory storeFactory = new StoreFactory(migrationDirectoryStructure, _config, idGeneratorFactory, _pageCache, _fileSystem, newFormat, logProvider, EmptyVersionContextSupplier.EMPTY); using (NeoStores neoStores = storeFactory.OpenAllNeoStores(true)) { neoStores.MetaDataStore; neoStores.LabelTokenStore; neoStores.NodeStore; neoStores.PropertyStore; neoStores.RelationshipGroupStore; neoStores.RelationshipStore; neoStores.SchemaStore; } }
private void RebuildCountsFromScratch( DatabaseLayout sourceStructure, DatabaseLayout migrationStructure, long lastTxId, ProgressReporter progressMonitor, string expectedStoreVersion, PageCache pageCache, LogProvider logProvider ) { RecordFormats recordFormats = selectForVersion( expectedStoreVersion ); IdGeneratorFactory idGeneratorFactory = new ReadOnlyIdGeneratorFactory( _fileSystem ); StoreFactory storeFactory = new StoreFactory( sourceStructure, _config, idGeneratorFactory, pageCache, _fileSystem, recordFormats, logProvider, EmptyVersionContextSupplier.EMPTY ); using ( NeoStores neoStores = storeFactory.OpenNeoStores( StoreType.NODE, StoreType.RELATIONSHIP, StoreType.LABEL_TOKEN, StoreType.RELATIONSHIP_TYPE_TOKEN ) ) { neoStores.VerifyStoreOk(); NodeStore nodeStore = neoStores.NodeStore; RelationshipStore relationshipStore = neoStores.RelationshipStore; using ( Lifespan life = new Lifespan() ) { int highLabelId = ( int ) neoStores.LabelTokenStore.HighId; int highRelationshipTypeId = ( int ) neoStores.RelationshipTypeTokenStore.HighId; CountsComputer initializer = new CountsComputer( lastTxId, nodeStore, relationshipStore, highLabelId, highRelationshipTypeId, NumberArrayFactory.auto( pageCache, migrationStructure.DatabaseDirectory(), true, [email protected]_Fields.NoMonitor ), progressMonitor ); life.Add( ( new CountsTracker( logProvider, _fileSystem, pageCache, _config, migrationStructure, EmptyVersionContextSupplier.EMPTY ) ).setInitializer( initializer ) ); } } }