goiri commented on code in PR #4780:
URL: https://github.com/apache/hadoop/pull/4780#discussion_r952993440
##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/HeartbeatManager.java:
##########
@@ -492,12 +498,12 @@ void heartbeatCheck() {
// log nodes detected as stale since last heartBeat
dumpStaleNodes(staleNodes);
- allAlive = dead == null && failedStorage == null;
+ allAlive = deadDatanodes.size() == 0 && failedStorages.size() == 0;
Review Comment:
isEmpty()
##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/HeartbeatManager.java:
##########
@@ -96,6 +97,9 @@ class HeartbeatManager implements DatanodeStatistics {
enableLogStaleNodes = conf.getBoolean(
DFSConfigKeys.DFS_NAMENODE_ENABLE_LOG_STALE_DATANODE_KEY,
DFSConfigKeys.DFS_NAMENODE_ENABLE_LOG_STALE_DATANODE_DEFAULT);
+ this.removeBatchNum =
Review Comment:
```
this.removeBatchNum = conf.getInt(
DFSConfigKeys.DFS_NAMENODE_REMOVE_BAD_BATCH_NUM,
DFSConfigKeys.DFS_NAMENODE_REMOVE_BAD_BATCH_NUM_DEFAULT);
```
##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/HeartbeatManager.java:
##########
@@ -436,12 +440,14 @@ void heartbeatCheck() {
return;
}
boolean allAlive = false;
+ // Locate limited dead nodes.
+ List<DatanodeDescriptor> deadDatanodes = new ArrayList<>(removeBatchNum);
+ // Locate limited failed storages that isn't on a dead node.
+ List<DatanodeStorageInfo> failedStorages = new ArrayList<>(removeBatchNum);
while (!allAlive) {
Review Comment:
break line
--
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]