//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Before public void setUp() throws Exception //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void SetUp() { _life = new LifeSupport(); PageCache pageCache = Storage.pageCache(); DatabaseLayout databaseLayout = Storage.directory().databaseLayout(); Config config = Config.defaults(GraphDatabaseSettings.default_schema_provider, EMPTY.ProviderDescriptor.name()); NullLogProvider nullLogProvider = NullLogProvider.Instance; StoreFactory storeFactory = new StoreFactory(databaseLayout, config, new DefaultIdGeneratorFactory(Storage.fileSystem()), pageCache, Storage.fileSystem(), nullLogProvider, EmptyVersionContextSupplier.EMPTY); _neoStores = storeFactory.OpenAllNeoStores(true); _neoStores.Counts.start(); CountsComputer.recomputeCounts(_neoStores, pageCache, databaseLayout); _nodeStore = _neoStores.NodeStore; _relationshipStore = _neoStores.RelationshipStore; PropertyStore propertyStore = _neoStores.PropertyStore; JobScheduler scheduler = JobSchedulerFactory.createScheduler(); Dependencies dependencies = new Dependencies(); dependencies.SatisfyDependency(EMPTY); DefaultIndexProviderMap providerMap = new DefaultIndexProviderMap(dependencies, config); _life.add(providerMap); _indexingService = IndexingServiceFactory.createIndexingService(config, scheduler, providerMap, new NeoStoreIndexStoreView(LockService.NO_LOCK_SERVICE, _neoStores), SchemaUtil.idTokenNameLookup, empty(), nullLogProvider, nullLogProvider, IndexingService.NO_MONITOR, new DatabaseSchemaState(nullLogProvider), false); _propertyPhysicalToLogicalConverter = new PropertyPhysicalToLogicalConverter(_neoStores.PropertyStore); _life.add(_indexingService); _life.add(scheduler); _life.init(); _life.start(); _propertyCreator = new PropertyCreator(_neoStores.PropertyStore, new PropertyTraverser()); _recordAccess = new DirectRecordAccess <PropertyRecord, PrimitiveRecord>(_neoStores.PropertyStore, Loaders.propertyLoader(propertyStore)); }
private void RebuildCounts(long lastCommittedTransactionId, ProgressReporter progressReporter) { CleanupCountsForRebuilding(); IdGeneratorFactory idGenFactory = new DefaultIdGeneratorFactory(_fs); StoreFactory storeFactory = new StoreFactory(_testDir.databaseLayout(), _config, idGenFactory, _pageCache, _fs, _logProvider, EmptyVersionContextSupplier.EMPTY); using (Lifespan life = new Lifespan(), NeoStores neoStores = storeFactory.OpenAllNeoStores()) { NodeStore nodeStore = neoStores.NodeStore; RelationshipStore relationshipStore = neoStores.RelationshipStore; int highLabelId = ( int )neoStores.LabelTokenStore.HighId; int highRelationshipTypeId = ( int )neoStores.RelationshipTypeTokenStore.HighId; CountsComputer countsComputer = new CountsComputer(lastCommittedTransactionId, nodeStore, relationshipStore, highLabelId, highRelationshipTypeId, [email protected]_Fields.AutoWithoutPagecache, progressReporter); CountsTracker countsTracker = CreateCountsTracker(); life.Add(countsTracker.setInitializer(countsComputer)); } }
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 ) ); } } }