zhijiangW commented on a change in pull request #9475: [FLINK-13762][task] Add 
the exception throwable in the interface methods of ValveOutputHandler
URL: https://github.com/apache/flink/pull/9475#discussion_r317042507
 
 

 ##########
 File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/streamstatus/ForwardingValveOutputHandler.java
 ##########
 @@ -0,0 +1,56 @@
+/*
+ * 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.streamstatus;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.streaming.api.watermark.Watermark;
+import 
org.apache.flink.streaming.runtime.streamstatus.StatusWatermarkValve.ValveOutputHandler;
+import org.apache.flink.util.function.ThrowingConsumer;
+
+import static org.apache.flink.util.Preconditions.checkNotNull;
+
+/**
+ * A unified implementation of {@link ValveOutputHandler} which is called by 
the
+ * {@link StatusWatermarkValve} only when it determines a new watermark or 
stream
+ * status can be propagated.
+ */
+@Internal
+public class ForwardingValveOutputHandler implements ValveOutputHandler {
 
 Review comment:
   The initial motivation to do this is for getting rid of dependency between 
two `ForwardingValveOutputHandler` instances while toggling the stream status. 
If one instance is preparing for toggling the idle status, it has to check 
another instance whether it is also idle.
   
   So I tried to refactor this logic in upper layer for implementing a separate 
unified `ForwardingValveOutputHandler`, but the retry fails and I just keeps 
this form.
   
   I agree it is not necessary to do this change now and I would revert it to 
only keep the exception as you suggested above.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to