1996fanrui commented on code in PR #28107:
URL: https://github.com/apache/flink/pull/28107#discussion_r3197614037


##########
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/channel/FilteredBufferDispatcher.java:
##########
@@ -0,0 +1,53 @@
+/*
+ * 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.checkpoint.channel;
+
+import org.apache.flink.annotation.Internal;
+
+import java.io.IOException;
+
+/**
+ * Dispatches filtered channel-state data across multiple channels' {@link
+ * 
org.apache.flink.runtime.io.network.partition.consumer.RecoveredBufferStore}s. 
{@link
+ * #write(byte[], int, InputChannelInfo)} pushes data for a target channel; 
the implementation
+ * decides whether to use a network buffer (P1), spill to disk (P2), or replay 
from disk (P3).
+ */
+@Internal
+public interface FilteredBufferDispatcher extends AutoCloseable {
+
+    void write(byte[] data, int length, InputChannelInfo channelInfo)
+            throws IOException, InterruptedException;

Review Comment:
   2 reasons for the current code:
   
   - For non-filtering(Non-Rescale) case, the `pre-filter` buffer is heap 
buffer.
   - For filtering case, dispatcher will request a network buffer when cache is 
full.
     - If the request is failed, it will be dispatch the buffer(cached data) to 
disk
     - If the request is successful, it will write the cached data to network 
buffer



-- 
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