TailPinnedEventArgs 类

定义

TailPinned 事件提供数据。Provides data for the TailPinned event. 此类不能被继承。This class cannot be inherited.

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

示例

下面的示例演示如何使用 TailPinned 事件来释放日志序列中的空间。This example shows how to use the TailPinned event to free up space in a log sequence.

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 事件。The TailPinned event can be fired when the record sequence has run out of space. 此事件激发时,序列的尾数据(即基序列号)将前移以释放空间。When this event is fired, the tail of the sequence (that is, the base sequence number) is moved forward to free up space.

构造函数

TailPinnedEventArgs(SequenceNumber)

初始化 TailPinnedEventArgs 类的新实例。Initializes a new instance of the TailPinnedEventArgs class.

属性

TargetSequenceNumber

获取尾部应移过的序列号。Gets the sequence number that the tail should be moved past.

方法

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ToString()

返回一个表示当前对象的 string。Returns a string that represents the current object.

(继承自 Object)

适用于