예제 #1
0
        public SequenceNumber WriteRestartArea(
            IList <ArraySegment <byte> > data,
            SequenceNumber newBaseSeqNum,
            ReservationCollection reservationCollection)
        {
            long totalRecordSize;
            LogReservationCollection lrc;

            this.store.ValidateSequenceNumber(
                ref newBaseSeqNum,
                SequenceNumberConstraint.Arbitrary,
                "newBaseSeqNum");

            totalRecordSize = ValidateData(data);
            lrc             = ValidateReservationCollection(reservationCollection);

            EnsureMarshalContext();

            LogWriteRestartAreaState state = new LogWriteRestartAreaState();

            state.RecordSequence        = this;
            state.Data                  = data;
            state.TotalRecordSize       = totalRecordSize;
            state.ReservationCollection = lrc;
            state.NewBaseLsn            = newBaseSeqNum.High;

            state.Start();

            return(new SequenceNumber(state.ResultLsn));
        }
 internal LogWriteRestartAreaAsyncResult(LogRecordSequence recordSequence,
                                         AsyncCallback callback,
                                         object state)
     : base(callback, state)
 {
     this.state = new LogWriteRestartAreaState();
     this.state.RecordSequence = recordSequence;
     this.state.AsyncResult    = this;
 }
 internal LogWriteRestartAreaAsyncResult(LogRecordSequence recordSequence,
                                         AsyncCallback callback,
                                         object state)
     : base(callback, state)
 {
     this.state = new LogWriteRestartAreaState();
     this.state.RecordSequence = recordSequence;
     this.state.AsyncResult = this;
 }