PolicyUnit PolicyUnit PolicyUnit PolicyUnit Struct

Definizione

Rappresenta una misura della dimensione nei criteri dell'archivio dei log.Represents a size measurement in a log store policy.

public value class PolicyUnit
public struct PolicyUnit
type PolicyUnit = struct
Public Structure PolicyUnit
Ereditarietà
PolicyUnitPolicyUnitPolicyUnitPolicyUnit

Esempi

In questo esempio viene illustrato come utilizzare la classe LogPolicy e la struttura PolicyUnit per impostare criteri per una sequenza di record del registro.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
' 

Commenti

La struttura PolicyUnit rappresenta una misura della dimensione nei criteri dell'archivio dei log.The PolicyUnit structure represents a size measurement in a log store policy. L'enumerazione PolicyUnitType elenca le unità di misura che possono essere rappresentate.The PolicyUnitType enumeration lists the units of measurement that can be represented.

Per determinare la dimensione della misura, è possibile utilizzare la proprietà Value.You can use the Value property to determine the size of the measurement. Per determinare l'unità di misura, utilizzare la proprietà Type.To determine the unit of measurement, use the Type property. È possibile convertire altri tipi di dati in una struttura PolicyUnit utilizzando i metodi Percentage e Extents.You can convert other data types to a PolicyUnit by using the Percentage and Extents methods.

Costruttori

PolicyUnit(Int64, PolicyUnitType) PolicyUnit(Int64, PolicyUnitType) PolicyUnit(Int64, PolicyUnitType) PolicyUnit(Int64, PolicyUnitType)

Inizializza una nuova istanza della struttura PolicyUnit con il valore e il tipo specificati.Initializes a new instance of the PolicyUnit structure with the specified value and type.

Proprietà

Type Type Type Type

Ottiene il tipo di unità dell'oggetto PolicyUnit.Gets the unit type of the PolicyUnit.

Value Value Value Value

Ottiene il valore dell'oggetto PolicyUnit.Gets the value of the PolicyUnit.

Metodi

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Indica se questa istanza e un oggetto specificato sono uguali.Indicates whether this instance and a specified object are equal.

Extents(Int64) Extents(Int64) Extents(Int64) Extents(Int64)

Crea una struttura PolicyUnit di tipo Extents a partire dal numero specificato.Creates a PolicyUnit of type Extents from the specified number.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Fornisce un codice hash univoco per questo oggetto.Provides a unique hash code for this object.

Percentage(Int64) Percentage(Int64) Percentage(Int64) Percentage(Int64)

Crea una struttura PolicyUnit di tipo Percentage a partire dal numero specificato.Creates a PolicyUnit of type Percentage from the specified number.

ToString() ToString() ToString() ToString()

Restituisce una rappresentazione sotto forma di stringa dell'oggetto corrente.Returns a string representation of this object.

Operatori

Equality(PolicyUnit, PolicyUnit) Equality(PolicyUnit, PolicyUnit) Equality(PolicyUnit, PolicyUnit) Equality(PolicyUnit, PolicyUnit)

Confronta due istanze PolicyUnit per determinarne l'uguaglianza.Compares two PolicyUnit instances to determine whether they are equal.

Inequality(PolicyUnit, PolicyUnit) Inequality(PolicyUnit, PolicyUnit) Inequality(PolicyUnit, PolicyUnit) Inequality(PolicyUnit, PolicyUnit)

Confronta due istanze PolicyUnit per determinare se sono diverse.Compares two PolicyUnit instances to determine whether they are not equal.

Si applica a

Vedi anche