Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

IRecordSequence Interface

Provides a generic interface to a sequence of records.

Namespace:  System.IO.Log
Assembly:  System.IO.Log (in System.IO.Log.dll)
public interface IRecordSequence : IDisposable

The IRecordSequence type exposes the following members.

  NameDescription
Public propertyBaseSequenceNumberWhen overridden in a derived class, gets the sequence number of the first valid record in the current IRecordSequence.
Public propertyLastSequenceNumberWhen overridden in a derived class, gets the sequence number which is greater than the last record appended.
Public propertyMaximumRecordLengthWhen overridden in a derived class, gets the size of the largest record that can be appended to or read from this sequence, in bytes.
Public propertyReservedBytesWhen overridden in a derived class, gets the total number of bytes that have been reserved.
Public propertyRestartSequenceNumberWhen overridden in a derived class, gets the sequence number of the most recently written restart area.
Public propertyRetryAppendGets or sets a value indicating whether appends are automatically retried if the log is full.
Top
  NameDescription
Public methodAdvanceBaseSequenceNumberMoves the base sequence number of the log forward.
Public methodAppend(ArraySegment<Byte>, SequenceNumber, SequenceNumber, RecordAppendOptions)When overridden in a derived class, writes a log record to the IRecordSequence.
Public methodAppend(IList<ArraySegment<Byte>>, SequenceNumber, SequenceNumber, RecordAppendOptions)When overridden in a derived class, appends a log record to the IRecordSequence.
Public methodAppend(ArraySegment<Byte>, SequenceNumber, SequenceNumber, RecordAppendOptions, ReservationCollection)When overridden in a derived class, appends a log record to the IRecordSequence, using space previously reserved in the sequence.
Public methodAppend(IList<ArraySegment<Byte>>, SequenceNumber, SequenceNumber, RecordAppendOptions, ReservationCollection)When overridden in a derived class, appends a log record to the IRecordSequence, using space previously reserved in the sequence.
Public methodBeginAppend(ArraySegment<Byte>, SequenceNumber, SequenceNumber, RecordAppendOptions, AsyncCallback, Object)When overridden in a derived class, begins an asynchronous append operation.
Public methodBeginAppend(IList<ArraySegment<Byte>>, SequenceNumber, SequenceNumber, RecordAppendOptions, AsyncCallback, Object)When overridden in a derived class, begins an asynchronous append operation, using space previously reserved in the sequence.
Public methodBeginAppend(ArraySegment<Byte>, SequenceNumber, SequenceNumber, RecordAppendOptions, ReservationCollection, AsyncCallback, Object)When overridden in a derived class, begins an asynchronous append operation using space previously reserved in the sequence.
Public methodBeginAppend(IList<ArraySegment<Byte>>, SequenceNumber, SequenceNumber, RecordAppendOptions, ReservationCollection, AsyncCallback, Object)When overridden in a derived class, begins an asynchronous append operation, using space previously reserved in the sequence.
Public methodBeginFlushWhen overridden in a derived class, begins an asynchronous flush operation, using space previously reserved in the sequence.
Public methodBeginReserveAndAppend(ArraySegment<Byte>, SequenceNumber, SequenceNumber, RecordAppendOptions, ReservationCollection, Int64[], AsyncCallback, Object)When overridden in a derived class, begins an asynchronous reserve and append operation.
Public methodBeginReserveAndAppend(IList<ArraySegment<Byte>>, SequenceNumber, SequenceNumber, RecordAppendOptions, ReservationCollection, Int64[], AsyncCallback, Object)When overridden in a derived class, begins an asynchronous reserve and append operation.
Public methodBeginWriteRestartArea(ArraySegment<Byte>, SequenceNumber, ReservationCollection, AsyncCallback, Object)When overridden in a derived class, begins an asynchronous restart area write operation, using space previously reserved in the sequence.
Public methodBeginWriteRestartArea(IList<ArraySegment<Byte>>, SequenceNumber, ReservationCollection, AsyncCallback, Object)When overridden in a derived class, begins an asynchronous restart area write operation, using space previously reserved in the sequence.
Public methodCreateReservationCollectionWhen overridden in a derived class, creates a new ReservationCollection.
Public methodDisposePerforms application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. (Inherited from IDisposable.)
Public methodEndAppendWhen overridden in a derived class, ends an asynchronous append operation.
Public methodEndFlushWhen overridden in a derived class, ends an asynchronous flush operation.
Public methodEndReserveAndAppendWhen overridden in a derived class, ends an asynchronous reserve and append operation.
Public methodEndWriteRestartAreaWhen overridden in a derived class, ends an asynchronous restart area write operation.
Public methodFlush()When overridden in a derived class, ensures that all appended records have been written.
Public methodFlush(SequenceNumber)When overridden in a derived class, ensures that all appended records up to and including the record with the specified sequence number have been durably written.
Public methodReadLogRecordsWhen overridden in a derived class, returns an enumerable collection of records in the sequence.
Public methodReadRestartAreasWhen overridden in a derived class, returns an enumerable collection of the restart areas in the sequence.
Public methodReserveAndAppend(ArraySegment<Byte>, SequenceNumber, SequenceNumber, RecordAppendOptions, ReservationCollection, Int64[])When overridden in a derived class, automatically makes a single reservation and appends a record to the sequence.
Public methodReserveAndAppend(IList<ArraySegment<Byte>>, SequenceNumber, SequenceNumber, RecordAppendOptions, ReservationCollection, Int64[])When overridden in a derived class, automatically makes a single reservation and appends a record to the sequence.
Public methodWriteRestartArea(ArraySegment<Byte>)When overridden in a derived class, writes a restart area to the IRecordSequence.
Public methodWriteRestartArea(IList<ArraySegment<Byte>>)When overridden in a derived class, writes a restart area to the IRecordSequence.
Public methodWriteRestartArea(ArraySegment<Byte>, SequenceNumber)When overridden in a derived class, writes a restart area to the IRecordSequence and updates the base sequence number
Public methodWriteRestartArea(IList<ArraySegment<Byte>>, SequenceNumber)When overridden in a derived class, writes a restart area to the IRecordSequence and updates the base sequence number.
Public methodWriteRestartArea(ArraySegment<Byte>, SequenceNumber, ReservationCollection)When overridden in a derived class, writes a restart area to the IRecordSequence using a reservation, and updates the base sequence number
Public methodWriteRestartArea(IList<ArraySegment<Byte>>, SequenceNumber, ReservationCollection)When overridden in a derived class, writes a restart area to the IRecordSequence using a reservation, and updates the base sequence number.
Top
  NameDescription
