You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Daryn Sharp (JIRA)" <ji...@apache.org> on 2011/03/21 19:31:11 UTC

[jira] [Created] (HADOOP-7202) Improve Command base class

Improve Command base class
--------------------------

                 Key: HADOOP-7202
                 URL: https://issues.apache.org/jira/browse/HADOOP-7202
             Project: Hadoop Common
          Issue Type: Improvement
    Affects Versions: 0.22.0
            Reporter: Daryn Sharp
            Assignee: Daryn Sharp
             Fix For: 0.23.0


Need to extend the Command base class to allow all command to easily subclass from a code set of code that correctly handles globs and exit codes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HADOOP-7202) Improve Command base class

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7202?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13022539#comment-13022539 ] 

Hudson commented on HADOOP-7202:
--------------------------------

Integrated in Hadoop-Hdfs-trunk #643 (See [https://builds.apache.org/hudson/job/Hadoop-Hdfs-trunk/643/])
    

> Improve Command base class
> --------------------------
>
>                 Key: HADOOP-7202
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7202
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 0.22.0
>            Reporter: Daryn Sharp
>            Assignee: Daryn Sharp
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7202-2.patch, HADOOP-7202-3.patch, HADOOP-7202-4.patch, HADOOP-7202-5.patch, HADOOP-7202-6.patch, HADOOP-7202.patch
>
>
> Need to extend the Command base class to allow all command to easily subclass from a code set of code that correctly handles globs and exit codes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (HADOOP-7202) Improve Command base class

Posted by "Daryn Sharp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-7202?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daryn Sharp updated HADOOP-7202:
--------------------------------

    Status: Patch Available  (was: Open)

> Improve Command base class
> --------------------------
>
>                 Key: HADOOP-7202
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7202
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 0.22.0
>            Reporter: Daryn Sharp
>            Assignee: Daryn Sharp
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7202.patch
>
>
> Need to extend the Command base class to allow all command to easily subclass from a code set of code that correctly handles globs and exit codes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HADOOP-7202) Improve Command base class

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7202?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13017447#comment-13017447 ] 

Hudson commented on HADOOP-7202:
--------------------------------

Integrated in Hadoop-Common-trunk #655 (See [https://hudson.apache.org/hudson/job/Hadoop-Common-trunk/655/])
    HADOOP-7202. Improve shell Command base class.  Contributed by Daryn Sharp


> Improve Command base class
> --------------------------
>
>                 Key: HADOOP-7202
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7202
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 0.22.0
>            Reporter: Daryn Sharp
>            Assignee: Daryn Sharp
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7202-2.patch, HADOOP-7202-3.patch, HADOOP-7202-4.patch, HADOOP-7202-5.patch, HADOOP-7202-6.patch, HADOOP-7202.patch
>
>
> Need to extend the Command base class to allow all command to easily subclass from a code set of code that correctly handles globs and exit codes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HADOOP-7202) Improve Command base class

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7202?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13018451#comment-13018451 ] 

Hudson commented on HADOOP-7202:
--------------------------------

Integrated in Hadoop-Hdfs-trunk-Commit #587 (See [https://hudson.apache.org/hudson/job/Hadoop-Hdfs-trunk-Commit/587/])
    

> Improve Command base class
> --------------------------
>
>                 Key: HADOOP-7202
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7202
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 0.22.0
>            Reporter: Daryn Sharp
>            Assignee: Daryn Sharp
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7202-2.patch, HADOOP-7202-3.patch, HADOOP-7202-4.patch, HADOOP-7202-5.patch, HADOOP-7202-6.patch, HADOOP-7202.patch
>
>
> Need to extend the Command base class to allow all command to easily subclass from a code set of code that correctly handles globs and exit codes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HADOOP-7202) Improve Command base class

Posted by "Tsz Wo (Nicholas), SZE (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7202?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13012297#comment-13012297 ] 

Tsz Wo (Nicholas), SZE commented on HADOOP-7202:
------------------------------------------------

I have temporarily reverted this.

