LogPolicy 클래스

정의

LogStore와 연결된 정책을 나타냅니다.Represents the policy associated with a LogStore.

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

예제

이 예제에서는 LogPolicy 클래스를 사용하여 로그 레코드 시퀀스에 대한 정책을 설정하는 방법을 보여 줍니다.This example shows how to use the LogPolicy class to set policy for a log record sequence.

// 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 인스턴스와 해당 클라이언트가 따라야 할 규칙의 집합입니다.A policy is a set of rules to be followed by a LogStore instance and its clients. LogPolicy 인스턴스는 특정 LogStore와 연결된 정책을 검사하고 수정하는 데 사용됩니다.A LogPolicy instance is used to examine and modify the policy associated with a specific LogStore. 정책에서는 허용 가능한 최소 및 최대 로그 크기나 LogStore 인스턴스가 증가할 수 있는 방법을 설명할 수 있습니다.A policy can describe the minimum and maximum allowable log sizes, or how the LogStore instance is allowed to grow. 또한 LogStore 인스턴스를 보관할 수 있는지 여부도 제어할 수 있습니다.In addition, you can also control whether a LogStore instance can be archived.

속성을 변경한 후에는 Commit 메서드를 사용하여 변경 내용을 LogStore에 적용해야 합니다.After changing any of the properties, you should use the Commit method to ensure that the changes are applied to the LogStore. Refresh 메서드를 호출하여 변경 내용을 취소하거나 최신 정책을 가져올 수 있습니다.You can call the Refresh method to discard changes or to get the most current policy.

속성

AutoGrow

LogStore가 자동으로 증가할 수 있는지 여부를 나타내는 값을 가져오거나 설정합니다.Gets or sets a value indicating whether the LogStore can grow automatically.

AutoShrinkPercentage

LogStore에서 줄일 수 있는 여유 공간의 백분율을 가져오거나 설정합니다.Gets or sets the percentage of free space the LogStore can shrink.

GrowthRate

LogStore의 자동 증가 비율을 가져오거나 설정합니다.Gets or sets the rate of automatic growth of the LogStore.

MaximumExtentCount

LogExtent에 포함될 수 있는 최대 LogStore 인스턴스 수를 가져오거나 설정합니다.Gets or sets the maximum number of LogExtent instances the LogStore can contain.

MinimumExtentCount

LogExtent에 포함될 수 있는 최소 LogStore 인스턴스 수를 가져오거나 설정합니다.Gets or sets the minimum number of LogExtent instances the LogStore can contain.

NewExtentPrefix

자동으로 만들어진 범위에 대한 접두사 문자열을 가져오거나 설정합니다.Gets or sets the prefix string for automatically created extents.

NextExtentSuffix

새 범위에 대한 접미사 번호를 가져오거나 설정합니다.Gets or sets the suffix number for new extents.

PinnedTailThreshold

로그의 기준을 앞으로 이동하기 위해 TailPinned 이벤트에 필요한 공간의 크기를 가져오거나 설정합니다.Gets or sets the amount of space that the TailPinned event requires for advancing the base of the log.

메서드

Commit()

LogStore에 대한 현재 정책으로 이 정책을 설정합니다.Sets this policy as the current policy for the LogStore.

Equals(Object)

지정한 개체가 현재 개체와 같은지를 확인합니다.Determines whether the specified object is equal to the current object.

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

기본 해시 함수로 작동합니다.Serves as the default hash function.

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

현재 인스턴스의 Type을 가져옵니다.Gets the Type of the current instance.

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

현재 Object의 단순 복사본을 만듭니다.Creates a shallow copy of the current Object.

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

LogStore에 대한 현재 정책을 읽고 수행되었을 수 있는 변경 내용을 모두 취소합니다.Reads the current policy for the LogStore, discarding any changes that may have been made.

ToString()

현재 개체를 나타내는 string을 반환합니다.Returns a string that represents the current object.

(다음에서 상속됨 Object)

적용 대상