+ "the NN will immediately return to safe mode. "; if (isManual() || areResourcesLow()) { return adminMsg + "Use \"hdfs dfsadmin -safemode leave\" to turn safe mode off.";
+ "the NN will immediately return to safe mode. "; if (isManual() || areResourcesLow()) { return adminMsg + "Use \"hdfs dfsadmin -safemode leave\" to turn safe mode off.";
/** * A tip on how safe mode is to be turned off: manually or automatically. */ String getTurnOffTip() { String leaveMsg = "Safe mode will be turned off automatically"; if(reached < 0) return "Safe mode is OFF."; if(isManual()) { if(getDistributedUpgradeState()) return leaveMsg + " upon completion of " + "the distributed upgrade: upgrade progress = " + getDistributedUpgradeStatus() + "%"; leaveMsg = "Use \"hadoop dfs -safemode leave\" to turn safe mode off"; } if(blockTotal < 0) return leaveMsg + "."; String safeBlockRatioMsg = String.format("The ratio of reported blocks %.4f has " + (reached == 0 ? "not " : "") + "reached the threshold %.4f. ", getSafeBlockRatio(), threshold) + leaveMsg; if(reached == 0 || isManual()) // threshold is not reached or manual return safeBlockRatioMsg + "."; // extension period is in progress return safeBlockRatioMsg + " in " + Math.abs(reached + extension - now())/1000 + " seconds."; }
/** * Decrement number of safe blocks if current block has * fallen below minimal replication. * @param replication current replication */ private synchronized void decrementSafeBlockCount(short replication) { if (replication == safeReplication-1) { this.blockSafe--; //blockSafe is set to -1 in manual / low resources safemode assert blockSafe >= 0 || isManual() || areResourcesLow(); checkMode(); } }
/** * Decrement number of safe blocks if current block has * fallen below minimal replication. * @param replication current replication */ private synchronized void decrementSafeBlockCount(short replication) { if (replication == safeReplication-1) { this.blockSafe--; //blockSafe is set to -1 in manual / low resources safemode assert blockSafe >= 0 || isManual() || areResourcesLow(); checkMode(); } }