コード例 #1
0
        public NodeDegreeCountStage(Configuration config, RelationshipStore store, NodeRelationshipCache cache, StatsProvider memoryUsageStatsProvider) : base(NAME, null, config, RECYCLE_BATCHES)
        {
            Add(new BatchFeedStep(Control(), config, forwards(0, store.HighId, config), store.RecordSize));
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: add(new org.neo4j.unsafe.impl.batchimport.staging.ReadRecordsStep<>(control(), config, false, store));
            Add(new ReadRecordsStep <object>(Control(), config, false, store));
            Add(new CalculateDenseNodesStep(Control(), config, cache, memoryUsageStatsProvider));
        }
コード例 #2
0
        public RelationshipCountsStage(Configuration config, NodeLabelsCache cache, RelationshipStore relationshipStore, int highLabelId, int highRelationshipTypeId, Org.Neo4j.Kernel.Impl.Api.CountsAccessor_Updater countsUpdater, NumberArrayFactory cacheFactory, ProgressReporter progressReporter) : base(NAME, null, config, RECYCLE_BATCHES)
        {
            Add(new BatchFeedStep(Control(), config, allIn(relationshipStore, config), relationshipStore.RecordSize));
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: add(new org.neo4j.unsafe.impl.batchimport.staging.ReadRecordsStep<>(control(), config, false, relationshipStore));
            Add(new ReadRecordsStep <object>(Control(), config, false, relationshipStore));
            Add(new ProcessRelationshipCountsDataStep(Control(), cache, config, highLabelId, highRelationshipTypeId, countsUpdater, cacheFactory, progressReporter));
        }
コード例 #3
0
        public RelationshipLinkforwardStage(string topic, Configuration config, BatchingNeoStores stores, NodeRelationshipCache cache, System.Predicate <RelationshipRecord> readFilter, System.Predicate <RelationshipRecord> denseChangeFilter, int nodeTypes, params StatsProvider[] additionalStatsProvider) : base(NAME, topic, config, ORDER_SEND_DOWNSTREAM | RECYCLE_BATCHES)
        {
            RelationshipStore store = stores.RelationshipStore;

            Add(new BatchFeedStep(Control(), config, forwards(0, store.HighId, config), store.RecordSize));
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: add(new org.neo4j.unsafe.impl.batchimport.staging.ReadRecordsStep<>(control(), config, true, store, new org.neo4j.unsafe.impl.batchimport.staging.RecordDataAssembler<>(store::newRecord, readFilter)));
            Add(new ReadRecordsStep <object>(Control(), config, true, store, new RecordDataAssembler <object>(store.newRecord, readFilter)));
            Add(new RelationshipLinkforwardStep(Control(), config, cache, denseChangeFilter, nodeTypes, additionalStatsProvider));
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: add(new UpdateRecordsStep<>(control(), config, store, org.neo4j.unsafe.impl.batchimport.store.PrepareIdSequence.of(stores.usesDoubleRelationshipRecordUnits())));
            Add(new UpdateRecordsStep <object>(Control(), config, store, PrepareIdSequence.of(stores.UsesDoubleRelationshipRecordUnits())));
        }
コード例 #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void relationshipScanCursorShouldClosePageCursor()
        internal virtual void RelationshipScanCursorShouldClosePageCursor()
        {
            RelationshipStore store      = mock(typeof(RelationshipStore));
            PageCursor        pageCursor = mock(typeof(PageCursor));

            when(store.OpenPageCursorForReading(anyLong())).thenReturn(pageCursor);

            using (RecordRelationshipScanCursor cursor = new RecordRelationshipScanCursor(store))
            {
                cursor.Single(0);
            }
            verify(pageCursor).close();
        }
コード例 #5
0
 protected internal RelationshipImporter(BatchingNeoStores stores, IdMapper idMapper, DataStatistics typeDistribution, Monitor monitor, Collector badCollector, bool validateRelationshipData, bool doubleRecordUnits) : base(stores, monitor)
 {
     this._doubleRecordUnits = doubleRecordUnits;
     this._relationshipTypeTokenRepository = stores.RelationshipTypeRepository;
     this._idMapper                 = idMapper;
     this._badCollector             = badCollector;
     this._validateRelationshipData = validateRelationshipData;
     this._relationshipStore        = stores.RelationshipStore;
     this._relationshipRecord       = _relationshipStore.newRecord();
     this._relationshipIds          = new BatchingIdGetter(_relationshipStore);
     this._typeCounts               = typeDistribution.NewClient();
     this._prepareIdSequence        = PrepareIdSequence.of(doubleRecordUnits).apply(stores.RelationshipStore);
     _relationshipRecord.InUse      = true;
 }
