Ejemplo n.º 1
0
            public int Encode(IMutableDirectBuffer buffer, int offset)
            {
                encoder
                .Wrap(buffer, offset)
                .LastLeadershipTermId(lastLeadershipTermId)
                .LastTermBaseLogPosition(lastTermBaseLogPosition)
                .LastTermPositionCommitted(lastTermPositionCommitted)
                .LastTermPositionAppended(lastTermPositionAppended);

                int stepsCount = termSteps.Count + (null != snapshotStep ? 1 : 0);

                RecoveryPlanEncoder.StepsEncoder stepEncoder = encoder.StepsCount(stepsCount);

                if (null != snapshotStep)
                {
                    stepEncoder.Next();
                    snapshotStep.Encode(stepEncoder);
                }

                for (int i = 0, size = termSteps.Count; i < size; i++)
                {
                    stepEncoder.Next();
                    termSteps[i].Encode(stepEncoder);
                }

                return(encoder.EncodedLength());
            }
Ejemplo n.º 2
0
 public void Encode(RecoveryPlanEncoder.StepsEncoder encoder)
 {
     encoder
     .RecordingStartPosition(recordingStartPosition)
     .RecordingStopPosition(recordingStopPosition)
     .RecordingSessionId(recordingSessionId);
     entry.Encode(encoder);
 }
Ejemplo n.º 3
0
 public void Encode(RecoveryPlanEncoder.StepsEncoder encoder)
 {
     encoder
     .RecordingId(recordingId)
     .LeadershipTermId(leadershipTermId)
     .TermBaseLogPosition(termBaseLogPosition)
     .TermPosition(termPosition)
     .Timestamp(timestamp)
     .VotedForMemberId(votedForMemberId)
     .EntryType(type)
     .EntryIndex(entryIndex);
 }