HDFS-14719. Correct the safemode threshold value in BlockManagerSafeMode. Contributed by hemanthboyina.

This commit is contained in:
Surendra Singh Lilhore 2019-08-15 12:12:18 +05:30
parent 85a00fd2bb
commit 34681643e9

View File

@ -85,7 +85,7 @@ enum BMSafeModeStatus {
private volatile BMSafeModeStatus status = BMSafeModeStatus.OFF; private volatile BMSafeModeStatus status = BMSafeModeStatus.OFF;
/** Safe mode threshold condition %.*/ /** Safe mode threshold condition %.*/
private final double threshold; private final float threshold;
/** Number of blocks needed to satisfy safe mode threshold condition. */ /** Number of blocks needed to satisfy safe mode threshold condition. */
private long blockThreshold; private long blockThreshold;
/** Total number of blocks. */ /** Total number of blocks. */
@ -97,7 +97,7 @@ enum BMSafeModeStatus {
/** Min replication required by safe mode. */ /** Min replication required by safe mode. */
private final int safeReplication; private final int safeReplication;
/** Threshold for populating needed replication queues. */ /** Threshold for populating needed replication queues. */
private final double replQueueThreshold; private final float replQueueThreshold;
/** Number of blocks needed before populating replication queues. */ /** Number of blocks needed before populating replication queues. */
private long blockReplQueueThreshold; private long blockReplQueueThreshold;
@ -150,8 +150,7 @@ enum BMSafeModeStatus {
// default to safe mode threshold (i.e., don't populate queues before // default to safe mode threshold (i.e., don't populate queues before
// leaving safe mode) // leaving safe mode)
this.replQueueThreshold = this.replQueueThreshold =
conf.getFloat(DFS_NAMENODE_REPL_QUEUE_THRESHOLD_PCT_KEY, conf.getFloat(DFS_NAMENODE_REPL_QUEUE_THRESHOLD_PCT_KEY, threshold);
(float) threshold);
this.extension = conf.getTimeDuration(DFS_NAMENODE_SAFEMODE_EXTENSION_KEY, this.extension = conf.getTimeDuration(DFS_NAMENODE_SAFEMODE_EXTENSION_KEY,
DFS_NAMENODE_SAFEMODE_EXTENSION_DEFAULT, DFS_NAMENODE_SAFEMODE_EXTENSION_DEFAULT,
MILLISECONDS); MILLISECONDS);