PolicyUnit 구조체

정의

로그 저장소 정책의 크기 측정을 나타냅니다.

public value class PolicyUnit
public struct PolicyUnit
type PolicyUnit = struct
Public Structure PolicyUnit
상속
PolicyUnit

예제

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

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

설명

PolicyUnit 구조체는 로그 저장소 정책의 크기 측정을 나타냅니다. PolicyUnitType 열거형은 나타낼 수 있는 단위를 표시합니다.

Value 속성을 사용하여 측정 크기를 확인할 수 있습니다. 단위를 확인하려면 Type 속성을 사용합니다. PolicyUnitPercentage 메서드를 사용하여 다른 데이터 형식을 Extents로 변환할 수 있습니다.

생성자

PolicyUnit(Int64, PolicyUnitType)

지정된 값과 형식을 사용하여 PolicyUnit 구조체의 새 인스턴스를 초기화합니다.

속성

Type

PolicyUnit의 단위 형식을 가져옵니다.

Value

PolicyUnit의 값을 가져옵니다.

메서드

Equals(Object)

이 인스턴스와 지정된 개체가 같은지 여부를 나타냅니다.

Extents(Int64)

지정된 수에서 PolicyUnit 형식의 Extents를 만듭니다.

GetHashCode()

이 개체에 대한 고유한 해시 코드를 제공합니다.

Percentage(Int64)

지정된 수에서 PolicyUnit 형식의 Percentage를 만듭니다.

ToString()

이 개체의 문자열 표현을 반환합니다.

연산자

Equality(PolicyUnit, PolicyUnit)

PolicyUnit 인스턴스가 동일한지 비교합니다.

Inequality(PolicyUnit, PolicyUnit)

PolicyUnit 인스턴스가 동일하지 않은지 비교합니다.

적용 대상

추가 정보