Пример #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldDeleteIdGeneratorsWhenOpeningExistingStore() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldDeleteIdGeneratorsWhenOpeningExistingStore()
        {
            // given
            long expectedHighId;

            using (BatchingNeoStores stores = BatchingNeoStores.BatchingNeoStoresWithExternalPageCache(Storage.fileSystem(), Storage.pageCache(), PageCacheTracer.NULL, Storage.directory().absolutePath(), LATEST_RECORD_FORMATS, DEFAULT, NullLogService.Instance, EMPTY, Config.defaults()))
            {
                stores.CreateNew();
                RelationshipStore  relationshipStore = stores.RelationshipStore;
                RelationshipRecord record            = relationshipStore.NewRecord();
                long no = NULL_REFERENCE.longValue();
                record.Initialize(true, no, 1, 2, 0, no, no, no, no, true, true);
                record.Id      = relationshipStore.NextId();
                expectedHighId = relationshipStore.HighId;
                relationshipStore.UpdateRecord(record);
                // fiddle with the highId
                relationshipStore.HighId = record.Id + 999;
            }

            // when
            using (BatchingNeoStores stores = BatchingNeoStores.BatchingNeoStoresWithExternalPageCache(Storage.fileSystem(), Storage.pageCache(), PageCacheTracer.NULL, Storage.directory().absolutePath(), LATEST_RECORD_FORMATS, DEFAULT, NullLogService.Instance, EMPTY, Config.defaults()))
            {
                stores.PruneAndOpenExistingStore(Predicates.alwaysTrue(), Predicates.alwaysTrue());

                // then
                assertEquals(expectedHighId, stores.RelationshipStore.HighId);
            }
        }
Пример #2
0
 public CountsComputer(long lastCommittedTransactionId, NodeStore nodes, RelationshipStore relationships, int highLabelId, int highRelationshipTypeId, NumberArrayFactory numberArrayFactory, ProgressReporter progressMonitor)
 {
     this._lastCommittedTransactionId = lastCommittedTransactionId;
     this._nodes                  = nodes;
     this._relationships          = relationships;
     this._highLabelId            = highLabelId;
     this._highRelationshipTypeId = highRelationshipTypeId;
     this._numberArrayFactory     = numberArrayFactory;
     this._progressMonitor        = progressMonitor;
 }
Пример #3
0
 private CountsComputer(long lastCommittedTransactionId, NodeStore nodes, RelationshipStore relationships, int highLabelId, int highRelationshipTypeId, NumberArrayFactory numberArrayFactory) : this(lastCommittedTransactionId, nodes, relationships, highLabelId, highRelationshipTypeId, numberArrayFactory, SilentProgressReporter.INSTANCE)
 {
 }
Пример #4
0
 public StoreScanAsInputIteratorAnonymousInnerClass(Org.Neo4j.Kernel.impl.store.RelationshipStore getRelationshipStore, NeoStores legacyStore, bool requiresPropertyMigration) : base(getRelationshipStore)
 {
     this._legacyStore = legacyStore;
     this._requiresPropertyMigration = requiresPropertyMigration;
 }