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

Yiqun Lin commented on HDFS-14651:
----------------------------------

Hi [~leosun08], thanks for the follow-up work! I am reviewing on this change 
and I think we can simplify the implementation first. Because I see so many 
parameters to control the probe behavior.

Following setting can be removed I think:
{code:java}
dfs.client.deadnode.detection.rpc.connect.timeout 20 * 1000
{code}
We can hard-coded the value.
{code:java}
+        Future<DatanodeLocalInfo> future =
+            probeThreadPool.submit(new Callable() {
+              @Override
+              public DatanodeLocalInfo call() throws Exception {
+                return proxy.getDatanodeInfo();
+              }
+
+            });
{code}
Why we define additional probeThreadPool to do the rpc check? I mean we can use 
sync way in Probe runnable. And Probe runnable is already in an async way to 
execute in thread pool. I don't see the necessaries to define two thread pool 
here.
{code:java}
 private List<DatanodeInfo> deadNodesProbeQueue = new ArrayList<DatanodeInfo>();
{code}
Can we use the ArrayBlockingQueue to replace ArrayList? The structure 
ArrayBlockingQueue can match our use case here and it's thread safe to use.
{code:java}
+    @Override
+    public void run() {
+      while (true) {
+        deadNodeDetector.scheduleProbe(type);
+        probeSleep(5000);
+      }
+    }
{code}
Here we can use deadNodeDetectInterval insead of 5000. We check and add node 
into the probe queue every deadNodeDetectInterval interval and so we can also 
sleep this interval time to handle the probe queue.

[~leosun08], can you firstly address above comments and refactor current change?

> DeadNodeDetector checks dead node periodically
> ----------------------------------------------
>
>                 Key: HDFS-14651
>                 URL: https://issues.apache.org/jira/browse/HDFS-14651
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>            Reporter: Lisheng Sun
>            Assignee: Lisheng Sun
>            Priority: Major
>         Attachments: HDFS-14651.001.patch, HDFS-14651.002.patch
>
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to