hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mingliang Liu (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-10533) Make DistCpOptions class immutable
Date Sat, 18 Jun 2016 09:26:05 GMT

    [ https://issues.apache.org/jira/browse/HDFS-10533?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15337675#comment-15337675

Mingliang Liu commented on HDFS-10533:

Thanks [~cnauroth] and [~jingzhao] for the insights.

I strongly agree with Jing one the idea of making it hard, if not impossible for downstream
projects use the {{DistCpOptions}} wrongly. This code will go to {{trunk}} branch, and I will
address the interface audience and stability annotations.

For the existing problems for downstream in using the {{DistCpOptions}} as Jing proposed,
I'll create another jira for tracking this. That should go to {{branch-2}} and be backwards-compatible.

> Make DistCpOptions class immutable
> ----------------------------------
>                 Key: HDFS-10533
>                 URL: https://issues.apache.org/jira/browse/HDFS-10533
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: distcp
>            Reporter: Mingliang Liu
>            Assignee: Mingliang Liu
> Currently the {{DistCpOptions}} class encapsulates all DistCp options, which may be set
from command-line (via the {{OptionsParser}}) or may be set manually (eg construct an instance
and call setters). As there are multiple option fields and more (e.g. [HDFS-9868], [HDFS-10314])
to add, validating them can be cumbersome. Ideally, the {{DistCpOptions}} object should be
immutable. The benefits are:
> # {{DistCpOptions}} is simple and easier to use and share, plus it scales well
> # validation is automatic, e.g. manually constructed {{DistCpOptions}} gets validated
before usage
> # validation error message is well-defined which does not depend on the order of setters
> This jira is to track the effort of making the {{DistCpOptions}} immutable by using a
Builder pattern for creation.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org

View raw message