Esempio n. 1
0
 def wrapped_func(value):
     # VALUE[CURRENT_TIMESTAMP, CURRENT_WATERMARK, NORMAL_DATA]
     timestamp = value[0]
     watermark = value[1]
     ctx.set_timestamp(timestamp)
     ctx.timer_service().advance_watermark(watermark)
     results = process_element(value[2], ctx)
     yield from _emit_results(timestamp, watermark, results)
Esempio n. 2
0
            def wrapped_func(value):
                # VALUE[CURRENT_TIMESTAMP, CURRENT_WATERMARK, [isLeft, leftInput, rightInput]]
                timestamp = value[0]
                watermark = value[1]
                ctx.set_timestamp(timestamp)
                ctx.timer_service().advance_watermark(watermark)

                normal_data = value[2]
                if normal_data[0]:
                    results = process_element1(normal_data[1], ctx)
                else:
                    results = process_element2(normal_data[2], ctx)

                yield from _emit_results(timestamp, watermark, results)
Esempio n. 3
0
            def wrapped_func(value):
                # VALUE[CURRENT_TIMESTAMP, CURRENT_WATERMARK,
                #   [isNormal, normalInput, broadcastInput]]
                timestamp = value[0]
                watermark = value[1]
                broadcast_ctx.set_timestamp(timestamp)
                cast(
                    TimerServiceImpl,
                    broadcast_ctx.timer_service()).advance_watermark(watermark)
                read_only_broadcast_ctx.set_timestamp(timestamp)
                cast(
                    TimerServiceImpl,
                    read_only_broadcast_ctx.timer_service()).advance_watermark(
                        watermark)

                data = value[2]
                if data[0]:
                    results = process_element(data[1], read_only_broadcast_ctx)
                else:
                    results = process_broadcast_element(data[2], broadcast_ctx)
                yield from _emit_results(timestamp, watermark, results,
                                         has_side_output)