LogRecordSequence 클래스

정의

LogStore에 저장된 레코드 시퀀스를 나타냅니다.

public ref class LogRecordSequence sealed : IDisposable, System::IO::Log::IRecordSequence
public sealed class LogRecordSequence : IDisposable, System.IO.Log.IRecordSequence
type LogRecordSequence = class
    interface IRecordSequence
    interface IDisposable
Public NotInheritable Class LogRecordSequence
Implements IDisposable, IRecordSequence
상속
LogRecordSequence
구현

예제

이 예제에서는 클래스를 사용하는 방법을 보여줍니다.LogRecordSequence

using System;
using System.IO;
using System.Collections.Generic;
using System.Text;
using System.IO.Log;

namespace MyLogRecordSequence
{
    public class MyLog
    {
        string logName = "test.log";
        string logContainer = "MyExtent0";
        int containerSize = 32 * 1024;
        LogRecordSequence sequence = null;
        bool delete = true;

        // These are used in the TailPinned event handler.
        public static LogRecordSequence MySequence = null;
        public static bool AdvanceBase = true;

        public MyLog()
        {
            // Create a LogRecordSequence.
            sequence = new LogRecordSequence(this.logName,
                                              FileMode.CreateNew,
                                              FileAccess.ReadWrite,
                                              FileShare.None);

            // At least one container/extent must be added for Log Record Sequence.
            sequence.LogStore.Extents.Add(this.logContainer, this.containerSize);

            MySequence = sequence;
        }

        public void AddExtents()
        {
            // Add two additional extents. The extents are
            // of the same size as the first extent.
            sequence.LogStore.Extents.Add("MyExtent1");
            sequence.LogStore.Extents.Add("MyExtent2");
        }

        public void EnumerateExtents()
        {
            LogStore store = sequence.LogStore;

            Console.WriteLine("Enumerating Log Extents...");
            Console.WriteLine("    Extent Count: {0} extents", store.Extents.Count);
            Console.WriteLine("    Extents Are...");
            foreach (LogExtent extent in store.Extents)
            {
                Console.WriteLine("      {0} ({1}, {2})",
                                  Path.GetFileName(extent.Path),
                                  extent.Size,
                                  extent.State);
            }
            Console.WriteLine("    Free Extents: {0} Free", store.Extents.FreeCount);
        }

        public void SetLogPolicy()
        {
            Console.WriteLine();
            Console.WriteLine("Setting current log policy...");

            // SET LOG POLICY

            LogPolicy policy = sequence.LogStore.Policy;

            // Set AutoGrow policy. This enables the log to automatically grow
            // when the existing extents are full. New extents are added until
            // we reach the MaximumExtentCount extents.
            // AutoGrow policy is supported only in Windows Vista and not available in R2.

            //policy.AutoGrow = true;

            // Set the Growth Rate in terms of extents. This policy specifies
            // "how much" the log should grow.
            policy.GrowthRate = new PolicyUnit(2, PolicyUnitType.Extents);

            // Set the AutoShrink policy. This enables the log to automatically
            // shrink if the available free space exceeds the shrink percentage.
            // AutoGrow/shrink policy is supported only in Windows Vista and not available in R2.

            //policy.AutoShrinkPercentage = new PolicyUnit(30, PolicyUnitType.Percentage);

            // Set the PinnedTailThreshold policy.
            // A tail pinned event is triggered when there is no
            // log space available and log space may be freed by advancing the base.
            // The user must handle the tail pinned event by advancing the base of the log.
            // If the user is not able to move the base of the log, the user should report with exception in
            // the tail pinned handler.
            // PinnedTailThreashold policy dictates the amount of space that the TailPinned event requests
            // for advancing the base of the log. The amount of space can be in percentage or in terms of bytes
            // which is rounded off to the nearest containers in CLFS. The default is 35 percent.

            policy.PinnedTailThreshold = new PolicyUnit(10, PolicyUnitType.Percentage);

            // Set the maximum extents the log can have.
            policy.MaximumExtentCount = 6;

            // Set the minimum extents the log can have.
            policy.MinimumExtentCount = 2;

            // Set the prefix for new containers that are added.
            // when AutoGrow is enabled.
            //policy.NewExtentPrefix = "MyLogPrefix";

            // Set the suffix number for new containers that are added.
            // when AutoGrow is enabled.
            policy.NextExtentSuffix = 3;

            // Commit the log policy.
            policy.Commit();

            // Refresh updates the IO.Log policy properties with current log policy
            // set in the log.
            policy.Refresh();

            // LOG POLICY END
            //

            //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
            // Setting up IO.Log provided capabilities...
            //

            // SET RETRY APPEND

            // IO.Log provides a mechanism similar to AutoGrow.
            // If the existing log is full and an append fails, setting RetryAppend
            // invokes the CLFS policy engine to add new extents and re-tries
            // record appends. If MaximumExtent count has been reached,
            // a SequenceFullException is thrown.
            //

            sequence.RetryAppend = true;

            // RETRY APPEND END

            // REGISTER FOR TAILPINNED EVENT NOTIFICATIONS

            // Register for TailPinned Event by passing in an event handler.
            // An event is raised when the log full condition is reached.
            // The user should either advance the base sequence number to the
            // nearest valid sequence number recommended in the tail pinned event or
            // report a failure that it is not able to advance the base sequence
            // number.
            //

            sequence.TailPinned += new EventHandler<TailPinnedEventArgs>(HandleTailPinned);

            Console.WriteLine("Done...");
        }