> Improve Command base class
> --------------------------
>
>                 Key: HADOOP-7202
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7202
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 0.22.0
>            Reporter: Daryn Sharp
>            Assignee: Daryn Sharp
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7202-2.patch, HADOOP-7202-3.patch, HADOOP-7202-4.patch, HADOOP-7202.patch
>
>
> Need to extend the Command base class to allow all command to easily subclass from a code set of code that correctly handles globs and exit codes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (HADOOP-7202) Improve Command base class

Posted by "Daryn Sharp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-7202?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daryn Sharp updated HADOOP-7202:
--------------------------------

    Attachment: HADOOP-7202-6.patch

Add @Deprecate annotation to remove warning introduced from the javadoc @deprecate tag.

> Improve Command base class
> --------------------------
>
>                 Key: HADOOP-7202
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7202
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 0.22.0
>            Reporter: Daryn Sharp
>            Assignee: Daryn Sharp
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7202-2.patch, HADOOP-7202-3.patch, HADOOP-7202-4.patch, HADOOP-7202-5.patch, HADOOP-7202-6.patch, HADOOP-7202.patch
>
>
> Need to extend the Command base class to allow all command to easily subclass from a code set of code that correctly handles globs and exit codes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HADOOP-7202) Improve Command base class

Posted by "Tsz Wo (Nicholas), SZE (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7202?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13012145#comment-13012145 ] 

Tsz Wo (Nicholas), SZE commented on HADOOP-7202:
------------------------------------------------

Hi Daryn,

- Could you add the annotations to the existing classes?
{code}
@InterfaceAudience.Private
@InterfaceStability.Unstable/Evolving
{code}

- Since they are private unstable interfaces, you may simply remove the methods.  Otherwise, please explain in the javadoc that why these methods are deprecated and what are the alternatives.
> The javac warnings are due to FsCommand.java stubbing out unnecessary abstract methods which happen to be deprecated. ...


- If {{FsCommand}} is not useful now, how about adding it later when it becomes useful?
{code}
+// this class may not look useful now, but it's a placeholder for future
+// functionality to act as a registry for fs commands.  currently it's being
+// used to implement unnecessary abstract methods in the base class
+
+abstract public class FsCommand extends Command {
{code}


> Improve Command base class
> --------------------------
>
>                 Key: HADOOP-7202
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7202
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 0.22.0
>            Reporter: Daryn Sharp
>            Assignee: Daryn Sharp
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7202-2.patch, HADOOP-7202-3.patch, HADOOP-7202.patch
>
>
> Need to extend the Command base class to allow all command to easily subclass from a code set of code that correctly handles globs and exit codes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HADOOP-7202) Improve Command base class

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7202?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13012429#comment-13012429 ] 

Hudson commented on HADOOP-7202:
--------------------------------

Integrated in Hadoop-Common-trunk #645 (See [https://hudson.apache.org/hudson/job/Hadoop-Common-trunk/645/])
    Revert HADOOP-7202 since HDFS cannot be compiled.
HADOOP-7202. Improve shell Command base class.  Contributed by Daryn Sharp


> Improve Command base class
> --------------------------
>
>                 Key: HADOOP-7202
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7202
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 0.22.0
>            Reporter: Daryn Sharp
>            Assignee: Daryn Sharp
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7202-2.patch, HADOOP-7202-3.patch, HADOOP-7202-4.patch, HADOOP-7202.patch
>
>
> Need to extend the Command base class to allow all command to easily subclass from a code set of code that correctly handles globs and exit codes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (HADOOP-7202) Improve Command base class

Posted by "Daryn Sharp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-7202?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daryn Sharp updated HADOOP-7202:
--------------------------------

    Attachment: HADOOP-7202-5.patch

Made changes to avoid/delay need to change hdfs tests.  Mostly involved textual output and temporarily re-added old methods.

> Improve Command base class
> --------------------------
>
>                 Key: HADOOP-7202
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7202
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 0.22.0
>            Reporter: Daryn Sharp
>            Assignee: Daryn Sharp
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7202-2.patch, HADOOP-7202-3.patch, HADOOP-7202-4.patch, HADOOP-7202-5.patch, HADOOP-7202.patch
>
>
> Need to extend the Command base class to allow all command to easily subclass from a code set of code that correctly handles globs and exit codes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HADOOP-7202) Improve Command base class

Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7202?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13017070#comment-13017070 ] 

