TailPinnedEventArgs 类

定义

TailPinned 事件提供数据。 此类不能被继承。

public ref class TailPinnedEventArgs sealed : EventArgs
public sealed class TailPinnedEventArgs : EventArgs
type TailPinnedEventArgs = class
    inherit EventArgs
Public NotInheritable Class TailPinnedEventArgs
Inherits EventArgs
继承
TailPinnedEventArgs

示例

下面的示例演示如何使用 TailPinned 事件来释放日志序列中的空间。

recordSequence.RetryAppend = true;  
recordSequence.TailPinned += new EventHandler<TailPinnedEventArgs>(HandleTailPinned);  

void HandleTailPinned(object sender, TailPinnedEventArgs tailPinnedEventArgs)  
{  
   // tailPinnedEventArgs.TargetSequenceNumber is the target   
   // sequence number to free up space to.    
   // However, this sequence number is not necessarily valid.  We have  
   // to use this sequence number as a starting point for finding a  
   // valid point within the log to advance toward. You need to  
   // identify a record with a sequence number equal to, or greater  
   // than TargetSequenceNumber; let's call this   
   // realTargetSequenceNumber. Once found, move the base  

   recordSequence.AdvanceBaseSequenceNumber(realTargetSequenceNumber);  

}  

注解

记录序列的空间不足时,会激发 TailPinned 事件。 此事件激发时,序列的尾数据(即基序列号)将前移以释放空间。

构造函数

TailPinnedEventArgs(SequenceNumber)

初始化 TailPinnedEventArgs 类的新实例。

属性

TargetSequenceNumber

获取尾部应移过的序列号。

方法

Equals(Object)

确定指定对象是否等于当前对象。

(继承自 Object)
GetHashCode()

作为默认哈希函数。

(继承自 Object)
GetType()

获取当前实例的 Type

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。

(继承自 Object)
ToString()

返回表示当前对象的字符串。

(继承自 Object)

适用于