示例#1
0
 private static String GenerateOperatorName <TE, TW>(
     WindowAssigner <TE, TW> assigner,
     WindowTrigger <TE, TW> trigger,
     IWindowEvictor <TE, TW> evictor,
     IFunction function1,
     IFunction function2) where TW : Window
 {
     return("Window(" +
            assigner + ", " +
            trigger.GetType().Name + ", " +
            (evictor == null ? "" : (evictor.GetType().Name + ", ")) +
            GenerateFunctionName(function1) +
            (function2 == null ? "" : (", " + GenerateFunctionName(function2))) +
            ")");
 }
示例#2
0
 public WindowContext(TWindow window,
                      WindowAssigner <TInput, TWindow> windowAssigner,
                      AbstractKeyedStateBackend <TKey> keyedStateBackend,
                      ExecutionConfig executionConfig,
                      IInternalTimerService <TWindow> internalTimerService,
                      IOutput <StreamRecord <TOutput> > output,
                      WindowOperator <TKey, TInput, TAccumulator, TOutput, TWindow> windowOperator)
 {
     Window = window;
     _internalTimerService = internalTimerService;
     _output          = output;
     _windowOperator  = windowOperator;
     WindowStateStore = windowAssigner is MergingWindowAssigner <TInput, TWindow>
                        ?(AbstractPerWindowStateStore) new MergingWindowStateStore(keyedStateBackend, executionConfig)
                            : new PerWindowStateStore(keyedStateBackend, executionConfig);
 }
示例#3
0
 /// <summary>
 /// Windows this data stream to a <see cref="AllWindowedStream{TElement,TWindow}"/>, which evaluates windows over a non key grouped stream. Elements are put into windows by a <see cref="WindowAssigner{TElement,TWindow}"/>. The grouping of elements is done by window.
 /// Note: This operation is inherently non-parallel since all elements have to pass through the same operator instance.
 /// </summary>
 /// <typeparam name="TWindow"></typeparam>
 /// <param name="assigner">The <see cref="WindowAssigner{TElement,TWindow}"/> that assigns elements to windows.</param>
 /// <returns>The trigger windows data stream.</returns>
 public AllWindowedStream <TElement, TWindow> WindowAll <TWindow>(WindowAssigner <TElement, TWindow> assigner)
     where TWindow : Window => new AllWindowedStream <TElement, TWindow>(this, assigner);
示例#4
0
 /// <summary>
 /// Windows this data stream to a <see cref="WindowedStream{T,TK,TW}"/>, which evaluates windows over a key grouped stream. Elements are put into windows by a <see cref="WindowAssigner{T,TW}"/>. The grouping of elements is done both by key and by window.
 /// </summary>
 /// <typeparam name="TW"></typeparam>
 /// <param name="assigner">The WindowAssigner that assigns elements to windows.</param>
 /// <returns>The trigger windows data stream.</returns>
 public WindowedStream <TElement, TKey, TW> Window <TW>(WindowAssigner <TElement, TW> assigner)
     where TW : Window
 {
     return(new WindowedStream <TElement, TKey, TW>(this, assigner));
 }
示例#5
0
 public AllWindowedStream(DataStream <TElement> input, WindowAssigner <TElement, TWindow> windowAssigner)
 {
     _assigner = windowAssigner;
     _trigger  = windowAssigner.GetDefaultTrigger(input.ExecutionEnvironment);
 }
示例#6
0
 public WindowedStream(KeyedStream <TElement, TKey> input, WindowAssigner <TElement, TWindow> windowAssigner)
 {
     _input    = input;
     _assigner = windowAssigner;
     _trigger  = windowAssigner.GetDefaultTrigger(input.ExecutionEnvironment);
 }