hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jing Zhao (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-7463) Simplify FSNamesystem#getBlockLocationsUpdateTimes
Date Tue, 09 Dec 2014 19:17:12 GMT

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

Jing Zhao commented on HDFS-7463:
---------------------------------

The patch looks good to me. Some comments:
# {{resolvePath}} needs to be put within the read lock.
{code}
+    src = dir.resolvePath(pc, src, pathComponents);
+    checkOperation(OperationCategory.READ);
+    readLock();
{code}
# We should use {{iip.getLatestSnapshotId()}} here instead of {{getPathSnapshotId}}.
{code}
+      return new GetBlockLocationsResult(
+          updateAccessTime, inode, iip.getPathSnapshotId(), blocks);
{code}
# GetBlockLocationsResult#inode can be declared as INodeFile. We can also rename
  snapshotId to latestSnapshotId. Besides, it may be simpler to just include an
  INodesInPath object in GetBlockLocationsResult.
# The read lock is acquired twice in {{getBlockLocations}} and {{getBlockLocationsInt}}.

> Simplify FSNamesystem#getBlockLocationsUpdateTimes
> --------------------------------------------------
>
>                 Key: HDFS-7463
>                 URL: https://issues.apache.org/jira/browse/HDFS-7463
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>            Reporter: Haohui Mai
>            Assignee: Haohui Mai
>         Attachments: HDFS-7463.000.patch, HDFS-7463.001.patch, HDFS-7463.002.patch, HDFS-7463.003.patch,
HDFS-7463.004.patch, HDFS-7463.005.patch
>
>
> Currently {{FSNamesystem#getBlockLocationsUpdateTimes}} holds the read lock to access
the blocks. It releases the read lock and then acquires the write lock when it needs to update
the access time of the {{INode}}.
> This jira proposes to move the responsibility of the latter steps to the caller to simplify
the code.



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

Mime
View raw message