LogPolicy 클래스

정의

LogStore와 연결된 정책을 나타냅니다.

public ref class LogPolicy sealed
public sealed class LogPolicy
type LogPolicy = class
Public NotInheritable Class LogPolicy
상속
LogPolicy

예제

이 예제에서는 LogPolicy 클래스를 사용하여 로그 레코드 시퀀스에 대한 정책을 설정하는 방법을 보여 줍니다.

// 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
//
' 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
'

설명

정책은 LogStore 인스턴스와 해당 클라이언트가 따라야 할 규칙의 집합입니다. LogPolicy 인스턴스는 특정 LogStore와 연결된 정책을 검사하고 수정하는 데 사용됩니다. 정책에서는 허용 가능한 최소 및 최대 로그 크기나 LogStore 인스턴스가 증가할 수 있는 방법을 설명할 수 있습니다. 또한 LogStore 인스턴스를 보관할 수 있는지 여부도 제어할 수 있습니다.

속성을 변경한 후에는 Commit 메서드를 사용하여 변경 내용을 LogStore에 적용해야 합니다. Refresh 메서드를 호출하여 변경 내용을 취소하거나 최신 정책을 가져올 수 있습니다.

속성

AutoGrow

LogStore가 자동으로 증가할 수 있는지 여부를 나타내는 값을 가져오거나 설정합니다.

AutoShrinkPercentage

LogStore에서 줄일 수 있는 여유 공간의 백분율을 가져오거나 설정합니다.

GrowthRate

LogStore의 자동 증가 비율을 가져오거나 설정합니다.

MaximumExtentCount

LogExtent에 포함될 수 있는 최대 LogStore 인스턴스 수를 가져오거나 설정합니다.

MinimumExtentCount

LogExtent에 포함될 수 있는 최소 LogStore 인스턴스 수를 가져오거나 설정합니다.

NewExtentPrefix

자동으로 만들어진 범위에 대한 접두사 문자열을 가져오거나 설정합니다.

NextExtentSuffix

새 범위에 대한 접미사 번호를 가져오거나 설정합니다.

PinnedTailThreshold

로그의 기준을 앞으로 이동하기 위해 TailPinned 이벤트에 필요한 공간의 크기를 가져오거나 설정합니다.

메서드

Commit()

LogStore에 대한 현재 정책으로 이 정책을 설정합니다.

Equals(Object)

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

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

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

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

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

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

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

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

LogStore에 대한 현재 정책을 읽고 수행되었을 수 있는 변경 내용을 모두 취소합니다.

ToString()

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

(다음에서 상속됨 Object)

적용 대상