NicoK commented on a change in pull request #36:
URL: https://github.com/apache/flink-training/pull/36#discussion_r700363353



##########
File path: 
long-ride-alerts/src/solution/java/org/apache/flink/training/solutions/longrides/LongRidesSolution.java
##########
@@ -115,31 +115,31 @@ public void processElement(TaxiRide ride, Context 
context, Collector<Long> out)
                 throws Exception {
 
             TaxiRide firstRideEvent = rideState.value();
-
             if (firstRideEvent == null) {
+                // whatever event comes first, remember it
                 rideState.update(ride);
 
                 if (ride.isStart) {
+                    // we will use this timer to check for rides that have 
gone on too long and may
+                    // not yet have an END event (or the END event could be 
missing)
                     
context.timerService().registerEventTimeTimer(getTimerTime(ride));
-                } else {
-                    if (rideTooLong(ride)) {
-                        out.collect(ride.rideId);
-                    }
                 }

Review comment:
       True, you won't know how long a ride was, but you can identify a late 
START event at least (and maybe put it on a side output for error handling - a 
best practice in these cases but not sure you want to add this here




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to