Redigera

Dela via


RecordAppendOptions Enum

Definition

Specifies how records are appended.

This enumeration supports a bitwise combination of its member values.

public enum class RecordAppendOptions
[System.Flags]
public enum RecordAppendOptions
[<System.Flags>]
type RecordAppendOptions = 
Public Enum RecordAppendOptions
Inheritance
RecordAppendOptions
Attributes

Fields

Name Value Description
None 0

Data is written lazily.

ForceAppend 1

The record sequence should begin the process of flushing internal buffers after this record is appended. This does not indicate that the record should be durably written before the Append operation completes. To get that behavior, specify the ForceFlush flag.

ForceFlush 2

The record sequence should flush any internal buffers after this record is appended. When the Append operation completes, the specified record has been durably written.

Examples

The following example shows how to use this enumeration with the Append method to append a record to a log sequence.

    // Append records. Appending three records.
    public void AppendRecords()
    {
        Console.WriteLine("Appending Log Records...");
        SequenceNumber previous = SequenceNumber.Invalid;

        previous = sequence.Append(CreateData("Hello World!"), SequenceNumber.Invalid, SequenceNumber.Invalid, RecordAppendOptions.ForceFlush);
        previous = sequence.Append(CreateData("This is my first Logging App"), SequenceNumber.Invalid, SequenceNumber.Invalid, RecordAppendOptions.ForceFlush);
        previous = sequence.Append(CreateData("Using LogRecordSequence..."), SequenceNumber.Invalid, SequenceNumber.Invalid, RecordAppendOptions.ForceFlush);

        Console.WriteLine("Done...");
    }
' Append records. Appending three records.  
Public Sub AppendRecords()
    Console.WriteLine("Appending Log Records...")
    Dim previous As SequenceNumber = SequenceNumber.Invalid

    previous = sequence.Append(CreateData("Hello World!"), SequenceNumber.Invalid, SequenceNumber.Invalid, RecordAppendOptions.ForceFlush)
    previous = sequence.Append(CreateData("This is my first Logging App"), SequenceNumber.Invalid, SequenceNumber.Invalid, RecordAppendOptions.ForceFlush)
    previous = sequence.Append(CreateData("Using LogRecordSequence..."), SequenceNumber.Invalid, SequenceNumber.Invalid, RecordAppendOptions.ForceFlush)

    Console.WriteLine("Done...")
End Sub

Applies to