        public void ShowLogPolicy()
        {
            Console.WriteLine();
            Console.WriteLine("Showing current log policy...");

            LogPolicy policy = sequence.LogStore.Policy;

            Console.WriteLine("    Minimum extent count:  {0}", policy.MinimumExtentCount);
            Console.WriteLine("    Maximum extent count:  {0}", policy.MaximumExtentCount);
            Console.WriteLine("    Growth rate:           {0}", policy.GrowthRate);
            Console.WriteLine("    Pinned tail threshold: {0}", policy.PinnedTailThreshold);
            Console.WriteLine("    Auto shrink percent:   {0}", policy.AutoShrinkPercentage);
            Console.WriteLine("    Auto grow enabled:     {0}", policy.AutoGrow);
            Console.WriteLine("    New extent prefix:     {0}", policy.NewExtentPrefix);
            Console.WriteLine("    Next extent suffix:    {0}", policy.NextExtentSuffix);
    }

        // 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...");
        }

        // Read the records added to the log.
        public void ReadRecords()
        {
            Encoding enc = Encoding.Unicode;

            Console.WriteLine();

            Console.WriteLine("Reading Log Records...");
            try
            {
                foreach (LogRecord record in this.sequence.ReadLogRecords(this.sequence.BaseSequenceNumber, LogRecordEnumeratorType.Next))
                {
                    byte[] data = new byte[record.Data.Length];
                    record.Data.Read(data, 0, (int)record.Data.Length);
                    string mystr = enc.GetString(data);
                    Console.WriteLine("    {0}", mystr);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception {0} {1}", e.GetType(), e.Message);
            }

            Console.WriteLine();
        }

        public void FillLog()
        {
            bool append = true;

            while (append)
            {
                try
                {
                    sequence.Append(CreateData(16 * 1024), SequenceNumber.Invalid, SequenceNumber.Invalid, RecordAppendOptions.ForceFlush);
                }

                catch (SequenceFullException)
                {
                    Console.WriteLine("Log is Full...");
                    append = false;
                }
            }
        }

        // Dispose the record sequence and delete the log file.
        public void Cleanup()
        {
            // Dispose the sequence
            sequence.Dispose();

            // Delete the log file.
            if (delete)
            {
                try
                {
                    // This deletes the base log file and all the extents associated with the log.
                    LogStore.Delete(this.logName);
                }
                catch (Exception e)
                {
                    Console.WriteLine("Exception {0} {1}", e.GetType(), e.Message);
                }
            }
        }

        // Converts the given data to an Array of ArraySegment<byte>
        public static IList<ArraySegment<byte>> CreateData(string str)
        {
            Encoding enc = Encoding.Unicode;

            byte[] array = enc.GetBytes(str);

            ArraySegment<byte>[] segments = new ArraySegment<byte>[1];
            segments[0] = new ArraySegment<byte>(array);

            return Array.AsReadOnly<ArraySegment<byte>>(segments);
        }

        public static IList<ArraySegment<byte>> CreateData(int size)
        {
            byte[] array = new byte[size];

            Random rnd = new Random();
            rnd.NextBytes(array);

            ArraySegment<byte>[] segments = new ArraySegment<byte>[1];
            segments[0] = new ArraySegment<byte>(array);

            return Array.AsReadOnly<ArraySegment<byte>>(segments);
        }

        public static SequenceNumber GetAdvanceBaseSeqNumber(SequenceNumber recTargetSeqNum)
        {
            SequenceNumber targetSequenceNumber = SequenceNumber.Invalid;

            Console.WriteLine("Getting actual target sequence number...");

            //
            // Implement the logic for returning a valid sequence number closer to
            // recommended target sequence number.
            //

            return targetSequenceNumber;
        }

        public static void HandleTailPinned(object arg, TailPinnedEventArgs tailPinnedEventArgs)
        {
            Console.WriteLine("TailPinned has fired");

            // Based on the implementation of a logging application, the log base can be moved
            // to free up more log space and if it is not possible to move the
            // base, the application should report by throwing an exception.

            if(MyLog.AdvanceBase)
            {
                try
                {
                    // TailPnnedEventArgs has the recommended sequence number and its generated
                    // based on PinnedTailThreshold policy.
                    // This does not map to an actual sequence number in the record sequence
                    // but an approximation and potentially frees up the threshold % log space
                    // when the log base is advanced to a valid sequence number closer to the
                    // recommended sequence number.
                    // The user should use this sequence number to locate a closest valid sequence
                    // number to advance the base of the log.

                    SequenceNumber recommendedTargetSeqNum = tailPinnedEventArgs.TargetSequenceNumber;

                    // Get the actual Target sequence number.
                    SequenceNumber actualTargetSeqNum = MyLog.GetAdvanceBaseSeqNumber(recommendedTargetSeqNum);

                    MySequence.AdvanceBaseSequenceNumber(actualTargetSeqNum);
                }
                catch (Exception e)
                {
                    Console.WriteLine("Exception thrown {0} {1}", e.GetType(), e.Message);
                }
            }
            else
            {
                // Report back Error if under some conditions the log cannot
                // advance the base sequence number.

                Console.WriteLine("Reporting Error! Unable to move the base sequence number!");
                throw new IOException();
            }
        }
    }