Hadoop QA commented on HADOOP-7202:
-----------------------------------

-1 overall.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12475635/HADOOP-7202-5.patch
  against trunk revision 1089562.

    +1 @author.  The patch does not contain any @author tags.

    +1 tests included.  The patch appears to include 3 new or modified tests.

    +1 javadoc.  The javadoc tool did not generate any warning messages.

    -1 javac.  The applied patch generated 1073 javac compiler warnings (more than the trunk's current 1072 warnings).

    +1 findbugs.  The patch does not introduce any new Findbugs (version 1.3.9) warnings.

    +1 release audit.  The applied patch does not increase the total number of release audit warnings.

    +1 core tests.  The patch passed core unit tests.

    +1 contrib tests.  The patch passed contrib unit tests.

    +1 system test framework.  The patch passed system test framework compile.

Test results: https://hudson.apache.org/hudson/job/PreCommit-HADOOP-Build/333//testReport/
Findbugs warnings: https://hudson.apache.org/hudson/job/PreCommit-HADOOP-Build/333//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Console output: https://hudson.apache.org/hudson/job/PreCommit-HADOOP-Build/333//console

This message is automatically generated.

> Improve Command base class
> --------------------------
>
>                 Key: HADOOP-7202
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7202
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 0.22.0
>            Reporter: Daryn Sharp
>            Assignee: Daryn Sharp
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7202-2.patch, HADOOP-7202-3.patch, HADOOP-7202-4.patch, HADOOP-7202-5.patch, HADOOP-7202.patch
>
>
> Need to extend the Command base class to allow all command to easily subclass from a code set of code that correctly handles globs and exit codes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HADOOP-7202) Improve Command base class

Posted by "Tanping Wang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7202?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13011498#comment-13011498 ] 

Tanping Wang commented on HADOOP-7202:
--------------------------------------

+1.

> Improve Command base class
> --------------------------
>
>                 Key: HADOOP-7202
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7202
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 0.22.0
>            Reporter: Daryn Sharp
>            Assignee: Daryn Sharp
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7202-2.patch, HADOOP-7202.patch
>
>
> Need to extend the Command base class to allow all command to easily subclass from a code set of code that correctly handles globs and exit codes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HADOOP-7202) Improve Command base class

Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7202?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13012269#comment-13012269 ] 

Hadoop QA commented on HADOOP-7202:
-----------------------------------

+1 overall.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12474804/HADOOP-7202-4.patch
  against trunk revision 1086309.

    +1 @author.  The patch does not contain any @author tags.

    +1 tests included.  The patch appears to include 3 new or modified tests.

    +1 javadoc.  The javadoc tool did not generate any warning messages.

    +1 javac.  The applied patch does not increase the total number of javac compiler warnings.

    +1 findbugs.  The patch does not introduce any new Findbugs (version 1.3.9) warnings.

    +1 release audit.  The applied patch does not increase the total number of release audit warnings.

    +1 core tests.  The patch passed core unit tests.

    +1 contrib tests.  The patch passed contrib unit tests.

    +1 system test framework.  The patch passed system test framework compile.

Test results: https://hudson.apache.org/hudson/job/PreCommit-HADOOP-Build/322//testReport/
Findbugs warnings: https://hudson.apache.org/hudson/job/PreCommit-HADOOP-Build/322//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Console output: https://hudson.apache.org/hudson/job/PreCommit-HADOOP-Build/322//console

This message is automatically generated.

> Improve Command base class
> --------------------------
>
>                 Key: HADOOP-7202
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7202
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 0.22.0
>            Reporter: Daryn Sharp
>            Assignee: Daryn Sharp
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7202-2.patch, HADOOP-7202-3.patch, HADOOP-7202-4.patch, HADOOP-7202.patch
>
>
> Need to extend the Command base class to allow all command to easily subclass from a code set of code that correctly handles globs and exit codes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (HADOOP-7202) Improve Command base class

