TanYuxin-tyx commented on code in PR #22804: URL: https://github.com/apache/flink/pull/22804#discussion_r1233846973
########## flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/hybrid/tiered/storage/file/PartitionFileIndex.java: ########## @@ -0,0 +1,109 @@ +/* + * 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.io.network.partition.hybrid.tiered.storage.file; + +import org.apache.flink.runtime.io.network.partition.hybrid.tiered.netty.NettyConnectionId; + +import java.util.List; +import java.util.Optional; + +/** + * The {@link PartitionFileIndex} represents the indexes and the regions of the spilled buffers. For + * each spilled data buffer, this maintains the subpartition it belongs to, the buffer index within + * the subpartition, the offset in file it begin with. The {@link Region} represents a series of + * physically continuous buffers in the file, which are from the same subpartition. + */ +public interface PartitionFileIndex { + + /** + * When writing the buffers to the partition file, the {@link PartitionFileIndex} should record + * the {@link Region} info of these spilled buffers. + * + * @param spilledBuffers the buffers to be spilled + */ + void addRegionForBuffers(List<SpilledBuffer> spilledBuffers); Review Comment: 1. Rename the method to `generateRegionsBasedOnBuffers` and added detailed doc about the method. ########## flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/hybrid/tiered/storage/file/PartitionFileIndex.java: ########## @@ -0,0 +1,109 @@ +/* + * 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.io.network.partition.hybrid.tiered.storage.file; + +import org.apache.flink.runtime.io.network.partition.hybrid.tiered.netty.NettyConnectionId; + +import java.util.List; +import java.util.Optional; + +/** + * The {@link PartitionFileIndex} represents the indexes and the regions of the spilled buffers. For + * each spilled data buffer, this maintains the subpartition it belongs to, the buffer index within + * the subpartition, the offset in file it begin with. The {@link Region} represents a series of + * physically continuous buffers in the file, which are from the same subpartition. + */ +public interface PartitionFileIndex { + + /** + * When writing the buffers to the partition file, the {@link PartitionFileIndex} should record + * the {@link Region} info of these spilled buffers. + * + * @param spilledBuffers the buffers to be spilled + */ + void addRegionForBuffers(List<SpilledBuffer> spilledBuffers); Review Comment: Rename the method to `generateRegionsBasedOnBuffers` and added detailed doc about the method. -- 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]
