[ https://issues.apache.org/jira/browse/HDFS-10556?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15343858#comment-15343858 ]
Mingliang Liu edited comment on HDFS-10556 at 6/22/16 7:47 AM: --------------------------------------------------------------- The v0 patch simply calls the {{validate()}} private method in setters of the dependent (or exclusive) options. The basic idea is kinda similar to the code before [HDFS-10397]. It also adds a new unit test to test constructing {{DistCpOptions}} manually with setters. Its test cases are very similar to the parser test in {{TestOptionsParser}}, except those who are validated in parser instead of the {{DistCpOptions#validate()}}. was (Author: liuml07): The v0 patch simply calls the {{validate()}} private method in setters of the dependent (or exclusive) options. This is very similar to the code before [HDFS-10397]. It also adds a new unit test to test constructing {{DistCpOptions}} manually with setters. Its test cases are very similar to the parser test in {{TestOptionsParser}}, except those who are validated in parser instead of the {{DistCpOptions#validate()}}. > DistCpOptions should be validated automatically > ----------------------------------------------- > > Key: HDFS-10556 > URL: https://issues.apache.org/jira/browse/HDFS-10556 > Project: Hadoop HDFS > Issue Type: Bug > Affects Versions: 2.8.0 > Reporter: Mingliang Liu > Assignee: Mingliang Liu > Attachments: HDFS-10556-branch-2.000.patch > > > {{DistCpOptions}} can be set from command-line or may be set manually. In > [HDFS-10397], we refactored the validation to make it simpler and more > efficient. However, the newly added {{validate()}} method may not be > automatically revoked. This is the major concern for existing downstreams > that create the {{DistCpOptions}} manually instead of by parser, and have > conflicting options. > This jira is to make the validation happen automatically. A simple fix is to > use the approach that validates in individual setters. This is a fix for > {{branch-2}}. As a long-term fix, in [HDFS-10533], we're making the > {{DistCpOptions}} immutable so that it will be hard, if not impossible, to > use it wrongly by downstream applications. However, that code will only go to > {{trunk}} branch as it breaks backwards-compatibility. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org