    class LogSample
    {
        static void Main(string[] args)
        {
            // Create log record sequence.
            MyLog log = new MyLog();

            // Add additional extents.
            log.AddExtents();

            // Enumerate the current log extents.
            log.EnumerateExtents();

            // Set log policies and register for TailPinned event notifications.
            log.SetLogPolicy();

            log.ShowLogPolicy();

            // Append a few records and read the appended records.
            log.AppendRecords();
            log.ReadRecords();

            // Fill the Log to trigger log growth...and subsequent TailPinned notifications.
            log.FillLog();

            log.EnumerateExtents();

            log.Cleanup();
        }
    }
}

Imports System.IO
Imports System.Collections.Generic
Imports System.Text
Imports System.IO.Log

Namespace MyLogRecordSequence
    Public Class MyLog
        Private logName As String = "test.log"
        Private logContainer As String = "MyExtent0"
        Private containerSize As Integer = 32 * 1024
        Private sequence As LogRecordSequence = Nothing
        Private delete As Boolean = True

        ' These are used in the TailPinned event handler.
        Public Shared MySequence As LogRecordSequence = Nothing
        Public Shared AdvanceBase As Boolean = True

        Public Sub New()
            ' Create a LogRecordSequence.
            sequence = New LogRecordSequence(Me.logName, FileMode.CreateNew, FileAccess.ReadWrite, FileShare.None)

            ' At least one container/extent must be added for Log Record Sequence.
            sequence.LogStore.Extents.Add(Me.logContainer, Me.containerSize)

            MySequence = sequence

        End Sub

        Public Sub AddExtents()
            ' Add two additional extents. The extents are 
            ' of the same size as the first extent.
            sequence.LogStore.Extents.Add("MyExtent1")
            sequence.LogStore.Extents.Add("MyExtent2")
        End Sub

        Public Sub EnumerateExtents()
            Dim store As LogStore = sequence.LogStore

            Console.WriteLine("Enumerating Log Extents...")
            Console.WriteLine("    Extent Count: {0} extents", store.Extents.Count)
            Console.WriteLine("    Extents Are...")
            For Each extent In store.Extents
                Console.WriteLine("      {0} ({1}, {2})", Path.GetFileName(extent.Path), extent.Size, extent.State)
            Next extent
            Console.WriteLine("    Free Extents: {0} Free", store.Extents.FreeCount)
        End Sub

        Public Sub SetLogPolicy()
            Console.WriteLine()
            Console.WriteLine("Setting current log policy...")

            ' SET LOG POLICY

            Dim policy As LogPolicy = sequence.LogStore.Policy

            ' Set AutoGrow policy. This enables the log to automatically grow
            ' when the existing extents are full. New extents are added until
            ' we reach the MaximumExtentCount extents.
            ' AutoGrow policy is supported only in Windows Vista and not available in R2.

            'policy.AutoGrow = true;

            ' Set the Growth Rate in terms of extents. This policy specifies
            ' "how much" the log should grow. 
            policy.GrowthRate = New PolicyUnit(2, PolicyUnitType.Extents)

            ' Set the AutoShrink policy. This enables the log to automatically
            ' shrink if the available free space exceeds the shrink percentage. 
            ' AutoGrow/shrink policy is supported only in Windows Vista and not available in R2.

            'policy.AutoShrinkPercentage = new PolicyUnit(30, PolicyUnitType.Percentage);

            ' Set the PinnedTailThreshold policy.
            ' A tail pinned event is triggered when there is no
            ' log space available and log space may be freed by advancing the base.
            ' The user must handle the tail pinned event by advancing the base of the log. 
            ' If the user is not able to move the base of the log, the user should report with exception in
            ' the tail pinned handler.
            ' PinnedTailThreashold policy dictates the amount of space that the TailPinned event requests 
            ' for advancing the base of the log. The amount of space can be in percentage or in terms of bytes 
            ' which is rounded off to the nearest containers in CLFS. The default is 35 percent.


            policy.PinnedTailThreshold = New PolicyUnit(10, PolicyUnitType.Percentage)

            ' Set the maximum extents the log can have.
            policy.MaximumExtentCount = 6

            ' Set the minimum extents the log can have.
            policy.MinimumExtentCount = 2

            ' Set the prefix for new containers that are added. 
            ' when AutoGrow is enabled.
            'policy.NewExtentPrefix = "MyLogPrefix";

            ' Set the suffix number for new containers that are added.
            ' when AutoGrow is enabled. 
            policy.NextExtentSuffix = 3

            ' Commit the log policy.
            policy.Commit()

            ' Refresh updates the IO.Log policy properties with current log policy 
            ' set in the log. 
            policy.Refresh()

            ' LOG POLICY END
            ' 

            '+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
            ' Setting up IO.Log provided capabilities...
            ' 

            ' SET RETRY APPEND

            ' IO.Log provides a mechanism similar to AutoGrow.
            ' If the existing log is full and an append fails, setting RetryAppend
            ' invokes the CLFS policy engine to add new extents and re-tries
            ' record appends. If MaximumExtent count has been reached, 
            ' a SequenceFullException is thrown. 
            ' 

            sequence.RetryAppend = True

            ' RETRY APPEND END

            ' REGISTER FOR TAILPINNED EVENT NOTIFICATIONS

            ' Register for TailPinned Event by passing in an event handler.
            ' An event is raised when the log full condition is reached.
            ' The user should either advance the base sequence number to the 
            ' nearest valid sequence number recommended in the tail pinned event or
            ' report a failure that it is not able to advance the base sequence 
            ' number. 
            '

            AddHandler sequence.TailPinned, AddressOf HandleTailPinned

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

        Public Sub ShowLogPolicy()
            Console.WriteLine()
            Console.WriteLine("Showing current log policy...")

            Dim policy As LogPolicy = sequence.LogStore.Policy

            Console.WriteLine("    Minimum extent count:  {0}", policy.MinimumExtentCount)
            Console.WriteLine("    Maximum extent count:  {0}", policy.MaximumExtentCount)
            Console.WriteLine("    Growth rate:           {0}", policy.GrowthRate)
            Console.WriteLine("    Pinned tail threshold: {0}", policy.PinnedTailThreshold)
            Console.WriteLine("    Auto shrink percent:   {0}", policy.AutoShrinkPercentage)
            Console.WriteLine("    Auto grow enabled:     {0}", policy.AutoGrow)
            Console.WriteLine("    New extent prefix:     {0}", policy.NewExtentPrefix)
            Console.WriteLine("    Next extent suffix:    {0}", policy.NextExtentSuffix)

        End Sub

        ' 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


        ' Read the records added to the log. 
        Public Sub ReadRecords()
            Dim enc As Encoding = Encoding.Unicode

            Console.WriteLine()

            Console.WriteLine("Reading Log Records...")
            Try
                For Each record As LogRecord In Me.sequence.ReadLogRecords(Me.sequence.BaseSequenceNumber, LogRecordEnumeratorType.Next)
                    Dim data(record.Data.Length - 1) As Byte
                    record.Data.Read(data, 0, CInt(Fix(record.Data.Length)))
                    Dim mystr As String = enc.GetString(data)
                    Console.WriteLine("    {0}", mystr)
                Next record
            Catch e As Exception
                Console.WriteLine("Exception {0} {1}", e.GetType(), e.Message)
            End Try

            Console.WriteLine()
        End Sub

        Public Sub FillLog()
            Dim append As Boolean = True

            Do While append
                Try
                    sequence.Append(CreateData(16 * 1024), SequenceNumber.Invalid, SequenceNumber.Invalid, RecordAppendOptions.ForceFlush)

                Catch e1 As SequenceFullException
                    Console.WriteLine("Log is Full...")
                    append = False
                End Try
            Loop
        End Sub

        ' Dispose the record sequence and delete the log file. 
        Public Sub Cleanup()
            ' Dispose the sequence
            sequence.Dispose()

            ' Delete the log file.
            If delete Then
                Try
                    ' This deletes the base log file and all the extents associated with the log.
                    LogStore.Delete(Me.logName)
                Catch e As Exception
                    Console.WriteLine("Exception {0} {1}", e.GetType(), e.Message)
                End Try
            End If
        End Sub

        ' Converts the given data to an Array of ArraySegment<byte> 
        Public Shared Function CreateData(ByVal str As String) As IList(Of ArraySegment(Of Byte))
            Dim enc As Encoding = Encoding.Unicode

            Dim array() As Byte = enc.GetBytes(str)

            Dim segments(0) As ArraySegment(Of Byte)
            segments(0) = New ArraySegment(Of Byte)(array)

            Return System.Array.AsReadOnly(Of ArraySegment(Of Byte))(segments)
        End Function

        Public Shared Function CreateData(ByVal size As Integer) As IList(Of ArraySegment(Of Byte))
            Dim array(size - 1) As Byte

            Dim rand As New Random()
            rand.NextBytes(array)

            Dim segments(0) As ArraySegment(Of Byte)
            segments(0) = New ArraySegment(Of Byte)(array)

            Return System.Array.AsReadOnly(Of ArraySegment(Of Byte))(segments)
        End Function

        Public Shared Function GetAdvanceBaseSeqNumber(ByVal recTargetSeqNum As SequenceNumber) As SequenceNumber
            Dim targetSequenceNumber As SequenceNumber = SequenceNumber.Invalid

            Console.WriteLine("Getting actual target sequence number...")

            ' 
            ' Implement the logic for returning a valid sequence number closer to
            ' recommended target sequence number. 
            '

            Return targetSequenceNumber
        End Function

        Public Shared Sub HandleTailPinned(ByVal arg As Object, ByVal tailPinnedEventArgs As TailPinnedEventArgs)
            Console.WriteLine("TailPinned has fired")

            ' Based on the implementation of a logging application, the log base can be moved
            ' to free up more log space and if it is not possible to move the 
            ' base, the application should report by throwing an exception.

            If MyLog.AdvanceBase Then
                Try
                    ' TailPnnedEventArgs has the recommended sequence number and its generated 
                    ' based on PinnedTailThreshold policy. 
                    ' This does not map to an actual sequence number in the record sequence
                    ' but an approximation and potentially frees up the threshold % log space
                    ' when the log base is advanced to a valid sequence number closer to the 
                    ' recommended sequence number. 
                    ' The user should use this sequence number to locate a closest valid sequence
                    ' number to advance the base of the log.

                    Dim recommendedTargetSeqNum As SequenceNumber = tailPinnedEventArgs.TargetSequenceNumber

                    ' Get the actual Target sequence number.
                    Dim actualTargetSeqNum As SequenceNumber = MyLog.GetAdvanceBaseSeqNumber(recommendedTargetSeqNum)

                    MySequence.AdvanceBaseSequenceNumber(actualTargetSeqNum)
                Catch e As Exception
                    Console.WriteLine("Exception thrown {0} {1}", e.GetType(), e.Message)
                End Try
            Else
                ' Report back Error if under some conditions the log cannot
                ' advance the base sequence number.

                Console.WriteLine("Reporting Error! Unable to move the base sequence number!")
                Throw New IOException()
            End If
        End Sub
    End Class

    Friend Class LogSample
        Shared Sub Main(ByVal args() As String)
            ' Create log record sequence.
            Dim log As New MyLog()

            ' Add additional extents.
            log.AddExtents()

            ' Enumerate the current log extents.
            log.EnumerateExtents()

            ' Set log policies and register for TailPinned event notifications. 
            log.SetLogPolicy()

            log.ShowLogPolicy()

            ' Append a few records and read the appended records. 
            log.AppendRecords()
            log.ReadRecords()

            ' Fill the Log to trigger log growth...and subsequent TailPinned notifications.
            log.FillLog()

            log.EnumerateExtents()

            log.Cleanup()
        End Sub
    End Class
