You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Ryan Tao (Jira)" <ji...@apache.org> on 2020/08/18 05:13:00 UTC
[jira] [Commented] (FLINK-18982) InputFormat should remove
unnecessary override methods
[ https://issues.apache.org/jira/browse/FLINK-18982?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17179361#comment-17179361 ]
Ryan Tao commented on FLINK-18982:
----------------------------------
Someone could you help to take a look to see if it is a valid issue and i'm ready to fix it.
> InputFormat should remove unnecessary override methods
> ------------------------------------------------------
>
> Key: FLINK-18982
> URL: https://issues.apache.org/jira/browse/FLINK-18982
> Project: Flink
> Issue Type: Improvement
> Components: API / Core
> Affects Versions: 1.11.1
> Reporter: Ryan Tao
> Priority: Major
> Labels: pull-request-available
>
> _InputFormat_ has inherited from _InputSplitSource_. Based on basic Java knowledge, these two methods do not need to be written here, which may easily lead to ambiguity.
> And the behavior of these two methods should belong to _InputSplitSource_ instead of _InputFormat. (about split)_
> InputFormat:
> {code:java}
> public interface InputFormat<OT, T extends InputSplit> extends InputSplitSource<T>, Serializable {
> ...
> @Override
> T[] createInputSplits(int minNumSplits) throws IOException;
> @Override
> InputSplitAssigner getInputSplitAssigner(T[] inputSplits);
> ...
> }
> {code}
> InputSplitSource:
> {code:java}
> public interface InputSplitSource<T extends InputSplit> extends Serializable {
> T[] createInputSplits(int minNumSplits) throws Exception;
> InputSplitAssigner getInputSplitAssigner(T[] inputSplits);
> }{code}
> As for the reason, watching the commit history, we can find that these two methods appeared in _InputFormat_ before _InputSplitSource_. Later, they were taken to InputSplitSource separately, but they were not removed in _InputFormat_.
> Another point is that the InputSplitSource throws an Exception, as it should be. (Subclasses of InputFormat throw specific exception.)
--
This message was sent by Atlassian Jira
(v8.3.4#803005)