Share via


Streamable.ReservoirSample<TPayload> Method

Definition

Streaming reservoir sampling extension (works only on a stream with ConstantDuration property set to true, and the duration set to StreamEvent.InfinitySyncTime, i.e., the stream has only start-edges)

public static Microsoft.StreamProcessing.IStreamable<Microsoft.StreamProcessing.Empty,TPayload> ReservoirSample<TPayload> (this Microsoft.StreamProcessing.IStreamable<Microsoft.StreamProcessing.Empty,TPayload> source, int reservoirSize, int randomSeed = 0);
static member ReservoirSample : Microsoft.StreamProcessing.IStreamable<Microsoft.StreamProcessing.Empty, 'Payload> * int * int -> Microsoft.StreamProcessing.IStreamable<Microsoft.StreamProcessing.Empty, 'Payload>
<Extension()>
Public Function ReservoirSample(Of TPayload) (source As IStreamable(Of Empty, TPayload), reservoirSize As Integer, Optional randomSeed As Integer = 0) As IStreamable(Of Empty, TPayload)

Type Parameters

TPayload

Input payload type

Parameters

source
IStreamable<Empty,TPayload>

Input stream

reservoirSize
Int32

Size of the reservoir

randomSeed
Int32

Random seed

Returns

IStreamable<Empty,TPayload>

Reservoir-sampled stream

Applies to