End Namespace

설명

LogRecordSequence 클래스는 CLFS(Common Log File System) 로그 위에 레코드 시퀀스 인터페이스의 구현을 제공합니다. 표준 레코드 지향 기능 외에도 로그 전체 조건을 방지하고 동일한 물리적 파일에서 클라이언트를 멀티플렉싱하는 정책 모델을 제공합니다. 이 클래스는 CLFS 로그 파일을 직접 조작하고 관리하는 데 필요한 인터페이스를 제공하는 LogStore 클래스와 함께 작동합니다. LogStore 클래스와 LogRecordSequence 클래스의 관계는 디스크 파일과 FileStream 개체의 관계와 유사합니다. 디스크 파일은 실제 스토리지를 제공하고 길이 및 마지막 액세스 시간과 같은 특성이 있으며, FileStream 개체는 파일에서 읽고 파일에 쓰는 데 사용할 수 있는 파일에 대한 뷰를 제공합니다. 마찬가지로 클래스 LogStore 에는 정책 및 디스크 익스텐트 컬렉션과 같은 특성이 있으며 LogRecordSequence , 클래스는 데이터를 읽고 쓰기 위한 레코드 지향 메커니즘을 제공합니다.

생성자

LogRecordSequence(LogStore)

지정된 로그 저장소를 사용하여 LogRecordSequence 클래스의 새 인스턴스를 초기화합니다.

