IRecordSequence IRecordSequence IRecordSequence IRecordSequence Interface

定義

提供記錄順序的泛型介面。Provides a generic interface to a sequence of records.

public interface class IRecordSequence : IDisposable
public interface IRecordSequence : IDisposable
type IRecordSequence = interface
    interface IDisposable
Public Interface IRecordSequence
Implements IDisposable
衍生
實作

備註

IRecordSequence 介面會提供記錄導向資料流的抽象介面。The IRecordSequence interface provides an abstract interface to a record-oriented stream. IRecordSequence 執行個體可以用來讀取和寫入記錄檔記錄。A IRecordSequence instance can be used to read and write log records.

IRecordSequence 介面提供下列功能:The IRecordSequence interface provides the following capabilities,

  • 使用 Append 方法,附加記錄檔記錄。Append log records using the Append methods.

  • 使用 ReadLogRecords 方法,讀取附加的記錄。Read the appended records using the ReadLogRecords method.

  • 使用 WriteRestartArea 方法,寫入特殊的重新啟動記錄。Write a special restart record using the WriteRestartArea method.

  • 使用 ReadRestartAreas 方法,從最近寫入的重新啟動記錄中讀取重新啟動記錄。Read restart records from the most recently written restart record using the ReadRestartAreas method.

  • 使用 Flush 方法,將記錄清除至永久性存放區。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.

  • 接收 TailPinned 事件通知以移動記錄檔基底來釋放空間。Receive TailPinned event notifications to move the base of the log to free space.

記錄檔記錄會附加到 IRecordSequence 執行個體,而且每個記錄檔記錄會被賦予唯一的序號。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. 記錄檔記錄由不透明的資料組成,這些資料是提供給位元組 ArraySegments 之 IRecordSequence 中的 IList 執行個體。A log record consists of opaque data, supplied to the IRecordSequence instance in an IList of ArraySegments of bytes.

IRecordSequence 介面也會公開一些提供記錄界限相關資訊的基本屬性。The IRecordSequence interface also exposes a few basic properties which provides information about log boundaries.

  • BaseSequenceNumber 屬性包含記錄順序中第一個有效記錄的序號。The BaseSequenceNumber property contains the sequence number of the first valid record in the record sequence.

  • LastSequenceNumber 屬性包含保證大於上一個附加記錄之序號的序號。The LastSequenceNumber property contains a sequence number that is guaranteed to be larger than the sequence number of the last appended record.

  • RestartSequenceNumber 屬性包含最後一個寫入之重新啟動區域的序號。The RestartSequenceNumber property contains the sequence number of the last written restart area.

  • MaximumRecordLength 屬性包含可在順序中附加或讀取之最大記錄的大小。The MaximumRecordLength property contains the size of the largest record that can be appended to, or read from the sequence.

  • ReservedBytes 屬性包含在此記錄順序中建立之所有保留區的總大小。The ReservedBytes property contains the total size of all reservations made in this record sequence.

  • 如果 RetryAppend 屬性設為 true,且 Append 作業因為順序中沒有空間而失敗,則記錄順序會嘗試釋放空間,然後重試此「附加」作業。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.

屬性

BaseSequenceNumber BaseSequenceNumber BaseSequenceNumber BaseSequenceNumber

在衍生類別中覆寫時,取得目前 IRecordSequence 中第一個有效記錄的序號。When overridden in a derived class, gets the sequence number of the first valid record in the current IRecordSequence.

LastSequenceNumber LastSequenceNumber LastSequenceNumber LastSequenceNumber

在衍生類別中覆寫時,取得大於上一筆附加記錄的序號。When overridden in a derived class, gets the sequence number which is greater than the last record appended.

MaximumRecordLength MaximumRecordLength MaximumRecordLength MaximumRecordLength

在衍生類別中覆寫時,取得可在此順序中附加或讀取的最大記錄大小 (以位元組為單位)。When overridden in a derived class, gets the size of the largest record that can be appended to or read from this sequence, in bytes.

