AHeise commented on a change in pull request #17501: URL: https://github.com/apache/flink/pull/17501#discussion_r768390250
########## File path: flink-connectors/flink-connector-files/src/main/java/org/apache/flink/connector/file/src/reader/StreamFormat.java ########## @@ -157,6 +166,88 @@ long splitEnd) throws IOException; + /** + * Creates a new reader to read in this format. This method is called when a fresh reader is + * created for a split that was assigned from the enumerator. This method may also be called on + * recovery from a checkpoint, if the reader never stored an offset in the checkpoint (see + * {@link #restoreReader(Configuration, Path, long, long, long)} for details. + * + * <p>Provide the default implementation, subclasses are therefore not forced to implement it. + * Compare to the {@link #createReader(Configuration, FSDataInputStream, long, long)}, This + * method put the focus on the {@link Path}. The default implementation adapts information given + * by method arguments to {@link FSDataInputStream} and calls {@link + * #createReader(Configuration, FSDataInputStream, long, long)}. + * + * <p>If the format is {@link #isSplittable() splittable}, then the {@code inputStream} is + * positioned to the beginning of the file split, otherwise it will be at position zero. + */ + default StreamFormat.Reader<T> createReader( + Configuration config, Path filePath, long splitOffset, long splitLength) + throws IOException { Review comment: Do you mean `StreamFormatAdapter`? I don't see any changes in this PR that calls this method. For me, this currently looks like dead code then. -- 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: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org