Posted by "Daryn Sharp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-7202?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daryn Sharp updated HADOOP-7202:
--------------------------------

    Attachment: HADOOP-7202-2.patch

1) I feel that "if (item.exists)" is more intuitive to a reader of external code than "if (item.stat != null)".  I will change it if you feel strongly.

2) Great idea.

3) I went back and added javadocs links to all my new methods. Phew.

4) I'm trying to more closely follow unix conventions.  Also, -1 for invalid usage versus 1 for execution failure, allows external scripts to differentiate the mode of failure.

5) There are other external commands that subclass Command and will need access to this class if updated, so I don't think I can reduce the visibility.

> Improve Command base class
> --------------------------
>
>                 Key: HADOOP-7202
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7202
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 0.22.0
>            Reporter: Daryn Sharp
>            Assignee: Daryn Sharp
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7202-2.patch, HADOOP-7202.patch
>
>
> Need to extend the Command base class to allow all command to easily subclass from a code set of code that correctly handles globs and exit codes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HADOOP-7202) Improve Command base class

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7202?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13017182#comment-13017182 ] 

Hudson commented on HADOOP-7202:
--------------------------------

Integrated in Hadoop-Common-trunk-Commit #545 (See [https://hudson.apache.org/hudson/job/Hadoop-Common-trunk-Commit/545/])
    HADOOP-7202. Improve shell Command base class.  Contributed by Daryn Sharp


> Improve Command base class
> --------------------------
>
>                 Key: HADOOP-7202
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7202
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 0.22.0
>            Reporter: Daryn Sharp
>            Assignee: Daryn Sharp
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7202-2.patch, HADOOP-7202-3.patch, HADOOP-7202-4.patch, HADOOP-7202-5.patch, HADOOP-7202-6.patch, HADOOP-7202.patch
>
>
> Need to extend the Command base class to allow all command to easily subclass from a code set of code that correctly handles globs and exit codes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (HADOOP-7202) Improve Command base class

Posted by "Tsz Wo (Nicholas), SZE (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-7202?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tsz Wo (Nicholas), SZE updated HADOOP-7202:
-------------------------------------------

      Resolution: Fixed
    Hadoop Flags: [Reviewed]
          Status: Resolved  (was: Patch Available)

I have committed this.  Thanks, Daryn!

Also, thanks Tanping for the review.

> Improve Command base class
> --------------------------
>
>                 Key: HADOOP-7202
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7202
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 0.22.0
>            Reporter: Daryn Sharp
>            Assignee: Daryn Sharp
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7202-2.patch, HADOOP-7202-3.patch, HADOOP-7202-4.patch, HADOOP-7202.patch
>
>
> Need to extend the Command base class to allow all command to easily subclass from a code set of code that correctly handles globs and exit codes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (HADOOP-7202) Improve Command base class

Posted by "Daryn Sharp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-7202?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daryn Sharp updated HADOOP-7202:
--------------------------------

    Attachment: HADOOP-7202-3.patch

Fixed javadoc link warning from mis-capitalized method name.

The javac warnings are due to FsCommand.java stubbing out unnecessary abstract methods which happen to be deprecated.  The deprecations are generating the warnings.

> Improve Command base class
> --------------------------
>
>                 Key: HADOOP-7202
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7202
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 0.22.0
>            Reporter: Daryn Sharp
>            Assignee: Daryn Sharp
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7202-2.patch, HADOOP-7202-3.patch, HADOOP-7202.patch
>
>
> Need to extend the Command base class to allow all command to easily subclass from a code set of code that correctly handles globs and exit codes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HADOOP-7202) Improve Command base class

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7202?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13012281#comment-13012281 ] 

Hudson commented on HADOOP-7202:
--------------------------------

Integrated in Hadoop-Common-trunk-Commit #537 (See [https://hudson.apache.org/hudson/job/Hadoop-Common-trunk-Commit/537/])
    HADOOP-7202. Improve shell Command base class.  Contributed by Daryn Sharp


