hadoop-hdfs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jinglun (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HDFS-14542) Remove redundant code when verify quota
Date Tue, 04 Jun 2019 12:23:00 GMT
Jinglun created HDFS-14542:

             Summary: Remove redundant code when verify quota
                 Key: HDFS-14542
                 URL: https://issues.apache.org/jira/browse/HDFS-14542
             Project: Hadoop HDFS
          Issue Type: Improvement
    Affects Versions: 3.1.1
            Reporter: Jinglun

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.
if (!isQuotaByStorageTypeSet()) { // REDUNDANT.
for (StorageType t: StorageType.getTypesSupportingQuota()) {
  if (!isQuotaByStorageTypeSet(t)) { // CHECK FOR EACH STORAGETYPE.
  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);

This message was sent by Atlassian JIRA

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

View raw message