LogRecordSequence(LogStore, Int32, Int32)

지정된 로그 저장소, 각 레코드의 버퍼 크기, 버퍼 수를 사용하여 LogRecordSequence 클래스의 새 인스턴스를 초기화합니다.

LogRecordSequence(String, FileMode)

지정된 로그 저장소 경로와 액세스 모드를 사용하여 LogRecordSequence 클래스의 새 인스턴스를 초기화합니다.

LogRecordSequence(String, FileMode, FileAccess)

지정된 로그 저장소 경로와 액세스 및 공유 모드를 사용하여 LogRecordSequence 클래스의 새 인스턴스를 초기화합니다.

LogRecordSequence(String, FileMode, FileAccess, FileShare)

지정된 로그 저장소 경로와 액세스 모드를 사용하여 LogRecordSequence 클래스의 새 인스턴스를 초기화합니다.

LogRecordSequence(String, FileMode, FileAccess, FileShare, Int32, Int32)

지정된 로그 저장소 경로, 파일 사용 권한, 액세스 및 공유 모드, 레코드의 버퍼 크기 및 수를 사용하여 LogRecordSequence 클래스의 새 인스턴스를 초기화합니다.

LogRecordSequence(String, FileMode, FileAccess, FileShare, Int32, Int32, FileSecurity)

