Represents a size measurement in a log store policy.
Assembly: System.IO.Log (in System.IO.Log.dll)
Thetype exposes the following members.
|Equals||Indicates whether this instance and a specified object are equal. (Overrides ValueType.Equals(Object).)|
|Extents||Creates a of type Extents from the specified number.|
|GetHashCode||Provides a unique hash code for this object. (Overrides ValueType.GetHashCode().)|
|GetType||Gets the Type of the current instance. (Inherited from Object.)|
|Percentage||Creates a of type Percentage from the specified number.|
|ToString||Returns a string representation of this object. (Overrides ValueType.ToString().)|
The structure represents a size measurement in a log store policy. The PolicyUnitType enumeration lists the units of measurement that can be represented.
You can use the Value property to determine the size of the measurement. To determine the unit of measurement, use the Type property. You can convert other data types to a by using the Percentage and Extents methods.
This example shows how to use the LogPolicy class and 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 //
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.