public override void IncrementIndexUpdates(long indexId, long updatesDelta)
 {
     using (Org.Neo4j.Kernel.Impl.Api.CountsAccessor_IndexStatsUpdater updater = _counts.updateIndexCounts())
     {
         updater.IncrementIndexUpdates(indexId, updatesDelta);
     }
 }
Beispiel #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test @Resources.Life(STARTED) public void shouldRotateOnDataChangesEvenIfTransactionIsUnchanged() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldRotateOnDataChangesEvenIfTransactionIsUnchanged()
        {
            // given
            CountsTracker tracker = ResourceManager.managed(NewTracker());
            File          before  = tracker.CurrentFile();

            using (Org.Neo4j.Kernel.Impl.Api.CountsAccessor_IndexStatsUpdater updater = tracker.UpdateIndexCounts())
            {
                updater.IncrementIndexUpdates(7, 100);
            }

            // when
            tracker.Rotate(tracker.TxId());

            // then
            assertNotEquals("rotated", before, tracker.CurrentFile());
        }
Beispiel #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test @Resources.Life(STARTED) public void shouldBeAbleToWriteDataToCountsTracker() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldBeAbleToWriteDataToCountsTracker()
        {
            // given
            CountsTracker tracker = ResourceManager.managed(NewTracker());
            long          indexId = 0;
            CountsOracle  oracle  = new CountsOracle();

            {
                CountsOracle.Node a = oracle.Node(1);
                CountsOracle.Node b = oracle.Node(1);
                oracle.Relationship(a, 1, b);
                oracle.IndexSampling(indexId, 2, 2);
                oracle.IndexUpdatesAndSize(indexId, 10, 2);
            }

            // when
            oracle.Update(tracker, 2);

            // then
            oracle.Verify(tracker);

            // when
            tracker.Rotate(2);

            // then
            oracle.Verify(tracker);

            // when
            using (Org.Neo4j.Kernel.Impl.Api.CountsAccessor_IndexStatsUpdater updater = tracker.UpdateIndexCounts())
            {
                updater.IncrementIndexUpdates(indexId, 2);
            }

            // then
            oracle.IndexUpdatesAndSize(indexId, 12, 2);
            oracle.Verify(tracker);

            // when
            tracker.Rotate(2);

            // then
            oracle.Verify(tracker);
        }