LogRecordSequence 클래스의 새 인스턴스를 초기화합니다.

속성

BaseSequenceNumber

현재 LogRecordSequence에서 유효한 첫 번째 레코드의 시퀀스 번호를 가져옵니다.

LastSequenceNumber

마지막으로 추가된 레코드보다 큰 시퀀스 번호를 가져옵니다.

LogStore

이 레코드 시퀀스의 데이터가 포함된 LogStore를 가져옵니다. 이 메서드는 상속될 수 없습니다.

MaximumRecordLength

이 레코드 시퀀스에 추가할 수 있는 최대 레코드 크기를 가져옵니다.

ReservedBytes

예약된 총 바이트 수를 가져옵니다.

RestartSequenceNumber

로그 끝과 가장 가까운 재시작 영역의 시퀀스 번호를 가져옵니다.

RetryAppend

로그가 꽉 차는 경우 추가 작업이 자동으로 다시 시도되는지 여부를 나타내는 값을 가져오거나 설정합니다.

메서드

AdvanceBaseSequenceNumber(SequenceNumber)

로그의 기준 시퀀스 번호를 앞으로 이동합니다. 이 메서드는 상속될 수 없습니다.

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

로그 레코드를 LogRecordSequence에 씁니다. 이 메서드는 상속될 수 없습니다.

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

