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

Anu Engineer commented on HDFS-8614:
------------------------------------

bq. 1. OzoneQuota:sizeInBytes() can be called multiple times. Can we avoid the 
convertion to bytes through a seperate local variable?

it is possible , but aren't we just doing one multiplication ? On a modern CPU 
that is pretty fast. Why would we precompute that and keep it around. btw, In 
the current code path, it is not frequently called.


bq. 2. OzoneQuota:In my Opinion -1 itself is sufficient to treat it as quota is 
not set or undefined case. And by default we can treat it as {{ bytes}} if unit 
is not explicitly provided which is more comfortable for users

In  Zen of python it is said  "Explicit is better than implicit." :) why create 
a protocol with implicit defaults and make guesses on users behalf. I can 
understand doing that for cases where we have to deal with older protocols. But 
making guesses on users  intent generally seems like a bad idea to me. Even if 
I support bytes ( as suggested by [~arpitagarwal], I would require user to say 
BYTES). IMHO,  even though it might be appear to  be an extra thing to do, in 
the long run having an explicit type is better. Plus it is only a few client 
writers who are exposed to REST protocol. Most common users would interact with 
the server using some sort of a client library.

bq. 3. Header: Can we add the constants as required by the feature JIRA, so 
that the usage and definition is clear to review. If you agree pls remove the 
constants not used in this patch.

will do.

 

> OzoneHandler : Add Quota Support 
> ---------------------------------
>
>                 Key: HDFS-8614
>                 URL: https://issues.apache.org/jira/browse/HDFS-8614
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: HDFS
>            Reporter: Anu Engineer
>            Assignee: Anu Engineer
>         Attachments: hdfs-8614-hdfs-7240.001.patch
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to