Exemplo n.º 1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private void maybeFlushToDisk() throws java.io.IOException
        private void MaybeFlushToDisk()
        {
            if ((_applierState.lastApplied - _lastFlushed) > _flushEvery)
            {
                _coreState.flush(_applierState.lastApplied);
                _lastFlushed = _applierState.lastApplied;
            }
        }
Exemplo n.º 2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public synchronized void installSnapshot(org.neo4j.causalclustering.core.state.snapshot.CoreSnapshot coreSnapshot) throws java.io.IOException
        public virtual void InstallSnapshot(CoreSnapshot coreSnapshot)
        {
            lock (this)
            {
                long snapshotPrevIndex = coreSnapshot.PrevIndex();
                _raftLog.skip(snapshotPrevIndex, coreSnapshot.PrevTerm());

                _coreState.installSnapshot(coreSnapshot);
                _raftMachine.installCoreState(coreSnapshot.Get(CoreStateType.RAFT_CORE_STATE));
                _coreState.flush(snapshotPrevIndex);

                _applicationProcess.installSnapshot(coreSnapshot);
                Monitor.PulseAll(this);
            }
        }