Ejemplo n.º 1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void applyTo(org.neo4j.causalclustering.core.consensus.log.RaftLog raftLog, org.neo4j.logging.Log log) throws java.io.IOException
        public override void ApplyTo(RaftLog raftLog, Log log)
        {
            if (Index <= raftLog.AppendIndex())
            {
                throw new System.InvalidOperationException("Attempted to append over an existing entry at index " + Index);
            }
            raftLog.Append(Entry);
        }
Ejemplo n.º 2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void applyTo(org.neo4j.causalclustering.core.consensus.log.RaftLog raftLog, org.neo4j.logging.Log log) throws java.io.IOException
        public override void ApplyTo(RaftLog raftLog, Log log)
        {
            long lastIndex = BaseIndex + Offset;

            if (lastIndex <= raftLog.AppendIndex())
            {
                throw new System.InvalidOperationException("Attempted to append over an existing entry starting at index " + lastIndex);
            }

            raftLog.Append(Arrays.copyOfRange(Entries, Offset, Entries.Length));
        }