Public eventTailPinnedOccurs when the record sequence determines that the tail must be moved forward.
Top

The IRecordSequence interface provides an abstract interface to a record-oriented stream. A IRecordSequence instance can be used to read and write log records.

The IRecordSequence interface provides the following capabilities,

  • Append log records using the Append methods.

  • Read the appended records using the ReadLogRecords method.

  • Write a special restart record using the WriteRestartArea method.

  • Read restart records from the most recently written restart record using the ReadRestartAreas method.

  • Flush the records to durable store using the Flush method.

  • Reserve space for appending records.

  • Free log space by advancing the base of the log.

  • Receive TailPinned event notifications to move the base of the log to free space.

Log records are appended to a IRecordSequence instance, and each log record is given a unique sequence number. Sequence numbers are strictly monotonically increasing within a given record sequence. A log record consists of opaque data, supplied to the IRecordSequence instance in an IList of ArraySegments of bytes.

The IRecordSequence interface also exposes a few basic properties which provides information about log boundaries.

  • The BaseSequenceNumber property contains the sequence number of the first valid record in the record sequence.

  • The LastSequenceNumber property contains a sequence number that is guaranteed to be larger than the sequence number of the last appended record.

  • The RestartSequenceNumber property contains the sequence number of the last written restart area.

  • The MaximumRecordLength property contains the size of the largest record that can be appended to, or read from the sequence.

  • The ReservedBytes property contains the total size of all reservations made in this record sequence.

  • If the RetryAppend property is set to true, and an Append operation fails because there is no space in the sequence, the record sequence will attempt to free space, and retry the Append operation.

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.