AHeise commented on a change in pull request #9735: [FLINK-14156][runtime] 
Submit timer trigger letters to task's mailbox with operator's precedence
URL: https://github.com/apache/flink/pull/9735#discussion_r330464428
 
 

 ##########
 File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/TimerService.java
 ##########
 @@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.runtime.tasks;
+
+import org.apache.flink.annotation.Internal;
+
+/**
+ *
+ * <p>The registration of timers follows a life cycle of three phases:
+ * <ol>
+ *     <li>In the initial state, it accepts timer registrations and triggers 
when the time is reached.</li>
+ *     <li>After calling {@link #quiesce()}, further calls to
+ *         {@link #registerTimer(long, ProcessingTimeCallback)} will not 
register any further timers, and will
+ *         return a "dummy" future as a result. This is used for clean 
shutdown, where currently firing
+ *         timers are waited for and no future timers can be scheduled, 
without causing hard exceptions.</li>
+ *     <li>After a call to {@link #shutdownService()}, all calls to {@link 
#registerTimer(long, ProcessingTimeCallback)}
+ *         will result in a hard exception.</li>
+ * </ol>
+ */
+@Internal
+public interface TimerService extends ProcessingTimeService {
 
 Review comment:
   The naming is not really clear:
   * What's the difference between TimerService and TimeService?
   * Usually, names get rather longer than shorter in a hierarchy ;)
   
   I guess TimerService is more plausible but you wanted to keep the 
user-facing interface unchanged.
   
   For me, it feels as if these life-cycle methods keep reappearing at 
different points (Mailbox, Timer, ...). How about we make this interface more 
general purpose? Just call it Lifecycle and don't extend ProcessingTimeService. 
Then we can add this internal interface to different classes later. That's 
quite common in logger and network frameworks.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to