시퀀스에서 이전에 예약된 공간을 사용하여 로그 레코드를 IRecordSequence에 추가합니다. 이 메서드는 상속될 수 없습니다.

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

로그 레코드를 IRecordSequence에 추가합니다. 이 메서드는 상속될 수 없습니다.

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

시퀀스에서 이전에 예약된 공간을 사용하여 로그 레코드를 IRecordSequence에 추가합니다. 이 메서드는 상속될 수 없습니다.

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

비동기 추가 작업을 시작합니다. 이 메서드는 상속될 수 없습니다.

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

비동기 추가 작업을 시작합니다. 이 메서드는 상속될 수 없습니다.

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

비동기 추가 작업을 시작합니다. 이 메서드는 상속될 수 없습니다.

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

비동기 추가 작업을 시작합니다. 이 메서드는 상속될 수 없습니다.

BeginFlush(SequenceNumber, AsyncCallback, Object)

시퀀스에서 이전에 예약된 공간을 사용하여 비동기 플러시 작업을 시작합니다. 이 메서드는 상속될 수 없습니다.

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

비동기 예약 및 추가 작업을 시작합니다. 이 메서드는 상속될 수 없습니다.

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

비동기 예약 및 추가 작업을 시작합니다. 이 메서드는 상속될 수 없습니다.

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

