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

Haohui Mai commented on HDFS-8493:
----------------------------------

{code}
+        res = FSDirTruncateOp.truncate(this, src, newLength, clientName,
+            clientMachine, mtime, toRemoveBlocks, pc);
+        stat = dir.getAuditFileInfo(dir.getINodesInPath4Write(src, false));
{code}

{{dir.getINodesInPath4Write()}} needs to be in the fsd lock. The easiest way to 
change is to make {{FSDirTruncateOp.truncate()}} returns a object that contains 
both the results and the audit file info. For example,

{code}
static class TruncateResult {
  final boolean result;
  final HdfsStatus stat;
  ...
}
{code}



> Consolidate truncate() related implementation in a single class
> ---------------------------------------------------------------
>
>                 Key: HDFS-8493
>                 URL: https://issues.apache.org/jira/browse/HDFS-8493
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>            Reporter: Haohui Mai
>            Assignee: Rakesh R
>         Attachments: HDFS-8493-001.patch, HDFS-8493-002.patch, 
> HDFS-8493-003.patch, HDFS-8493-004.patch, HDFS-8493-005.patch, 
> HDFS-8493-006.patch, HDFS-8493-007.patch, HDFS-8493-007.patch
>
>
> This jira proposes to consolidate truncate() related methods into a single 
> class.



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

Reply via email to