Mmuzaf commented on a change in pull request #5619: IGNITE-10619: CommunicationSpi support channels initial commit URL: https://github.com/apache/ignite/pull/5619#discussion_r292093533 ########## File path: modules/core/src/main/java/org/apache/ignite/internal/managers/communication/transmit/FileHandler.java ########## @@ -0,0 +1,46 @@ +/* + * 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.ignite.internal.managers.communication.transmit; + +import java.io.File; +import java.io.IOException; +import java.io.Serializable; +import java.util.Map; + +/** + * The {@code FileHandler} represents by itself the way of input data stream processing. All the data will + * be processed under the hood using zero-copy transferring algorithm and only start file processing and + * the end of processing will be provided. + */ +public interface FileHandler { + /** + * @param name The file name transfer from. + * @param pos The start pos pointer of download file in original source. + * @param cnt Total cnt of bytes readed from the original source. + * @param params The additional transfer file description params. + * @return The absolute pathname string denoting the file or {@code null} if there is no sense. + * @throws IOException If fails. + */ + public String begin(String name, long pos, long cnt, Map params) throws IOException; Review comment: 1. I've renamed it to `fileAbsoultePath` as it returns a file path. 2. pos - renamed to offset, cnt - renamed to size. These parameters used when we send a file not from the beginning but from a special offset (e.g. we can transfer a part of the same file placed on different nodes) ---------------------------------------------------------------- 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