コード例 #6
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void relationshipGroupCursorShouldClosePageCursor()
        internal virtual void RelationshipGroupCursorShouldClosePageCursor()
        {
            RelationshipStore relationshipStore      = mock(typeof(RelationshipStore));
            PageCursor        relationshipPageCursor = mock(typeof(PageCursor));

            when(relationshipStore.OpenPageCursorForReading(anyLong())).thenReturn(relationshipPageCursor);
            RelationshipGroupStore store      = mock(typeof(RelationshipGroupStore));
            PageCursor             pageCursor = mock(typeof(PageCursor));

            when(store.OpenPageCursorForReading(anyLong())).thenReturn(pageCursor);

            using (RecordRelationshipGroupCursor cursor = new RecordRelationshipGroupCursor(relationshipStore, store))
            {
                cursor.Init(0, 0);
            }
            verify(pageCursor).close();
            verifyZeroInteractions(relationshipStore, relationshipPageCursor);
        }
コード例 #7
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldClearStateOnClose()
        public virtual void ShouldClearStateOnClose()
        {
            // GIVEN
            NeoStores mockStore = mock(typeof(NeoStores));
            NodeStore store     = mock(typeof(NodeStore));

            when(mockStore.NodeStore).thenReturn(store);
            RelationshipStore relationshipStore = mock(typeof(RelationshipStore));

            when(mockStore.RelationshipStore).thenReturn(relationshipStore);
            PropertyStore propertyStore = mock(typeof(PropertyStore));

            when(mockStore.PropertyStore).thenReturn(propertyStore);
            SchemaStore schemaStore = mock(typeof(SchemaStore));

            when(mockStore.SchemaStore).thenReturn(schemaStore);
            RelationshipGroupStore groupStore = mock(typeof(RelationshipGroupStore));

            when(mockStore.RelationshipGroupStore).thenReturn(groupStore);

            RecordChangeSet changeSet = new RecordChangeSet(new Loaders(mockStore));

            // WHEN

            /*
             * We need to make sure some stuff is stored in the sets being managed. That is why forChangingLinkage() is
             * called - otherwise, no changes will be stored and changeSize() would return 0 anyway.
             */
            changeSet.NodeRecords.create(1L, null).forChangingLinkage();
            changeSet.PropertyRecords.create(1L, null).forChangingLinkage();
            changeSet.RelRecords.create(1L, null).forChangingLinkage();
            changeSet.SchemaRuleChanges.create(1L, null).forChangingLinkage();
            changeSet.RelGroupRecords.create(1L, 1).forChangingLinkage();

            changeSet.Close();

            // THEN
            assertEquals(0, changeSet.NodeRecords.changeSize());
            assertEquals(0, changeSet.PropertyRecords.changeSize());
            assertEquals(0, changeSet.RelRecords.changeSize());
            assertEquals(0, changeSet.SchemaRuleChanges.changeSize());
            assertEquals(0, changeSet.RelGroupRecords.changeSize());
        }
コード例 #8
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @SuppressWarnings({"unchecked", "rawtypes"}) public static org.neo4j.kernel.impl.store.NeoStores basicMockedNeoStores()
        public static NeoStores BasicMockedNeoStores()
        {
            NeoStores neoStores = mock(typeof(NeoStores));

            // NodeStore - DynamicLabelStore
            NodeStore nodeStore = mock(typeof(NodeStore));

            when(neoStores.NodeStore).thenReturn(nodeStore);

            // NodeStore - DynamicLabelStore
            DynamicArrayStore dynamicLabelStore = mock(typeof(DynamicArrayStore));

            when(nodeStore.DynamicLabelStore).thenReturn(dynamicLabelStore);

            // RelationshipStore
            RelationshipStore relationshipStore = mock(typeof(RelationshipStore));

            when(neoStores.RelationshipStore).thenReturn(relationshipStore);

            // RelationshipGroupStore
            RelationshipGroupStore relationshipGroupStore = mock(typeof(RelationshipGroupStore));

            when(neoStores.RelationshipGroupStore).thenReturn(relationshipGroupStore);

            // PropertyStore
            PropertyStore propertyStore = mock(typeof(PropertyStore));

            when(neoStores.PropertyStore).thenReturn(propertyStore);

            // PropertyStore -- DynamicStringStore
            DynamicStringStore propertyStringStore = mock(typeof(DynamicStringStore));

            when(propertyStore.StringStore).thenReturn(propertyStringStore);

            // PropertyStore -- DynamicArrayStore
            DynamicArrayStore propertyArrayStore = mock(typeof(DynamicArrayStore));

            when(propertyStore.ArrayStore).thenReturn(propertyArrayStore);

            return(neoStores);
        }
コード例 #9
0
 internal RecordRelationshipScanCursor(RelationshipStore relationshipStore) : base(relationshipStore)
 {
 }
コード例 #10
0
 private void RelationshipAdvance(RelationshipRecord record, PageCursor pageCursor)
 {
     // When scanning, we inspect RelationshipRecord.inUse(), so using RecordLoad.CHECK is fine
     RelationshipStore.nextRecordByCursor(record, RecordLoad.CHECK, pageCursor);
 }