LogPolicy LogPolicy LogPolicy LogPolicy Class

Definición

Representa la directiva asociada a LogStore.Represents the policy associated with a LogStore.

public ref class LogPolicy sealed
public sealed class LogPolicy
type LogPolicy = class
Public NotInheritable Class LogPolicy
Herencia
LogPolicyLogPolicyLogPolicyLogPolicy

Ejemplos

Este ejemplo muestra cómo utilizar la clase LogPolicy para establecer una directiva para una secuencia de registro de entrada.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
' 

Comentarios

Una directiva es un conjunto de reglas que seguirá una instancia de LogStore y sus clientes.A policy is a set of rules to be followed by a LogStore instance and its clients. Una instancia LogPolicy se utiliza para examinar y modificar la directiva asociada a un LogStoreespecífico.A LogPolicy instance is used to examine and modify the policy associated with a specific LogStore. Una directiva puede describir los tamaños máximo y mínimo permitidos del registro, o cómo se permite que crezca la instancia de LogStore puede crecer.A policy can describe the minimum and maximum allowable log sizes, or how the LogStore instance is allowed to grow. Además, también puede controlar si una instancia LogStore puede estar almacenada.In addition, you can also control whether a LogStore instance can be archived.

Después de cambiar cualquiera de las propiedades, debería utilizar el método Commit para asegurarse de que los cambios se aplican a LogStore.After changing any of the properties, you should use the Commit method to ensure that the changes are applied to the LogStore. Puede llamar al método Refresh para descartar los cambios u obtener la directiva más actual.You can call the Refresh method to discard changes or to get the most current policy.

Propiedades

AutoGrow AutoGrow AutoGrow AutoGrow

Obtiene o establece un valor que indica si LogStore puede crecer automáticamente.Gets or sets a value indicating whether the LogStore can grow automatically.

AutoShrinkPercentage AutoShrinkPercentage AutoShrinkPercentage AutoShrinkPercentage

Obtiene o establece el porcentaje de espacio disponible que LogStore puede reducir.Gets or sets the percentage of free space the LogStore can shrink.

GrowthRate GrowthRate GrowthRate GrowthRate

Obtiene o establece la tasa de crecimiento automático de LogStore.Gets or sets the rate of automatic growth of the LogStore.

MaximumExtentCount MaximumExtentCount MaximumExtentCount MaximumExtentCount

Obtiene o establece el número de instancias LogExtent que LogStore puede contenerGets or sets the maximum number of LogExtent instances the LogStore can contain.

MinimumExtentCount MinimumExtentCount MinimumExtentCount MinimumExtentCount

Obtiene o establece el número mínimo de instancias LogExtent que LogStore puede contenerGets or sets the minimum number of LogExtent instances the LogStore can contain.

NewExtentPrefix NewExtentPrefix NewExtentPrefix NewExtentPrefix

Obtiene o establece la cadena del prefijo para las extensiones automáticamente creadas.Gets or sets the prefix string for automatically created extents.

NextExtentSuffix NextExtentSuffix NextExtentSuffix NextExtentSuffix

Obtiene o establece el número del sufijo para las nuevas extensiones.Gets or sets the suffix number for new extents.

PinnedTailThreshold PinnedTailThreshold PinnedTailThreshold PinnedTailThreshold

Obtiene o establece la cantidad de espacio que el evento TailPinned requiere para avanzar la base del registro.Gets or sets the amount of space that the TailPinned event requires for advancing the base of the log.

Métodos

Commit() Commit() Commit() Commit()

Establece esta directiva como la directiva actual para LogStore.Sets this policy as the current policy for the LogStore.

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

Determina si el objeto especificado es igual al objeto actual.Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Sirve como la función hash predeterminada.Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Obtiene el Type de la instancia actual.Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Crea una copia superficial del objeto Object actual.Creates a shallow copy of the current Object.

(Inherited from Object)
Refresh() Refresh() Refresh() Refresh()

Lee la directiva actual para LogStore, descartando cualquier modificación que se puede haber realizado.Reads the current policy for the LogStore, discarding any changes that may have been made.

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

Devuelve una cadena que representa el objeto actual.Returns a string that represents the current object.

(Inherited from Object)

Se aplica a