[ 
https://issues.apache.org/jira/browse/HDFS-9223?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jing Zhao updated HDFS-9223:
----------------------------
    Attachment: HDFS-9223.000.patch

The patch also makes the following changes in {{heartbeatCheck}}.
{code}
-          synchronized(this) {
-            dm.removeDeadDatanode(dead);
-          }
+          dm.removeDeadDatanode(dead);
{code}
{code}
-          synchronized(this) {
-            blockManager.removeBlocksAssociatedTo(failedStorage);
-          }
+          blockManager.removeBlocksAssociatedTo(failedStorage);
{code}

Looks like the changes to {{heartbeat#datanodes}} are already protected by the 
heartbeat manager's monitor in corresponding methods. The heartbeat monitor was 
added originally by HDFS-2108. [~szetszwo], do you think this change is OK?

> Code cleanup for DatanodeDescriptor and HeartbeatManager
> --------------------------------------------------------
>
>                 Key: HDFS-9223
>                 URL: https://issues.apache.org/jira/browse/HDFS-9223
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: namenode
>            Reporter: Jing Zhao
>            Assignee: Jing Zhao
>            Priority: Minor
>         Attachments: HDFS-9223.000.patch
>
>
> Some code cleanup for {{DatanodeDescriptor}} and {{HeartbeatManager}}. The 
> changes include:
> # Change {{DataDescriptor#isAlive}} and {{DatanodeDescriptor#needKeyUpdate}} 
> from public to private
> # Use EnumMap for {{HeartbeatManager#storageTypeStatesMap}}
> # Move the {{isInStartupSafeMode}} out of the namesystem lock in 
> {{heartbeatCheck}}



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

Reply via email to