hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Colin Patrick McCabe (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-4352) Encapsulate arguments to BlockReaderFactory in a class
Date Fri, 04 Jan 2013 19:38:13 GMT

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

Colin Patrick McCabe commented on HDFS-4352:

bq. I may miss something. This seems making the code much more confusing: how does the caller
determine which parameters to set before passing BlockReaderFactory.Params? For example, which
methods require ioStreamPair and which methods do not?

{{ioStreamPair}} is never required, but if it is present it will be used.  I agree that this
is confusing, but it was like that before-- you just couldn't see it because the parameter
list was so long!  Most callers passed null for this-- by not setting it, they get that automatically

By the way, HDFS-4353 gets rid of some {{ioStreamPair}} and combines together the {{Socket}}
and the {{ioStreamPair}} in a class called {{Peer}}.  So hopefully this will make things less
confusing by reducing the number of parameters that have to be passed.

The general idea behind {{Params}} is that if you don't set a parameter, it just becomes some
reasonable default.  The only mandatory members are {{Socket}}, {{Block}}, and {{Conf}}. 
I suppose we could add those 3 parameters to the {{Params}} constructor if that seemed clearer.
 We also should document parameters more fully.
> Encapsulate arguments to BlockReaderFactory in a class
> ------------------------------------------------------
>                 Key: HDFS-4352
>                 URL: https://issues.apache.org/jira/browse/HDFS-4352
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: hdfs-client
>    Affects Versions: 2.0.3-alpha
>            Reporter: Colin Patrick McCabe
>            Assignee: Colin Patrick McCabe
>             Fix For: 3.0.0
>         Attachments: 01b.patch, 01.patch
> Encapsulate the arguments to BlockReaderFactory in a class to avoid having to pass around
10+ arguments to a few different functions.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

View raw message