zeekling commented on code in PR #6909:
URL: https://github.com/apache/hadoop/pull/6909#discussion_r1667712440
##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/DatanodeManager.java:
##########
@@ -89,6 +89,8 @@ public class DatanodeManager {
private volatile long heartbeatIntervalSeconds;
private volatile int heartbeatRecheckInterval;
+ /** Used by {@link HeartbeatManager}. */
+ private volatile int heartbeatRecheckIntervalForMonitor;
Review Comment:
shouldAbortHeartbeatCheck should be long, not int.
##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/DatanodeManager.java:
##########
@@ -2187,6 +2190,19 @@ private void setHeartbeatInterval(long intervalSeconds,
this.heartbeatExpireInterval = 2L * recheckInterval + 10 * 1000
* intervalSeconds;
this.blockInvalidateLimit = getBlockInvalidateLimit(blockInvalidateLimit);
+ refreshHeartbeatRecheckIntervalForMonitor();
+ }
+
+ @VisibleForTesting
+ public void refreshHeartbeatRecheckIntervalForMonitor() {
+ if (avoidStaleDataNodesForWrite && staleInterval <
heartbeatRecheckInterval) {
+ heartbeatRecheckIntervalForMonitor = (int) staleInterval;
Review Comment:
Converting long to int will lose precision
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]