flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [flink] azagrebin commented on a change in pull request #7549: [FLINK-11403][network] Introduce ResultPartitionWithConsumableNotifier in task for notifying consumable result partition
Date Tue, 28 May 2019 15:53:42 GMT
azagrebin commented on a change in pull request #7549: [FLINK-11403][network] Introduce ResultPartitionWithConsumableNotifier
in task for notifying consumable result partition
URL: https://github.com/apache/flink/pull/7549#discussion_r288172272
 
 

 ##########
 File path: flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/ResultPartitionWithConsumableNotifier.java
 ##########
 @@ -0,0 +1,145 @@
+/*
+ * 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.runtime.taskmanager;
+
+import org.apache.flink.api.common.JobID;
+import org.apache.flink.runtime.io.network.api.writer.ResultPartitionWriter;
+import org.apache.flink.runtime.io.network.buffer.BufferConsumer;
+import org.apache.flink.runtime.io.network.buffer.BufferProvider;
+import org.apache.flink.runtime.io.network.partition.ResultPartitionConsumableNotifier;
+import org.apache.flink.runtime.io.network.partition.ResultPartitionID;
+import org.apache.flink.runtime.io.network.partition.ResultPartitionType;
+
+import java.io.IOException;
+
+import static org.apache.flink.util.Preconditions.checkNotNull;
+
+/**
+ * This class wraps {@link ResultPartitionWriter} provided by shuffle service and it is
+ * mainly used for handling the logic of consumable notification.
+ *
+ * <p>Before a consuming task can request the result, it has to be deployed. The time
of deployment
+ * depends on the PIPELINED vs. BLOCKING characteristic of the result partition. With pipelined
+ * results, receivers are deployed as soon as the first buffer is added to the result partition.
+ * With blocking results on the other hand, receivers are deployed after the partition is
finished.
+ */
+public class ResultPartitionWithConsumableNotifier implements ResultPartitionWriter {
+
+	private final TaskActions taskActions;
+
+	private final JobID jobId;
+
+	private final ResultPartitionWriter partitionWriter;
+
+	private final ResultPartitionConsumableNotifier partitionConsumableNotifier;
+
+	private final boolean sendScheduleOrUpdateConsumersMessage;
 
 Review comment:
    I would suggest we do not have this flag `sendScheduleOrUpdateConsumersMessage` here but
use it as a condition whether to wrap original `ResultPartitionWriter` in the `Task` constructor
at all because it seems we do nothing here if `sendScheduleOrUpdateConsumersMessage` is `false`.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message