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

Jing Zhao commented on HDFS-7826:
---------------------------------

Thanks for updating the patch, Kai. The latest patch looks pretty good to me. 
Only some minor comments:
# More precisely, the first {{getNumBytes()}} should be replaced with 
{{getNumBytes() - 1}}
{code}
+    return (getNumBytes() / (dataBlockNum * chunkSize) + 1)
+        * chunkSize * parityBlockNum + getNumBytes();
{code}
# We can use {{getTotalBlockNum}} to simplify the following code.
{code}
+        size = getPreferredBlockSize() * (blockInfoStripedUC.getDataBlockNum()
+            + blockInfoStripedUC.getParityBlockNum());
{code}
# {{storagespaceConsumedWithStriped}} should also consider the scenario that 
the last block is UC?
# I think currently for an EC file we do not need to provide storage type based 
quota usage. Thus we can skip the following computation in 
{{computeQuotaUsageWithStriped}}:
{code}
+    if (getStoragePolicyID() != BlockStoragePolicySuite.ID_UNSPECIFIED){
+      BlockStoragePolicy bsp = 
bsps.getPolicy(HdfsConstants.EC_STORAGE_POLICY_ID);
+      StorageType[] storageTypes = bsp.getStorageTypes();
+      for (StorageType t : storageTypes) {
+        if (!t.supportTypeQuota()) {
+          continue;
+        }
+        counts.addTypeSpace(t, ssDelta);
+      }
+    }
{code}
# We also need to add some unit tests. But this can also be done in a separate 
jira.

> Erasure Coding: Update INodeFile quota computation for striped blocks
> ---------------------------------------------------------------------
>
>                 Key: HDFS-7826
>                 URL: https://issues.apache.org/jira/browse/HDFS-7826
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>            Reporter: Jing Zhao
>            Assignee: Kai Sasaki
>         Attachments: HDFS-7826.1.patch, HDFS-7826.2.patch, HDFS-7826.3.patch
>
>
> Currently INodeFile's quota computation only considers contiguous blocks 
> (i.e., {{INodeFile#blocks}}). We need to update it to support striped blocks.



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

Reply via email to