/** * Write skipped late arriving element to SideOutput. * * @param element skipped late arriving element to side output */ protected void sideOutput(StreamRecord<IN> element){ output.collect(lateDataOutputTag, element); }
@Override public void collect(StreamRecord<T> record) { for (Output<StreamRecord<T>> output : outputs) { output.collect(record); } }
@Override public void processElement(StreamRecord<IN> record) throws Exception { output.collect(record); }
@Override public <X> void collect(OutputTag<X> outputTag, StreamRecord<X> record) { for (Output<StreamRecord<T>> output : outputs) { output.collect(outputTag, record); } }
@Override public void collect(StreamRecord<T> record) { for (int i = 0; i < outputs.length - 1; i++) { Output<StreamRecord<T>> output = outputs[i]; StreamRecord<T> shallowCopy = record.copy(record.getValue()); output.collect(shallowCopy); } if (outputs.length > 0) { // don't copy for the last output outputs[outputs.length - 1].collect(record); } }
@Override public void collect(StreamRecord<OUT> record) { numRecordsOut.inc(); output.collect(record); }
@Override public <X> void collect(OutputTag<X> outputTag, StreamRecord<X> record) { numRecordsOut.inc(); output.collect(outputTag, record); }
@Override public void processElement2(StreamRecord<Integer> element) throws Exception { output.collect(element); }
@Override public void processElement(StreamRecord<String> element) throws Exception { output.collect(element); }
@Override public void processElement2(StreamRecord<IN2> element) throws Exception { output.collect(element.replace(userFunction.map2(element.getValue()))); } }
@Override public void processElement(StreamRecord<Integer> element) throws Exception { if (element.hasTimestamp()) { Assert.fail("Timestamps are not properly handled."); } output.collect(element); } }
@Override public void processElement(StreamRecord<T> element) throws Exception { final long newTimestamp = userFunction.extractTimestamp(element.getValue(), element.hasTimestamp() ? element.getTimestamp() : Long.MIN_VALUE); output.collect(element.replace(element.getValue(), newTimestamp)); }
@Override public void onEventTime(InternalTimer<Integer, VoidNamespace> timer) throws Exception { String stateValue = getPartitionedState(stateDescriptor).value(); output.collect(new StreamRecord<>("ON_EVENT_TIME:" + stateValue)); }
@Override public void onProcessingTime(InternalTimer<Integer, VoidNamespace> timer) throws Exception { String stateValue = getPartitionedState(stateDescriptor).value(); output.collect(new StreamRecord<>("ON_PROC_TIME:" + stateValue)); } }
@Override public void processElement(StreamRecord<T> element) throws Exception { long newTimestamp = userFunction.extractTimestamp(element.getValue(), element.getTimestamp()); output.collect(element.replace(element.getValue(), newTimestamp)); long watermark = userFunction.extractWatermark(element.getValue(), newTimestamp); if (watermark > currentWatermark) { currentWatermark = watermark; output.emitWatermark(new Watermark(currentWatermark)); } }
@Override public void processElement(StreamRecord<T> element) throws Exception { final T value = element.getValue(); final long newTimestamp = userFunction.extractTimestamp(value, element.hasTimestamp() ? element.getTimestamp() : Long.MIN_VALUE); output.collect(element.replace(element.getValue(), newTimestamp)); final Watermark nextWatermark = userFunction.checkAndGetNextWatermark(value, newTimestamp); if (nextWatermark != null && nextWatermark.getTimestamp() > currentWatermark) { currentWatermark = nextWatermark.getTimestamp(); output.emitWatermark(nextWatermark); } }
@Override public void processElement(StreamRecord<Tuple2<Long, Long>> element) throws Exception { ValueState<Long> state = getKeyedStateBackend().getPartitionedState( element.getValue().f0, LongSerializer.INSTANCE, stateDescriptor); assertEquals(state.value(), element.getValue().f1); getRuntimeContext().getAccumulator(SUCCESSFUL_PROCESS_CHECK_ACCUMULATOR).add(1); output.collect(element); }
@Override public void processElement(StreamRecord<Tuple2<Long, Long>> element) throws Exception { ValueState<Long> state = getKeyedStateBackend().getPartitionedState( element.getValue().f0, LongSerializer.INSTANCE, stateDescriptor); assertEquals(state.value(), element.getValue().f1); getRuntimeContext().getAccumulator(SUCCESSFUL_PROCESS_CHECK_ACCUMULATOR).add(1); output.collect(element); }