[
https://issues.apache.org/jira/browse/HDFS-12934?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16305194#comment-16305194
]
Íñigo Goiri commented on HDFS-12934:
------------------------------------
I cannot do a very thorough review until next week but here a few minor
comments:
* I would extract the variables for
{{QuotaCacheUpdateService#periodicInvoke()}}, in particular
{{entry.getSourcePath()}} in a couple loops where is reused a bunch.
* In the same {{periodicInvoke()}}, you could have a function to get the mount
table entries in addition to {{getMountTableStore()}}, then the loop would just
return {{List<MountTable>}}.
* {{isQuotaSet()}} could directly return if the quota is set and save the
loops; you could just return false at the end otherwise.
* {{quotaUsageCache}} could be {{Map<String, RouterQuotaUsage>}} in the
definition; the concurrent implementation is fine. Actually, the usage seems to
be most of the time {{getQuotaUsageCache().getChildrenPaths(path)}}, we could
expose that directly.
* I found out a few weeks ago that {{Configuration}} has a proper interface to
get time periods (e.g., 10s). It may make sense to set the intervals for
updating the cache using that API.
* {{TestRouterQuota}} probably covers most of the cases, but
{{RouterQuotaLocalCache}} could be tested by itself pretty exhaustively.
* In general, I would set some of the main variables in the loops as {{final}}.
Next week, I'll test it in my cluster and try to get familiar to the way the NN
does it to give a deeper review.
> RBF: Federation supports global quota
> -------------------------------------
>
> Key: HDFS-12934
> URL: https://issues.apache.org/jira/browse/HDFS-12934
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Affects Versions: 3.0.0
> Reporter: Yiqun Lin
> Assignee: Yiqun Lin
> Labels: RBF
> Attachments: HDFS-12934.001.patch, HDFS-12934.002.patch, RBF support
> global quota.pdf
>
>
> Now federation doesn't support set the global quota for each folder.
> Currently the quota will be applied for each subcluster under the specified
> folder via RPC call.
> It will be very useful for users that federation can support setting global
> quota and exposing the command of this.
> In a federated environment, a folder can be spread across multiple
> subclusters. For this reason, we plan to solve this by following way:
> # Set global quota across each subcluster. We don't allow each subcluster can
> exceed maximun quota value.
> # We need to construct one <Path, QuotaUsage> cache map for storing the sum
> quota usage of these subclusters under federation folder. Every time we want
> to do WRITE operation under specified folder, we will get its quota usage
> from cache and verify its quota. If quota exceeded, throw exception,
> otherwise update its quota usage in cache when finishing operations.
> The quota will be set to mount table and as a new field in mount table. The
> set/unset command will be like:
> {noformat}
> hdfs dfsrouteradmin -setQuota -ns <nsQuota> -ss <ssQuota> <mount table>
> hdfs dfsrouteradmin -clrQuota <mount table>
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]