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 "Jinglun (JIRA)" <ji...@apache.org> on 2019/06/04 12:21:00 UTC
[jira] [Resolved] (HADOOP-16348) Remove redundant code when verify
quota.
[ https://issues.apache.org/jira/browse/HADOOP-16348?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jinglun resolved HADOOP-16348.
------------------------------
Resolution: Abandoned
Release Note: Should under HDFS.
> Remove redundant code when verify quota.
> ----------------------------------------
>
> Key: HADOOP-16348
> URL: https://issues.apache.org/jira/browse/HADOOP-16348
> Project: Hadoop Common
> Issue Type: Improvement
> Affects Versions: 3.1.1
> Reporter: Jinglun
> Priority: Minor
>
> DirectoryWithQuotaFeature.verifyQuotaByStorageType() does the job of verifying quota. It's redundant to call isQuotaByStorageTypeSet() because the for each iterator nextline has done the same job.
> {code:java}
> if (!isQuotaByStorageTypeSet()) { // REDUNDANT.
> return;
> }
> for (StorageType t: StorageType.getTypesSupportingQuota()) {
> if (!isQuotaByStorageTypeSet(t)) { // CHECK FOR EACH STORAGETYPE.
> continue;
> }
> if (Quota.isViolated(quota.getTypeSpace(t), usage.getTypeSpace(t),
> typeDelta.get(t))) {
> throw new QuotaByStorageTypeExceededException(
> quota.getTypeSpace(t), usage.getTypeSpace(t) + typeDelta.get(t), t);
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org