Beispiel #1
0
        public override RaftLogEntry Get(long logIndex)
        {
            lock (this)
            {
                if (!_enabled)
                {
                    return(null);
                }

                RaftLogEntry entry = _cache.get(logIndex);

                if (entry == null)
                {
                    _monitor.miss();
                }
                else
                {
                    _monitor.hit();
                }

                return(entry);
            }
        }
Beispiel #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testEmptyInvariants()
        public virtual void TestEmptyInvariants()
        {
            assertEquals(0, _cache.size());
            for (int i = 0; i < _capacity; i++)
            {
                assertNull(_cache.get(i));
            }
        }