Description
Currently datanode state machine transitioned between tasks in a fixed time interval, defined by ScmConfigKeys#OZONE_SCM_HEARTBEAT_INTERVAL_SECONDS, the default value is 30s. Once datanode is started, it will need 90s before transited to Heartbeat state, such a long lag is not necessary. Propose to improve the logic of time interval handling, it seems only the heartbeat task needs to be scheduled in OZONE_SCM_HEARTBEAT_INTERVAL_SECONDS interval, rest should be done without any lagging.