|
@@ -47,6 +47,7 @@ import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_MAX_NUM_BLOCKS_TO_LOG_KEY
|
|
|
import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_DATANODE_METRICS_LOGGER_PERIOD_SECONDS_DEFAULT;
|
|
|
import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_DATANODE_METRICS_LOGGER_PERIOD_SECONDS_KEY;
|
|
|
import static org.apache.hadoop.util.ExitUtil.terminate;
|
|
|
+import static org.apache.hadoop.util.Time.now;
|
|
|
|
|
|
import org.apache.hadoop.fs.CommonConfigurationKeysPublic;
|
|
|
import org.apache.hadoop.hdfs.protocol.proto.ReconfigurationProtocolProtos.ReconfigurationProtocolService;
|
|
@@ -412,6 +413,8 @@ public class DataNode extends ReconfigurableBase
|
|
|
|
|
|
private ScheduledThreadPoolExecutor metricsLoggerTimer;
|
|
|
|
|
|
+ private final long startTime = now();
|
|
|
+
|
|
|
/**
|
|
|
* Creates a dummy DataNode for testing purpose.
|
|
|
*/
|
|
@@ -3092,6 +3095,11 @@ public class DataNode extends ReconfigurableBase
|
|
|
return this.getConf().get("dfs.datanode.info.port");
|
|
|
}
|
|
|
|
|
|
+ @Override // DataNodeMXBean
|
|
|
+ public long getDNStartedTimeInMillis() {
|
|
|
+ return this.startTime;
|
|
|
+ }
|
|
|
+
|
|
|
public String getRevision() {
|
|
|
return VersionInfo.getRevision();
|
|
|
}
|