ReservedBytes ReservedBytes ReservedBytes ReservedBytes

在衍生類別中覆寫時,取得已保留的位元組總數。When overridden in a derived class, gets the total number of bytes that have been reserved.

RestartSequenceNumber RestartSequenceNumber RestartSequenceNumber RestartSequenceNumber

在衍生類別中覆寫時,取得最近寫入之重新啟動區域的序號。When overridden in a derived class, gets the sequence number of the most recently written restart area.

RetryAppend RetryAppend RetryAppend RetryAppend

取得或設定值,這個值表示是否在記錄檔已滿時自動重試附加作業。Gets or sets a value indicating whether appends are automatically retried if the log is full.

方法

AdvanceBaseSequenceNumber(SequenceNumber) AdvanceBaseSequenceNumber(SequenceNumber) AdvanceBaseSequenceNumber(SequenceNumber) AdvanceBaseSequenceNumber(SequenceNumber)

將記錄檔的基底序號往前移動。Moves the base sequence number of the log forward.

Append(ArraySegment<Byte>, SequenceNumber, SequenceNumber, RecordAppendOptions) Append(ArraySegment<Byte>, SequenceNumber, SequenceNumber, RecordAppendOptions) Append(ArraySegment<Byte>, SequenceNumber, SequenceNumber, RecordAppendOptions) Append(ArraySegment<Byte>, SequenceNumber, SequenceNumber, RecordAppendOptions)

在衍生類別中覆寫時,將記錄檔記錄寫入 IRecordSequenceWhen overridden in a derived class, writes a log record to the IRecordSequence.

Append(ArraySegment<Byte>, SequenceNumber, SequenceNumber, RecordAppendOptions, ReservationCollection) Append(ArraySegment<Byte>, SequenceNumber, SequenceNumber, RecordAppendOptions, ReservationCollection) Append(ArraySegment<Byte>, SequenceNumber, SequenceNumber, RecordAppendOptions, ReservationCollection) Append(ArraySegment<Byte>, SequenceNumber, SequenceNumber, RecordAppendOptions, ReservationCollection)

在衍生類別中覆寫時,使用之前在順序中保留的空間,將記錄檔記錄附加到 IRecordSequenceWhen overridden in a derived class, appends a log record to the IRecordSequence, using space previously reserved in the sequence.

Append(IList<ArraySegment<Byte>>, SequenceNumber, SequenceNumber, RecordAppendOptions) Append(IList<ArraySegment<Byte>>, SequenceNumber, SequenceNumber, RecordAppendOptions) Append(IList<ArraySegment<Byte>>, SequenceNumber, SequenceNumber, RecordAppendOptions) Append(IList<ArraySegment<Byte>>, SequenceNumber, SequenceNumber, RecordAppendOptions)

在衍生類別中覆寫時,將記錄檔記錄附加到 IRecordSequenceWhen overridden in a derived class, appends a log record to the IRecordSequence.

Append(IList<ArraySegment<Byte>>, SequenceNumber, SequenceNumber, RecordAppendOptions, ReservationCollection) Append(IList<ArraySegment<Byte>>, SequenceNumber, SequenceNumber, RecordAppendOptions, ReservationCollection) Append(IList<ArraySegment<Byte>>, SequenceNumber, SequenceNumber, RecordAppendOptions, ReservationCollection) Append(IList<ArraySegment<Byte>>, SequenceNumber, SequenceNumber, RecordAppendOptions, ReservationCollection)

在衍生類別中覆寫時,使用之前在順序中保留的空間,將記錄檔記錄附加到 IRecordSequenceWhen overridden in a derived class, appends a log record to the IRecordSequence, using space previously reserved in the sequence.

BeginAppend(ArraySegment<Byte>, SequenceNumber, SequenceNumber, RecordAppendOptions, AsyncCallback, Object) BeginAppend(ArraySegment<Byte>, SequenceNumber, SequenceNumber, RecordAppendOptions, AsyncCallback, Object) BeginAppend(ArraySegment<Byte>, SequenceNumber, SequenceNumber, RecordAppendOptions, AsyncCallback, Object) BeginAppend(ArraySegment<Byte>, SequenceNumber, SequenceNumber, RecordAppendOptions, AsyncCallback, Object)

