示例#1
0
        private static CountsOracle SomeData()
        {
            CountsOracle oracle = new CountsOracle();

            CountsOracle.Node n0 = oracle.Node(0, 1);
            CountsOracle.Node n1 = oracle.Node(0, 3);
            CountsOracle.Node n2 = oracle.Node(2, 3);
            CountsOracle.Node n3 = oracle.Node(2);
            oracle.Relationship(n0, 1, n2);
            oracle.Relationship(n1, 1, n3);
            oracle.Relationship(n1, 1, n2);
            oracle.Relationship(n0, 1, n3);
            long indexId = 2;

            oracle.IndexUpdatesAndSize(indexId, 0L, 50L);
            oracle.IndexSampling(indexId, 25L, 50L);
            return(oracle);
        }
示例#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 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);
        }