tomscut commented on code in PR #5349:
URL: https://github.com/apache/hadoop/pull/5349#discussion_r1098091499
##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java:
##########
@@ -3825,14 +3829,37 @@ boolean isRestarting() {
* @return true - if the data node is fully started
*/
public boolean isDatanodeFullyStarted() {
+ return isDatanodeFullyStarted(false);
+ }
+
+ /**
+ * A datanode is considered to be fully started if all the BP threads are
+ * alive and all the block pools are initialized. If
checkConnectionToActiveNamenode is true,
+ * the datanode is considered to be fully started if it is also heartbeating
to
+ * active namenode in addition to the above-mentioned conditions.
+ *
+ * @param checkConnectionToActiveNamenode if true, performs additional check
of whether datanode
+ * is heartbeating to active namenode.
+ * @return true if the datanode is fully started and also conditionally
connected to active
+ * namenode, false otherwise.
+ */
+ public boolean isDatanodeFullyStarted(boolean
checkConnectionToActiveNamenode) {
+ if (checkConnectionToActiveNamenode) {
Review Comment:
The code actually executes one loop, but it looks a little redundant. It's
actually a little more readable.
--
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]