시퀀스에서 이전에 예약된 공간을 사용하여 비동기 재시작 영역 쓰기 작업을 시작합니다. 이 메서드는 상속될 수 없습니다.

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

시퀀스에서 이전에 예약된 공간을 사용하여 비동기 재시작 영역 쓰기 작업을 시작합니다. 이 메서드는 상속될 수 없습니다.

CreateReservationCollection()

ReservationCollection를 만듭니다. 이 메서드는 상속될 수 없습니다.

Dispose()

구성 요소에서 사용하는 리소스를 해제합니다.

EndAppend(IAsyncResult)

비동기 추가 작업을 끝냅니다. 이 메서드는 상속될 수 없습니다.

EndFlush(IAsyncResult)

비동기 플러시 작업을 끝냅니다. 이 메서드는 상속될 수 없습니다.

EndReserveAndAppend(IAsyncResult)

비동기 예약 및 추가 작업을 끝냅니다. 이 메서드는 상속될 수 없습니다.

EndWriteRestartArea(IAsyncResult)

비동기 재시작 영역 쓰기 작업을 끝냅니다. 이 메서드는 상속될 수 없습니다.

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
Flush()

추가된 모든 레코드를 썼는지 확인합니다. 이 메서드는 상속될 수 없습니다.

Flush(SequenceNumber)

지정된 시퀀스 번호까지 추가된 모든 레코드를 영속적으로 썼는지 확인합니다. 이 메서드는 상속될 수 없습니다.

GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ReadLogRecords(SequenceNumber, LogRecordEnumeratorType)

시퀀스에 있는 레코드의 열거 가능한 컬렉션을 반환합니다. 이 메서드는 상속될 수 없습니다.

ReadRestartAreas()

시퀀스에 있는 재시작 영역의 열거 가능한 컬렉션을 반환합니다. 이 메서드는 상속될 수 없습니다.

ReserveAndAppend(ArraySegment<Byte>, SequenceNumber, SequenceNumber, RecordAppendOptions, ReservationCollection, Int64[])

자동으로 단일 예약을 만들고 시퀀스에 레코드를 추가합니다. 이 메서드는 상속될 수 없습니다.

ReserveAndAppend(IList<ArraySegment<Byte>>, SequenceNumber, SequenceNumber, RecordAppendOptions, ReservationCollection, Int64[])

자동으로 단일 예약을 만들고 시퀀스에 레코드를 추가합니다. 이 메서드는 상속될 수 없습니다.

SetLastRecord(SequenceNumber)

LogRecordSequence에서 마지막 레코드를 설정합니다.

ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)
WriteRestartArea(ArraySegment<Byte>)

LogRecordSequence에 재시작 영역을 씁니다. 이 메서드는 상속될 수 없습니다.

WriteRestartArea(ArraySegment<Byte>, SequenceNumber)

재시작 영역을 LogRecordSequence에 쓰고 기준 시퀀스 번호를 업데이트합니다. 이 메서드는 상속될 수 없습니다.

WriteRestartArea(ArraySegment<Byte>, SequenceNumber, ReservationCollection)

예약을 사용하여 재시작 영역을 LogRecordSequence에 쓰고 기준 시퀀스 번호를 업데이트합니다. 이 메서드는 상속될 수 없습니다.

WriteRestartArea(IList<ArraySegment<Byte>>)

LogRecordSequence에 재시작 영역을 씁니다. 이 메서드는 상속될 수 없습니다.

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

재시작 영역을 LogRecordSequence에 쓰고 기준 시퀀스 번호를 업데이트합니다. 이 메서드는 상속될 수 없습니다.

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

예약을 사용하여 재시작 영역을 LogRecordSequence에 쓰고 기준 시퀀스 번호를 업데이트합니다. 이 메서드는 상속될 수 없습니다.

이벤트

TailPinned

시퀀스의 테일을 이동해야 함을 나타냅니다.

적용 대상