IRecordSequence.BeginWriteRestartArea 方法

定义

在派生类中重写时,开始异步重新开始区域写入操作。When overridden in a derived class, begins an asynchronous restart area write operation.

重载

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)

在派生类中重写时,将使用序列中先前保留的空间来开始异步重新开始区域写入操作。When overridden in a derived class, begins an asynchronous restart area write operation, using space previously reserved in the sequence.

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.

public:
 IAsyncResult ^ BeginWriteRestartArea(ArraySegment<System::Byte> data, System::IO::Log::SequenceNumber newBaseSequenceNumber, System::IO::Log::ReservationCollection ^ reservation, AsyncCallback ^ callback, System::Object ^ state);
public IAsyncResult BeginWriteRestartArea (ArraySegment<byte> data, System.IO.Log.SequenceNumber newBaseSequenceNumber, System.IO.Log.ReservationCollection reservation, AsyncCallback callback, object state);
abstract member BeginWriteRestartArea : ArraySegment<byte> * System.IO.Log.SequenceNumber * System.IO.Log.ReservationCollection * AsyncCallback * obj -> IAsyncResult
Public Function BeginWriteRestartArea (data As ArraySegment(Of Byte), newBaseSequenceNumber As SequenceNumber, reservation As ReservationCollection, callback As AsyncCallback, state As Object) As IAsyncResult

参数

data
ArraySegment<Byte>

将连接在一起并以记录形式追加的字节数组段的列表。A list of byte array segments that will be concatenated and appended as the record.

newBaseSequenceNumber
SequenceNumber

新的基序列号。The new base sequence number. 指定的序列号必须大于或等于当前基序列号。The specified sequence number must be greater than or equal to the current base sequence number.

reservation
ReservationCollection

一个 ReservationCollection,它包含应当用于此重新开始区域的预留。A ReservationCollection that contains the reservation that should be used for this restart area.

callback
AsyncCallback

可选的异步回调,在重新开始区域写入完成时调用。An optional asynchronous callback, to be called when the restart area write is complete.

state
Object

用户提供的对象,用于将此特定异步重新开始区域写入请求与其他请求区别开来。A user-provided object that distinguishes this particular asynchronous restart area write request from other requests.

返回

IAsyncResult

一个 IAsyncResult,它表示可能仍处于挂起状态的异步重新开始区域写入操作。An IAsyncResult that represents the asynchronous restart area write operation, which could still be pending.

注解

应将此方法返回的 IAsyncResult 传递给 EndWriteRestartArea 方法,以确保重新开始区域写入操作完成并能够适当释放资源。You should pass the IAsyncResult returned by this method to the EndWriteRestartArea method, to assure that the restart area write operation has completed and resources can be freed appropriately. 如果在异步重新开始区域写入操作过程中发生错误,则在使用此方法返回的 EndWriteRestartArea 调用 IAsyncResult 方法之前,不会引发异常。If an error has occurred during an asynchronous restart area write operation, an exception is not thrown until the EndWriteRestartArea method is called with the IAsyncResult returned by this method.

包含在 data 参数中的数据将连接成单个字节数组,以便以记录形式追加。Data contained in the data parameter will be concatenated into a single byte array for appending as the record. 但在读取记录时,无法将数据重新拆分为数组段。However, no provision is made for splitting data back into array segments when the record is read.

操作成功完成时,基序列号已更新。When the operation successfully completes, the base sequence number has been updated. 其序列号小于新的基序列号的所有日志记录都不可访问。All log records with sequence numbers less than the new base sequence number are inaccessible.

如果指定了 ReservationCollection,写入的重新开始区域将使用集合中包含的预留来占用先前已预留的空间。If a ReservationCollection is specified, the written restart area will consume space that has been previously reserved, using a reservation contained in the collection. 如果该方法成功,它将占用能容纳数据的最小预留,而该预留将从集合中移除。If the method succeeds, it will consume the smallest reservation that can hold the data, and that reservation will be removed from the collection.

如果记录序列已经释放,或者如果传递了无效自变量,此操作内将立即引发异常。If a record sequence has been disposed of, or if you pass an invalid argument, exceptions are thrown immediately within this operation. 异步追加请求过程中发生的错误(例如,I/O 请求过程中的磁盘故障)将导致在调用 EndWriteRestartArea 方法时引发异常。Errors that occurred during an asynchronous append request, for example, a disk failure during the I/O request, will result in exceptions being thrown when the EndWriteRestartArea method is called.

适用于

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.

