PolicyUnit 구조체

정의

로그 저장소 정책의 크기 측정을 나타냅니다.Represents a size measurement in a log store policy.

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

예제

이 예제에서는 LogPolicy 클래스와 PolicyUnit 구조체를 사용하여 로그 레코드 시퀀스에 대한 정책을 설정하는 방법을 보여 줍니다.This example shows how to use the LogPolicy class and PolicyUnit structure 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
' 

설명

PolicyUnit 구조체는 로그 저장소 정책의 크기 측정을 나타냅니다.The PolicyUnit structure represents a size measurement in a log store policy. PolicyUnitType 열거형은 나타낼 수 있는 단위를 표시합니다.The PolicyUnitType enumeration lists the units of measurement that can be represented.

Value 속성을 사용하여 측정 크기를 확인할 수 있습니다.You can use the Value property to determine the size of the measurement. 단위를 확인하려면 Type 속성을 사용합니다.To determine the unit of measurement, use the Type property. PolicyUnitPercentage 메서드를 사용하여 다른 데이터 형식을 Extents로 변환할 수 있습니다.You can convert other data types to a PolicyUnit by using the Percentage and Extents methods.

생성자

PolicyUnit(Int64, PolicyUnitType)

지정된 값과 형식을 사용하여 PolicyUnit 구조체의 새 인스턴스를 초기화합니다.Initializes a new instance of the PolicyUnit structure with the specified value and type.

속성

Type

PolicyUnit의 단위 형식을 가져옵니다.Gets the unit type of the PolicyUnit.

Value

PolicyUnit의 값을 가져옵니다.Gets the value of the PolicyUnit.

메서드

Equals(Object)

이 인스턴스와 지정된 개체가 같은지 여부를 나타냅니다.Indicates whether this instance and a specified object are equal.

Extents(Int64)

지정된 수에서 PolicyUnit 형식의 Extents를 만듭니다.Creates a PolicyUnit of type Extents from the specified number.

GetHashCode()

이 개체에 대한 고유한 해시 코드를 제공합니다.Provides a unique hash code for this object.

Percentage(Int64)

지정된 수에서 PolicyUnit 형식의 Percentage를 만듭니다.Creates a PolicyUnit of type Percentage from the specified number.

ToString()

이 개체의 문자열 표현을 반환합니다.Returns a string representation of this object.

연산자

Equality(PolicyUnit, PolicyUnit)

PolicyUnit 인스턴스가 동일한지 비교합니다.Compares two PolicyUnit instances to determine whether they are equal.

Inequality(PolicyUnit, PolicyUnit)

PolicyUnit 인스턴스가 동일하지 않은지 비교합니다.Compares two PolicyUnit instances to determine whether they are not equal.

적용 대상

추가 정보