/** * Enter safe mode. If resourcesLow is false, then we assume it is manual * @throws IOException */ void enterSafeMode(boolean resourcesLow) throws IOException { writeLock(); try { // Stop the secret manager, since rolling the master key would // try to write to the edit log stopSecretManager(); // Ensure that any concurrent operations have been fully synced // before entering safe mode. This ensures that the FSImage // is entirely stable on disk as soon as we're in safe mode. boolean isEditlogOpenForWrite = getEditLog().isOpenForWrite(); // Before Editlog is in OpenForWrite mode, editLogStream will be null. So, // logSyncAll call can be called only when Edlitlog is in OpenForWrite mode if (isEditlogOpenForWrite) { getEditLog().logSyncAll(); } setManualAndResourceLowSafeMode(!resourcesLow, resourcesLow); NameNode.stateChangeLog.info("STATE* Safe mode is ON.\n" + getSafeModeTip()); } finally { writeUnlock("enterSafeMode"); } }
public Void call() throws Exception { log.logSyncAll(); return null; } }).get();
@Override public Void call() throws Exception { log.logSyncAll(); return null; } }).get();
getEditLog().logSyncAll(); getEditLog().logSyncAll();
/** * Enter safe mode manually. * * @throws IOException */ void enterSafeMode() throws IOException { writeLock(); try { if (!isInSafeMode()) { safeMode = SafeModeUtil.getInstance(this); safeMode.setManual(); return; } safeMode.setManual(); getEditLog().logSyncAll(); NameNode.stateChangeLog.info("STATE* Safe mode is ON. " + safeMode.getTurnOffTip()); } finally { writeUnlock(); } }
getEditLog().logSyncAll(); getEditLog().logSyncAll();