> Improve Command base class
> --------------------------
>
>                 Key: HADOOP-7202
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7202
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 0.22.0
>            Reporter: Daryn Sharp
>            Assignee: Daryn Sharp
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7202-2.patch, HADOOP-7202-3.patch, HADOOP-7202-4.patch, HADOOP-7202.patch
>
>
> Need to extend the Command base class to allow all command to easily subclass from a code set of code that correctly handles globs and exit codes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (HADOOP-7202) Improve Command base class

Posted by "Daryn Sharp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-7202?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daryn Sharp updated HADOOP-7202:
--------------------------------

    Attachment: HADOOP-7202-4.patch

Added annotations for audience and stability.    

I am unable to remove the abstract methods that I marked as deprecated (and then stubbed in FsCommand) because other tools are depending on this class.  I'm relatively certain the new apis are firm, but I'd now like to hold off on adding the deprecations until FsShell is completed.

> Improve Command base class
> --------------------------
>
>                 Key: HADOOP-7202
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7202
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 0.22.0
>            Reporter: Daryn Sharp
>            Assignee: Daryn Sharp
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7202-2.patch, HADOOP-7202-3.patch, HADOOP-7202-4.patch, HADOOP-7202.patch
>
>
> Need to extend the Command base class to allow all command to easily subclass from a code set of code that correctly handles globs and exit codes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (HADOOP-7202) Improve Command base class

Posted by "Daryn Sharp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-7202?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daryn Sharp updated HADOOP-7202:
--------------------------------

    Attachment: HADOOP-7202.patch

Add many methods to Command class to facilitate easy overriding for custom behavior.  Add PathData class to encapsulate a path, fs, and filestatus to avoid passing so many args and/or multiple lookups during execution.  Modify Count cmd to conform since it was the simplest one.

(Note: changes in FsShell are temporary, since all the if/then/elses for commands will soon become a generic call to a command object.)

> Improve Command base class
> --------------------------
>
>                 Key: HADOOP-7202
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7202
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 0.22.0
>            Reporter: Daryn Sharp
>            Assignee: Daryn Sharp
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7202.patch
>
>
> Need to extend the Command base class to allow all command to easily subclass from a code set of code that correctly handles globs and exit codes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HADOOP-7202) Improve Command base class

Posted by "Tanping Wang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7202?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13011473#comment-13011473 ] 

Tanping Wang commented on HADOOP-7202:
--------------------------------------

Patch looks good to me now.

> Improve Command base class
> --------------------------
>
>                 Key: HADOOP-7202
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7202
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 0.22.0
>            Reporter: Daryn Sharp
>            Assignee: Daryn Sharp
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7202-2.patch, HADOOP-7202.patch
>
>
> Need to extend the Command base class to allow all command to easily subclass from a code set of code that correctly handles globs and exit codes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (HADOOP-7202) Improve Command base class

Posted by "Tsz Wo (Nicholas), SZE (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-7202?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tsz Wo (Nicholas), SZE updated HADOOP-7202:
-------------------------------------------

    Status: Patch Available  (was: Reopened)

> Improve Command base class
> --------------------------
>
>                 Key: HADOOP-7202
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7202
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 0.22.0
>            Reporter: Daryn Sharp
>            Assignee: Daryn Sharp
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7202-2.patch, HADOOP-7202-3.patch, HADOOP-7202-4.patch, HADOOP-7202-5.patch, HADOOP-7202.patch
>
>
> Need to extend the Command base class to allow all command to easily subclass from a code set of code that correctly handles globs and exit codes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HADOOP-7202) Improve Command base class

Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7202?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13011505#comment-13011505 ] 

Hadoop QA commented on HADOOP-7202:
-----------------------------------

