Exemple #1
0
        public void MarkSnapshot(
            long snapshotTypeId,
            long logPosition,
            long leadershipTermId,
            int snapshotIndex,
            SnapshotMark snapshotMark,
            ClusterTimeUnit timeUnit,
            int appVersion)
        {
            idleStrategy.Reset();
            while (true)
            {
                long result = publication.TryClaim(ENCODED_MARKER_LENGTH, bufferClaim);
                if (result > 0)
                {
                    snapshotMarkerEncoder
                    .WrapAndApplyHeader(bufferClaim.Buffer, bufferClaim.Offset, messageHeaderEncoder)
                    .TypeId(snapshotTypeId)
                    .LogPosition(logPosition)
                    .LeadershipTermId(leadershipTermId)
                    .Index(snapshotIndex)
                    .Mark(snapshotMark)
                    .TimeUnit(timeUnit)
                    .AppVersion(appVersion);

                    bufferClaim.Commit();
                    break;
                }

                CheckResultAndIdle(result);
            }
        }
 public SnapshotMarkerEncoder Mark(SnapshotMark value)
 {
     _buffer.PutInt(_offset + 28, (int)value, ByteOrder.LittleEndian);
     return(this);
 }