在衍生類別中覆寫時,開始非同步的附加作業。When overridden in a derived class, begins an asynchronous append operation.

BeginAppend(ArraySegment<Byte>, SequenceNumber, SequenceNumber, RecordAppendOptions, ReservationCollection, AsyncCallback, Object) BeginAppend(ArraySegment<Byte>, SequenceNumber, SequenceNumber, RecordAppendOptions, ReservationCollection, AsyncCallback, Object) BeginAppend(ArraySegment<Byte>, SequenceNumber, SequenceNumber, RecordAppendOptions, ReservationCollection, AsyncCallback, Object) BeginAppend(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.

BeginAppend(IList<ArraySegment<Byte>>, SequenceNumber, SequenceNumber, RecordAppendOptions, AsyncCallback, Object) BeginAppend(IList<ArraySegment<Byte>>, SequenceNumber, SequenceNumber, RecordAppendOptions, AsyncCallback, Object) BeginAppend(IList<ArraySegment<Byte>>, SequenceNumber, SequenceNumber, RecordAppendOptions, AsyncCallback, Object) BeginAppend(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.

BeginAppend(IList<ArraySegment<Byte>>, SequenceNumber, SequenceNumber, RecordAppendOptions, ReservationCollection, AsyncCallback, Object) BeginAppend(IList<ArraySegment<Byte>>, SequenceNumber, SequenceNumber, RecordAppendOptions, ReservationCollection, AsyncCallback, Object) BeginAppend(IList<ArraySegment<Byte>>, SequenceNumber, SequenceNumber, RecordAppendOptions, ReservationCollection, AsyncCallback, Object) BeginAppend(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.

BeginFlush(SequenceNumber, AsyncCallback, Object) BeginFlush(SequenceNumber, AsyncCallback, Object) BeginFlush(SequenceNumber, AsyncCallback, Object) BeginFlush(SequenceNumber, AsyncCallback, Object)

在衍生類別中覆寫時,使用先前在順序中保留的空間,開始非同步的清除作業。When overridden in a derived class, begins an asynchronous flush operation, using space previously reserved in the sequence.

BeginReserveAndAppend(ArraySegment<Byte>, SequenceNumber, SequenceNumber, RecordAppendOptions, ReservationCollection, Int64[], AsyncCallback, Object) BeginReserveAndAppend(ArraySegment<Byte>, SequenceNumber, SequenceNumber, RecordAppendOptions, ReservationCollection, Int64[], AsyncCallback, Object) BeginReserveAndAppend(ArraySegment<Byte>, SequenceNumber, SequenceNumber, RecordAppendOptions, ReservationCollection, Int64[], AsyncCallback, Object) BeginReserveAndAppend(ArraySegment<Byte>, SequenceNumber, SequenceNumber, RecordAppendOptions, ReservationCollection, Int64[], AsyncCallback, Object)

在衍生類別中覆寫時,開始非同步的保留和附加作業。When overridden in a derived class, begins an asynchronous reserve and append operation.

BeginReserveAndAppend(IList<ArraySegment<Byte>>, SequenceNumber, SequenceNumber, RecordAppendOptions, ReservationCollection, Int64[], AsyncCallback, Object) BeginReserveAndAppend(IList<ArraySegment<Byte>>, SequenceNumber, SequenceNumber, RecordAppendOptions, ReservationCollection, Int64[], AsyncCallback, Object) BeginReserveAndAppend(IList<ArraySegment<Byte>>, SequenceNumber, SequenceNumber, RecordAppendOptions, ReservationCollection, Int64[], AsyncCallback, Object) BeginReserveAndAppend(IList<ArraySegment<Byte>>, SequenceNumber, SequenceNumber, RecordAppendOptions, ReservationCollection, Int64[], AsyncCallback, Object)

在衍生類別中覆寫時,開始非同步的保留和附加作業。When overridden in a derived class, begins an asynchronous reserve and append operation.

BeginWriteRestartArea(ArraySegment<Byte>, SequenceNumber, ReservationCollection, AsyncCallback, Object) BeginWriteRestartArea(ArraySegment<Byte>, SequenceNumber, ReservationCollection, AsyncCallback, Object) BeginWriteRestartArea(ArraySegment<Byte>, SequenceNumber, ReservationCollection, AsyncCallback, Object) BeginWriteRestartArea(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.

BeginWriteRestartArea(IList<ArraySegment<Byte>>, SequenceNumber, ReservationCollection, AsyncCallback, Object) BeginWriteRestartArea(IList<ArraySegment<Byte>>, SequenceNumber, ReservationCollection, AsyncCallback, Object) BeginWriteRestartArea(IList<ArraySegment<Byte>>, SequenceNumber, ReservationCollection, AsyncCallback, Object) BeginWriteRestartArea(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.

CreateReservationCollection() CreateReservationCollection() CreateReservationCollection() CreateReservationCollection()

在衍生類別中覆寫時,建立新的 ReservationCollectionWhen overridden in a derived class, creates a new ReservationCollection.

Dispose() Dispose() Dispose() Dispose()

執行與釋放 (Free)、釋放 (Release) 或重設 Unmanaged 資源相關聯之應用程式定義的工作。Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

(Inherited from IDisposable)
EndAppend(IAsyncResult) EndAppend(IAsyncResult) EndAppend(IAsyncResult) EndAppend(IAsyncResult)

在衍生類別中覆寫時,結束非同步的附加作業。When overridden in a derived class, ends an asynchronous append operation.

EndFlush(IAsyncResult) EndFlush(IAsyncResult) EndFlush(IAsyncResult) EndFlush(IAsyncResult)

在衍生類別中覆寫時,結束非同步的清除作業。When overridden in a derived class, ends an asynchronous flush operation.

EndReserveAndAppend(IAsyncResult) EndReserveAndAppend(IAsyncResult) EndReserveAndAppend(IAsyncResult) EndReserveAndAppend(IAsyncResult)

在衍生類別中覆寫時,結束非同步的保留和附加作業。When overridden in a derived class, ends an asynchronous reserve and append operation.

EndWriteRestartArea(IAsyncResult) EndWriteRestartArea(IAsyncResult) EndWriteRestartArea(IAsyncResult) EndWriteRestartArea(IAsyncResult)

在衍生類別中覆寫時,結束非同步的重新啟動區域寫入作業。When overridden in a derived class, ends an asynchronous restart area write operation.

Flush() Flush() Flush() Flush()

在衍生類別中覆寫時,確定已寫入所有附加的記錄。When overridden in a derived class, ensures that all appended records have been written.

Flush(SequenceNumber) Flush(SequenceNumber) Flush(SequenceNumber) Flush(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.

ReadLogRecords(SequenceNumber, LogRecordEnumeratorType) ReadLogRecords(SequenceNumber, LogRecordEnumeratorType) ReadLogRecords(SequenceNumber, LogRecordEnumeratorType) ReadLogRecords(SequenceNumber, LogRecordEnumeratorType)

在衍生類別中覆寫時,將順序中的記錄的可列舉集合傳回。When overridden in a derived class, returns an enumerable collection of records in the sequence.

ReadRestartAreas() ReadRestartAreas() ReadRestartAreas() ReadRestartAreas()

在衍生類別中覆寫時,將順序中的重新啟動區域的可列舉集合傳回。When overridden in a derived class, returns an enumerable collection of the restart areas in the sequence.

ReserveAndAppend(ArraySegment<Byte>, SequenceNumber, SequenceNumber, RecordAppendOptions, ReservationCollection, Int64[]) ReserveAndAppend(ArraySegment<Byte>, SequenceNumber, SequenceNumber, RecordAppendOptions, ReservationCollection, Int64[]) ReserveAndAppend(ArraySegment<Byte>, SequenceNumber, SequenceNumber, RecordAppendOptions, ReservationCollection, Int64[]) ReserveAndAppend(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.

ReserveAndAppend(IList<ArraySegment<Byte>>, SequenceNumber, SequenceNumber, RecordAppendOptions, ReservationCollection, Int64[]) ReserveAndAppend(IList<ArraySegment<Byte>>, SequenceNumber, SequenceNumber, RecordAppendOptions, ReservationCollection, Int64[]) ReserveAndAppend(IList<ArraySegment<Byte>>, SequenceNumber, SequenceNumber, RecordAppendOptions, ReservationCollection, Int64[]) ReserveAndAppend(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.

WriteRestartArea(ArraySegment<Byte>) WriteRestartArea(ArraySegment<Byte>) WriteRestartArea(ArraySegment<Byte>) WriteRestartArea(ArraySegment<Byte>)

在衍生類別中覆寫時,將重新啟動區域寫入 IRecordSequenceWhen overridden in a derived class, writes a restart area to the IRecordSequence.

WriteRestartArea(ArraySegment<Byte>, SequenceNumber) WriteRestartArea(ArraySegment<Byte>, SequenceNumber) WriteRestartArea(ArraySegment<Byte>, SequenceNumber) WriteRestartArea(ArraySegment<Byte>, SequenceNumber)

在衍生類別中覆寫時,將重新啟動區域寫入 IRecordSequence,並更新基底序號When overridden in a derived class, writes a restart area to the IRecordSequence and updates the base sequence number

WriteRestartArea(ArraySegment<Byte>, SequenceNumber, ReservationCollection) WriteRestartArea(ArraySegment<Byte>, SequenceNumber, ReservationCollection) WriteRestartArea(ArraySegment<Byte>, SequenceNumber, ReservationCollection) WriteRestartArea(ArraySegment<Byte>, SequenceNumber, ReservationCollection)

在衍生類別中覆寫時,使用保留區將重新啟動區域寫入 IRecordSequence,並更新基底序號。When overridden in a derived class, writes a restart area to the IRecordSequence using a reservation, and updates the base sequence number

WriteRestartArea(IList<ArraySegment<Byte>>) WriteRestartArea(IList<ArraySegment<Byte>>) WriteRestartArea(IList<ArraySegment<Byte>>) WriteRestartArea(IList<ArraySegment<Byte>>)

在衍生類別中覆寫時,將重新啟動區域寫入 IRecordSequenceWhen overridden in a derived class, writes a restart area to the IRecordSequence.

WriteRestartArea(IList<ArraySegment<Byte>>, SequenceNumber) WriteRestartArea(IList<ArraySegment<Byte>>, SequenceNumber) WriteRestartArea(IList<ArraySegment<Byte>>, SequenceNumber) WriteRestartArea(IList<ArraySegment<Byte>>, SequenceNumber)

在衍生類別中覆寫時,將重新啟動區域寫入 IRecordSequence,並更新基底序號。When overridden in a derived class, writes a restart area to the IRecordSequence and updates the base sequence number.

WriteRestartArea(IList<ArraySegment<Byte>>, SequenceNumber, ReservationCollection) WriteRestartArea(IList<ArraySegment<Byte>>, SequenceNumber, ReservationCollection) WriteRestartArea(IList<ArraySegment<Byte>>, SequenceNumber, ReservationCollection) WriteRestartArea(IList<ArraySegment<Byte>>, SequenceNumber, ReservationCollection)

在衍生類別中覆寫時,使用保留區將重新啟動區域寫入 IRecordSequence,並更新基底序號。When overridden in a derived class, writes a restart area to the IRecordSequence using a reservation, and updates the base sequence number.

事件

TailPinned TailPinned TailPinned TailPinned

會在記錄順序判斷必須將結尾往前移動時發生。Occurs when the record sequence determines that the tail must be moved forward.

適用於