public:
 IAsyncResult ^ BeginWriteRestartArea(System::Collections::Generic::IList<ArraySegment<System::Byte>> ^ data, System::IO::Log::SequenceNumber newBaseSequenceNumber, System::IO::Log::ReservationCollection ^ reservation, AsyncCallback ^ callback, System::Object ^ state);
public IAsyncResult BeginWriteRestartArea (System.Collections.Generic.IList<ArraySegment<byte>> data, System.IO.Log.SequenceNumber newBaseSequenceNumber, System.IO.Log.ReservationCollection reservation, AsyncCallback callback, object state);
abstract member BeginWriteRestartArea : System.Collections.Generic.IList<ArraySegment<byte>> * System.IO.Log.SequenceNumber * System.IO.Log.ReservationCollection * AsyncCallback * obj -> IAsyncResult
Public Function BeginWriteRestartArea (data As IList(Of ArraySegment(Of Byte)), newBaseSequenceNumber As SequenceNumber, reservation As ReservationCollection, callback As AsyncCallback, state As Object) As IAsyncResult

参数

data
IList<ArraySegment<Byte>>

将连接在一起并以记录形式追加的字节数组段的列表。A list of byte array segments that will be concatenated and appended as the record.

newBaseSequenceNumber
SequenceNumber

新的基序列号。The new base sequence number. 指定的序列号必须大于或等于当前基序列号。The specified sequence number must be greater than or equal to the current base sequence number.

reservation
ReservationCollection

一个 ReservationCollection,它包含应当用于此重新开始区域的预留。A ReservationCollection that contains the reservation that should be used for this restart area.

callback
AsyncCallback

可选的异步回调,在重新开始区域写入完成时调用。An optional asynchronous callback, to be called when the restart area write is complete.

state
Object

用户提供的对象,用于将此特定异步重新开始区域写入请求与其他请求区别开来。A user-provided object that distinguishes this particular asynchronous restart area write request from other requests.

返回

IAsyncResult

一个 IAsyncResult,它表示可能仍处于挂起状态的异步重新开始区域写入操作。An IAsyncResult that represents the asynchronous restart area write operation, which could still be pending.

例外

一个或多个自变量无效。One or more of the arguments is invalid.

写入重新开始区域时,发生了 I/O 错误。An I/O error occurred while writing the restart area.

记录序列无法获得足够的可用空间来容纳新记录。The record sequence could not make enough free space to contain the new record.

该方法是在序列已释放之后调用的。The method was called after the sequence has been disposed of.

注解

应将此方法返回的 IAsyncResult 传递给 EndWriteRestartArea 方法,以确保重新开始区域写入操作完成并能够适当释放资源。You should pass the IAsyncResult returned by this method to the EndWriteRestartArea method to ensure that the restart area write operation has completed and resources can be freed appropriately. 如果在异步重新开始区域写入操作过程中发生错误,则在使用此方法返回的 EndWriteRestartArea 调用 IAsyncResult 方法之前,不会引发异常。If an error has occurred during an asynchronous restart area write operation, an exception is not thrown until the EndWriteRestartArea method is called with the IAsyncResult returned by this method.

包含在 data 参数中的数据将连接成单个字节数组,以便以记录形式追加。Data contained in the data parameter will be concatenated into a single byte array for appending as the record. 但在读取记录时,无法将数据重新拆分为数组段。However, no provision is made for splitting data back into array segments when the record is read.

操作成功完成时,基序列号已更新。When the operation successfully completes, the base sequence number has been updated. 其序列号小于新的基序列号的所有日志记录都不可访问。All log records with sequence numbers less than the new base sequence number are inaccessible.

如果指定了 ReservationCollection,写入的重新开始区域将使用集合中包含的预留来占用先前已预留的空间。If a ReservationCollection is specified, the written restart area will consume space that has been previously reserved, using a reservation contained in the collection. 如果该方法成功,它将占用能容纳数据的最小预留,而该预留将从集合中移除。If the method succeeds, it will consume the smallest reservation that can hold the data, and that reservation will be removed from the collection.

如果记录序列已经释放,或者如果传递了无效自变量,此操作内将立即引发异常。If a record sequence has been disposed of, or if you pass an invalid argument, exceptions are thrown immediately within this operation. 异步追加请求过程中发生的错误(例如,I/O 请求过程中的磁盘故障)将导致在调用 EndWriteRestartArea 方法时引发异常。Errors that occurred during an asynchronous append request, for example, a disk failure during the I/O request, will result in exceptions being thrown when the EndWriteRestartArea method is called.

适用于