-1 overall.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12474619/HADOOP-7202-2.patch
  against trunk revision 1085122.

    +1 @author.  The patch does not contain any @author tags.

    +1 tests included.  The patch appears to include 3 new or modified tests.

    -1 javadoc.  The javadoc tool appears to have generated 1 warning messages.

    -1 javac.  The applied patch generated 1076 javac compiler warnings (more than the trunk's current 1072 warnings).

    +1 findbugs.  The patch does not introduce any new Findbugs (version 1.3.9) warnings.

    +1 release audit.  The applied patch does not increase the total number of release audit warnings.

    +1 core tests.  The patch passed core unit tests.

    +1 contrib tests.  The patch passed contrib unit tests.

    +1 system test framework.  The patch passed system test framework compile.

Test results: https://hudson.apache.org/hudson/job/PreCommit-HADOOP-Build/320//testReport/
Findbugs warnings: https://hudson.apache.org/hudson/job/PreCommit-HADOOP-Build/320//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Console output: https://hudson.apache.org/hudson/job/PreCommit-HADOOP-Build/320//console

This message is automatically generated.

> Improve Command base class
> --------------------------
>
>                 Key: HADOOP-7202
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7202
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 0.22.0
>            Reporter: Daryn Sharp
>            Assignee: Daryn Sharp
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7202-2.patch, HADOOP-7202.patch
>
>
> Need to extend the Command base class to allow all command to easily subclass from a code set of code that correctly handles globs and exit codes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HADOOP-7202) Improve Command base class

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7202?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13012299#comment-13012299 ] 

Hudson commented on HADOOP-7202:
--------------------------------

Integrated in Hadoop-Common-trunk-Commit #538 (See [https://hudson.apache.org/hudson/job/Hadoop-Common-trunk-Commit/538/])
    Revert HADOOP-7202 since HDFS cannot be compiled.


> Improve Command base class
> --------------------------
>
>                 Key: HADOOP-7202
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7202
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 0.22.0
>            Reporter: Daryn Sharp
>            Assignee: Daryn Sharp
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7202-2.patch, HADOOP-7202-3.patch, HADOOP-7202-4.patch, HADOOP-7202.patch
>
>
> Need to extend the Command base class to allow all command to easily subclass from a code set of code that correctly handles globs and exit codes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Reopened] (HADOOP-7202) Improve Command base class

Posted by "Tsz Wo (Nicholas), SZE (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-7202?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tsz Wo (Nicholas), SZE reopened HADOOP-7202:
--------------------------------------------


HDFS cannot be compiled after this.

> Improve Command base class
> --------------------------
>
>                 Key: HADOOP-7202
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7202
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 0.22.0
>            Reporter: Daryn Sharp
>            Assignee: Daryn Sharp
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7202-2.patch, HADOOP-7202-3.patch, HADOOP-7202-4.patch, HADOOP-7202.patch
>
>
> Need to extend the Command base class to allow all command to easily subclass from a code set of code that correctly handles globs and exit codes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HADOOP-7202) Improve Command base class

Posted by "Tsz Wo (Nicholas), SZE (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7202?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13012264#comment-13012264 ] 

Tsz Wo (Nicholas), SZE commented on HADOOP-7202:
------------------------------------------------

+1
Thanks for making the changes.  Having {{FsCommand}} makes sense.

> Improve Command base class
> --------------------------
>
>                 Key: HADOOP-7202
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7202
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 0.22.0
>            Reporter: Daryn Sharp
>            Assignee: Daryn Sharp
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7202-2.patch, HADOOP-7202-3.patch, HADOOP-7202-4.patch, HADOOP-7202.patch
>
>
> Need to extend the Command base class to allow all command to easily subclass from a code set of code that correctly handles globs and exit codes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (HADOOP-7202) Improve Command base class

Posted by "Tsz Wo (Nicholas), SZE (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-7202?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tsz Wo (Nicholas), SZE updated HADOOP-7202:
-------------------------------------------

    Resolution: Fixed
        Status: Resolved  (was: Patch Available)

I have committed the new patch.  Thanks Daryn!

> Improve Command base class
> --------------------------
>
>                 Key: HADOOP-7202
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7202
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 0.22.0
>            Reporter: Daryn Sharp
>            Assignee: Daryn Sharp
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7202-2.patch, HADOOP-7202-3.patch, HADOOP-7202-4.patch, HADOOP-7202-5.patch, HADOOP-7202-6.patch, HADOOP-7202.patch
>
>
> Need to extend the Command base class to allow all command to easily subclass from a code set of code that correctly handles globs and exit codes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HADOOP-7202) Improve Command base class

Posted by "Tanping Wang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7202?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13017060#comment-13017060 ] 

