Share via


CountByStartTimeWindow(TPayload) 方法 (CepStream(TPayload), UInt32, CountWindowOutputPolicy)

根據給定的唯一事件啟動次數,將輸入資料流事件分組到事件的視窗。當在不同時間啟動的新事件抵達時,此視窗會滑動。

命名空間:  Microsoft.ComplexEventProcessing.Linq
組件:  Microsoft.ComplexEventProcessing (在 Microsoft.ComplexEventProcessing.dll 中)

語法

public static CepWindowStream<CepWindow<TPayload>> CountByStartTimeWindow<TPayload>(
    this CepStream<TPayload> source,
    uint numberOfEventStartTime,
    CountWindowOutputPolicy outputPolicy
)

型別參數

  • TPayload
    輸入事件裝載的類型。

參數

  • numberOfEventStartTime
    型別:System. . :: . .UInt32
    依據唯一事件開始時間數目的視窗大小。

傳回值

型別:Microsoft.ComplexEventProcessing.Linq. . :: . .CepWindowStream< (Of < ( <'CepWindow< (Of < ( <'TPayload> ) > ) >> ) > ) >
可以對其套用彙總、排名或使用者定義作業的視窗資料流。

使用注意事項

在 Visual Basic 及 C# 中,您可以在任何型別 CepStream< (Of < ( <'TPayload> ) > ) > 的物件上將這個方法做為執行個體方法呼叫。使用執行個體方法語法呼叫這個方法時,請省略第一個參數。如需詳細資訊,請參閱 https://msdn.microsoft.com/zh-tw/library/bb384936(v=sql.105)https://msdn.microsoft.com/zh-tw/library/bb383977(v=sql.105)

備註

視窗頂端集合式作業之結果的預設輸出原則是,建立對齊視窗結束時間的時間點事件。如需有關視窗的詳細資訊,請參閱<使用事件視窗>和<計數視窗>。

範例

var agg = from w in inputStream.CountByStartTimeWindow(10, WindowOutputPolicy.ClipToWindowEnd)
          select new { sum = w.Sum(e => e.i) };

請參閱

參考

CepStream 類別

CountByStartTimeWindow 多載

Microsoft.ComplexEventProcessing.Linq 命名空間