แก้ไข

แชร์ผ่าน


FileRecordSequence.BeginWriteRestartArea Method

Definition

Begins an asynchronous restart area write operation.

Overloads

BeginWriteRestartArea(ArraySegment<Byte>, SequenceNumber, ReservationCollection, AsyncCallback, Object)

Begins an asynchronous restart area write operation, using space previously reserved in the sequence. This method cannot be inherited.

BeginWriteRestartArea(IList<ArraySegment<Byte>>, SequenceNumber, ReservationCollection, AsyncCallback, Object)

Begins an asynchronous restart area write operation, using space previously reserved in the sequence. This method cannot be inherited.

BeginWriteRestartArea(ArraySegment<Byte>, SequenceNumber, ReservationCollection, AsyncCallback, Object)

Begins an asynchronous restart area write operation, using space previously reserved in the sequence. This method cannot be inherited.

public:
 virtual IAsyncResult ^ BeginWriteRestartArea(ArraySegment<System::Byte> data, System::IO::Log::SequenceNumber newBaseSeqNum, System::IO::Log::ReservationCollection ^ reservation, AsyncCallback ^ callback, System::Object ^ state);
public IAsyncResult BeginWriteRestartArea (ArraySegment<byte> data, System.IO.Log.SequenceNumber newBaseSeqNum, 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
override this.BeginWriteRestartArea : ArraySegment<byte> * System.IO.Log.SequenceNumber * System.IO.Log.ReservationCollection * AsyncCallback * obj -> IAsyncResult
Public Function BeginWriteRestartArea (data As ArraySegment(Of Byte), newBaseSeqNum As SequenceNumber, reservation As ReservationCollection, callback As AsyncCallback, state As Object) As IAsyncResult

Parameters

data
ArraySegment<Byte>

A list of byte array segments that will be concatenated and appended as the record.

newBaseSeqNum
SequenceNumber

The new base sequence number. The specified sequence number must be greater than or equal to the current base sequence number.

reservation
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.

Returns

An IAsyncResult that represents the asynchronous restart area write operation, which could still be pending.

Implements

Exceptions

One or more of the arguments are null.

newBaseSeqNum is not between the base and last sequence numbers of this sequence.

-or-

A new or existing archive tail or base of the active log is invalid.

reservations was not created by this record sequence.

-or-

newBaseSeqNum is not valid for this sequence.

The operation cannot be performed because the record sequence was opened with read-only access.

The request cannot be performed because of an unexpected I/O exception.

The method was called after the sequence has been disposed of.

There is not enough memory to continue the execution of the program.

The record sequence is full.

No reservation large enough to fit data can be found in reservations.

Remarks

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. 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 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.

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. 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.

Applies to

BeginWriteRestartArea(IList<ArraySegment<Byte>>, SequenceNumber, ReservationCollection, AsyncCallback, Object)

Begins an asynchronous restart area write operation, using space previously reserved in the sequence. This method cannot be inherited.

public:
 virtual IAsyncResult ^ BeginWriteRestartArea(System::Collections::Generic::IList<ArraySegment<System::Byte>> ^ data, System::IO::Log::SequenceNumber newBaseSeqNum, System::IO::Log::ReservationCollection ^ reservation, AsyncCallback ^ callback, System::Object ^ state);
public IAsyncResult BeginWriteRestartArea (System.Collections.Generic.IList<ArraySegment<byte>> data, System.IO.Log.SequenceNumber newBaseSeqNum, 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
override this.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)), newBaseSeqNum As SequenceNumber, reservation As ReservationCollection, callback As AsyncCallback, state As Object) As IAsyncResult

Parameters

data
IList<ArraySegment<Byte>>

A list of byte array segments that will be concatenated and appended as the record.

newBaseSeqNum
SequenceNumber

The new base sequence number. The specified sequence number must be greater than or equal to the current base sequence number.

reservation
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.

Returns

An IAsyncResult that represents the asynchronous restart area write operation, which could still be pending.

Implements

Exceptions

One or more of the arguments are null.

newBaseSeqNum is not between the base and last sequence numbers of this sequence.

-or-

A new or existing archive tail or base of the active log is invalid.

reservations was not created by this record sequence.

-or-

newBaseSeqNum is not valid for this sequence.

The operation cannot be performed because the record sequence was opened with read-only access.

The request cannot be performed because of an unexpected I/O exception.

The method was called after the sequence has been disposed of.

There is not enough memory to continue the execution of the program.

The record sequence is full.

No reservation large enough to fit data can be found in reservations.

Remarks

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. 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 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.

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. 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.

Applies to