Tanping Wang commented on HADOOP-7202:
--------------------------------------

+1 for the new patch.

> Improve Command base class
> --------------------------
>
>                 Key: HADOOP-7202
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7202
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 0.22.0
>            Reporter: Daryn Sharp
>            Assignee: Daryn Sharp
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7202-2.patch, HADOOP-7202-3.patch, HADOOP-7202-4.patch, HADOOP-7202-5.patch, HADOOP-7202.patch
>
>
> Need to extend the Command base class to allow all command to easily subclass from a code set of code that correctly handles globs and exit codes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HADOOP-7202) Improve Command base class

Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7202?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13017159#comment-13017159 ] 

Hadoop QA commented on HADOOP-7202:
-----------------------------------

+1 overall.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12475749/HADOOP-7202-6.patch
  against trunk revision 1089562.

    +1 @author.  The patch does not contain any @author tags.

    +1 tests included.  The patch appears to include 3 new or modified tests.

    +1 javadoc.  The javadoc tool did not generate any warning messages.

    +1 javac.  The applied patch does not increase the total number of javac compiler warnings.

    +1 findbugs.  The patch does not introduce any new Findbugs (version 1.3.9) warnings.

    +1 release audit.  The applied patch does not increase the total number of release audit warnings.

    +1 core tests.  The patch passed core unit tests.

    +1 contrib tests.  The patch passed contrib unit tests.

    +1 system test framework.  The patch passed system test framework compile.

Test results: https://hudson.apache.org/hudson/job/PreCommit-HADOOP-Build/334//testReport/
Findbugs warnings: https://hudson.apache.org/hudson/job/PreCommit-HADOOP-Build/334//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Console output: https://hudson.apache.org/hudson/job/PreCommit-HADOOP-Build/334//console

This message is automatically generated.

> Improve Command base class
> --------------------------
>
>                 Key: HADOOP-7202
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7202
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 0.22.0
>            Reporter: Daryn Sharp
>            Assignee: Daryn Sharp
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7202-2.patch, HADOOP-7202-3.patch, HADOOP-7202-4.patch, HADOOP-7202-5.patch, HADOOP-7202-6.patch, HADOOP-7202.patch
>
>
> Need to extend the Command base class to allow all command to easily subclass from a code set of code that correctly handles globs and exit codes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HADOOP-7202) Improve Command base class

Posted by "Tanping Wang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7202?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13010771#comment-13010771 ] 

Tanping Wang commented on HADOOP-7202:
--------------------------------------

I looked at the patch and think it looks good to me with only a few comments,

1) In PathData.java, class member exists which is a Boolean variable,  its value is determined by checking if FileStatus is null. Since FileStatus is another class member,  by checking whether FileStatus is null, we can already know if the Path exists.  So I think we can eliminate this "exist" member variable?

2) In Command.java#displayError(Exception e)
{code}
    if (errorMessage == null) {
      errorMessage = e.toString();
    }
{code}

StringUtils.stringifyException() is a common utility function which makes a string representation of the exception.  I think using this is better than just toString()
Also,  it would be a good idea to log a debug message using LOG.debug to print out the full exception stack trace, so that debugging is easier.

3) In Command.java#run()
{code}
   * @throws IllegalArgumentException if the option parsing fails
{code}

would it be a good idea to link the function, so it is more clear? i.e.

   * @throws IllegalArgumentException if {@link processOptions(args)} fails

I am confused about the other throws comment
{code}
   * @throws non-IOExceptions such rpc failures
{code}

4) In Command.java#run(String, cmd, LinkedList<String> args)
the exit code of error was -1 in the original code, it is now changed to 1.  Although it does not matter as long as it is non-zero value, why not keep it the same?

5) You are making the methods in PathData.java public, just making it package default by removing the "public" should be sufficient enough in our case?

> Improve Command base class
> --------------------------
>
>                 Key: HADOOP-7202
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7202
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 0.22.0
>            Reporter: Daryn Sharp
>            Assignee: Daryn Sharp
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7202.patch
>
>
> Need to extend the Command base class to allow all command to easily subclass from a code set of code that correctly handles globs and exit codes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira