[
https://issues.apache.org/jira/browse/HDFS-14034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16891945#comment-16891945
]
Erik Krogen commented on HDFS-14034:
------------------------------------
I'm not familiar with HttpFS so I would prefer if [~jojochuang] reviewed that
portion, if he doesn't have time I can dive more into that section. For now
this review applies only to the WebHDFS portion of the patch:
* In {{JsonUtil#toJsonString(ContentSummary)}}, instead of individually adding
each element of {{quotaMap}} to {{m}}, would it be cleaner to have a flag
{{includeFileAndDirectoryCount}} in the {{toJsonMap(QuotaUsage)}} method? Then
{{toJsonString}} can just use {{m.addAll(toJsonMap(contentsummary, false))}}
* {code}
final Map<String, Object> m = toJsonMap(quotaUsage);
return toJsonString(QuotaUsage.class, m);
{code}
The local variable {{m}} seems a little redundant here, should we just do:
{code}return toJsonString(QuotaUsage.class, toJsonMap(quotaUsage){code}
* In {{TestWebHDFS#testQuotaUsage}}, rather than using {{writeUTF()}} and then
having some arbitrary number of bytes result (39), can we do something like
{{write(byte[])}} with a fixed size to make it more clear where this number
comes from? It would also be helpful to use local variables to store numbers
like {{600 * 1024 * 1024}} and {{100000}} to make the relationship clear.
Otherwise the WebHDFS portions look great. Thanks a lot for handling this,
[~csun].
> Support getQuotaUsage API in WebHDFS
> ------------------------------------
>
> Key: HDFS-14034
> URL: https://issues.apache.org/jira/browse/HDFS-14034
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Components: fs, webhdfs
> Reporter: Erik Krogen
> Assignee: Chao Sun
> Priority: Major
> Attachments: HDFS-14034.000.patch, HDFS-14034.001.patch,
> HDFS-14034.002.patch
>
>
> HDFS-8898 added support for a new API, {{getQuotaUsage}} which can fetch
> quota usage on a directory with significantly lower impact than the similar
> {{getContentSummary}}. This JIRA is to track adding support for this API to
> WebHDFS.
--
This message was sent by Atlassian JIRA
(v7.6.14#76016)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]