hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chen Liang (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (HDFS-11649) Ozone: SCM: CLI: Add shell code placeholder classes
Date Thu, 13 Apr 2017 22:19:41 GMT

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

Chen Liang edited comment on HDFS-11649 at 4/13/17 10:19 PM:
-------------------------------------------------------------

Thanks [~cheersyang] for the comments!

Post v003 patch to fix #6 and #5. The #1 point about the CLI layers is indeed a very good
point. In v003 patch, I inherited {{ScmCLI}} from {{OzoneBaseCLI}} like you suggested. But
thinking along this line, when calling
{{hdfs scm -container -create}}
there are actually three layers:
{{scm}} : just like you pointed out as #1 point, besides scm, there are ksm and scmadmin
{{-container}} : besides container, there are node, pool and pipeline
{{-create}} : besides create there are close, delete etc.
I tried to make all the layers explicit, but then the code became rather complex, potentially
even harder to follow. Do you think we should do this? If we want to use hadoop's {{HelpFormatter}}
to generate help string, such layering may also become tricky because {{HelpFormatter}} does
not seem to provide API that can make this layering info clear. 

Also, regarding #2 and  #4:

bq. make sure the caller has the privilege to run this command
We do need this for sure, but I'm not sure whether CLI code is the best place for this, partly
because I think we still need to make sure java-based permission check are OS independent.
I think hdfs script might be a better place for this check. Given that this JIRA was meant
to be adding only the basic shell code structure, we should probably revisit the permission
check in a separate JIRA.

bq. Return code.
If an error happens, an exception will be thrown with error message. Which I think is more
informative already than return code, so I don't see particular benefit from having return
codes, at least for now.


was (Author: vagarychen):
Thanks [~cheersyang] for the comments!

Post v003 patch to fix #6 and #5. The #1 point about the CLI layers is indeed a very point.
In v003 patch, I inherited {{ScmCLI}} from {{OzoneBaseCLI}} like you suggested. But thinking
along this line, when calling
{{hdfs scm -container -create}}
there are actually three layers:
{{scm}} : just like you pointed out as #1 point, besides scm, there are ksm and scmadmin
{{-container}} : besides container, there node, pool and pipeline
{{-create}} : besides create there are close, delete etc.
I tried to make all the layers explicit, but then the code became rather complex, potentially
even harder to follow. Do you think we should do this? If we want to use hadoop's {{HelpFormatter}}
to generate help string, such layering may also add a lot complexity to help message formatting.


Also, regarding #2 and  #4:

bq. make sure the caller has the privilege to run this command
We do need this for sure, but I'm not sure whether CLI code is the best place for this, partly
because I think we still need to make sure java-based permission check are OS independent.
I think hdfs script might be a better place for this check. Given that this JIRA was meant
to be adding only the basic shell code structure, we should probably revisit the permission
check in a separate JIRA.

bq. Return code.
If an error happens, an exception will be thrown with error message. Which I think is more
informative already than return code, so I don't see particular benefit from having return
codes, at least for now.

> Ozone: SCM: CLI:  Add shell code placeholder classes
> ----------------------------------------------------
>
>                 Key: HDFS-11649
>                 URL: https://issues.apache.org/jira/browse/HDFS-11649
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>            Reporter: Chen Liang
>            Assignee: Chen Liang
>         Attachments: HDFS-11649-HDFS-7240.001.patch, HDFS-11649-HDFS-7240.002.patch,
HDFS-11649-HDFS-7240.003.patch
>
>
> HDFS-11470 has outlined how the SCM CLI would look like. Based on the design, this JIRA
adds the basic placeholder classes for all commands to be filled in.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

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


Mime
View raw message