LogPolicy クラス
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
LogStoreに関連付けられているポリシーを表します。
public ref class LogPolicy sealed
public sealed class LogPolicy
type LogPolicy = class
Public NotInheritable Class LogPolicy
- 継承
-
LogPolicy
例
この例では、 LogPolicy クラスを使用してログ レコード シーケンスのポリシーを設定する方法を示します。
// 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
'
注釈
ポリシーは、 LogStore インスタンスとそのクライアントの後に続く一連の規則です。 LogPolicy インスタンスは、特定のLogStoreに関連付けられているポリシーを調べて変更するために使用されます。 ポリシーでは、許容される最小ログ サイズと最大ログ サイズ、または LogStore インスタンスの拡張を許可する方法を記述できます。 さらに、 LogStore インスタンスをアーカイブできるかどうかを制御することもできます。
プロパティを変更した後は、 Commit メソッドを使用して、変更が LogStoreに適用されるようにする必要があります。 Refresh メソッドを呼び出して変更を破棄するか、最新のポリシーを取得できます。
プロパティ
| 名前 | 説明 |
|---|---|
| AutoGrow |
LogStoreを自動的に拡張できるかどうかを示す値を取得または設定します。 |
| AutoShrinkPercentage |
LogStoreが縮小できる空き領域の割合を取得または設定します。 |
| GrowthRate |
LogStoreの自動増加率を取得または設定します。 |
| MaximumExtentCount | |
| MinimumExtentCount | |
| NewExtentPrefix |
自動的に作成されるエクステントのプレフィックス文字列を取得または設定します。 |
| NextExtentSuffix |
新しいエクステントのサフィックス番号を取得または設定します。 |
| PinnedTailThreshold |
TailPinned イベントがログのベースを進めるのに必要な領域の量を取得または設定します。 |
メソッド
| 名前 | 説明 |
|---|---|
| Commit() |
このポリシーを、 LogStoreの現在のポリシーとして設定します。 |
| Equals(Object) |
指定したオブジェクトが現在のオブジェクトと等しいかどうかを判断します。 (継承元 Object) |
| GetHashCode() |
既定のハッシュ関数として機能します。 (継承元 Object) |
| GetType() |
現在のインスタンスの Type を取得します。 (継承元 Object) |
| MemberwiseClone() |
現在の Objectの簡易コピーを作成します。 (継承元 Object) |
| Refresh() |
LogStoreの現在のポリシーを読み取り、行われた可能性のある変更を破棄します。 |
| ToString() |
現在のオブジェクトを表す文字列を返します。 (継承元 Object) |