|
@@ -52,6 +52,7 @@ import static org.apache.hadoop.hdfs.protocol.datatransfer.BlockConstructionStag
|
|
import static org.apache.hadoop.hdfs.protocol.datatransfer.BlockConstructionStage.PIPELINE_SETUP_CREATE;
|
|
import static org.apache.hadoop.hdfs.protocol.datatransfer.BlockConstructionStage.PIPELINE_SETUP_CREATE;
|
|
import static org.apache.hadoop.hdfs.protocol.datatransfer.BlockConstructionStage.PIPELINE_SETUP_STREAMING_RECOVERY;
|
|
import static org.apache.hadoop.hdfs.protocol.datatransfer.BlockConstructionStage.PIPELINE_SETUP_STREAMING_RECOVERY;
|
|
import static org.apache.hadoop.util.ExitUtil.terminate;
|
|
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.fs.CommonConfigurationKeysPublic;
|
|
import org.apache.hadoop.fs.DF;
|
|
import org.apache.hadoop.fs.DF;
|
|
@@ -411,6 +412,8 @@ public class DataNode extends ReconfigurableBase
|
|
|
|
|
|
private ScheduledThreadPoolExecutor metricsLoggerTimer;
|
|
private ScheduledThreadPoolExecutor metricsLoggerTimer;
|
|
|
|
|
|
|
|
+ private final long startTime = now();
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* Creates a dummy DataNode for testing purpose.
|
|
* Creates a dummy DataNode for testing purpose.
|
|
*/
|
|
*/
|
|
@@ -3195,6 +3198,11 @@ public class DataNode extends ReconfigurableBase
|
|
return this.getConf().get("dfs.datanode.info.port");
|
|
return this.getConf().get("dfs.datanode.info.port");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override // DataNodeMXBean
|
|
|
|
+ public long getDNStartedTimeInMillis() {
|
|
|
|
+ return this.startTime;
|
|
|
|
+ }
|
|
|
|
+
|
|
public String getRevision() {
|
|
public String getRevision() {
|
|
return VersionInfo.getRevision();
|
|
return VersionInfo.getRevision();
|
|
}
|
|
}
|