CheckpointSignature rollEditLog() throws IOException { String operationName = "rollEditLog"; CheckpointSignature result = null; checkSuperuserPrivilege(operationName); checkOperation(OperationCategory.JOURNAL); writeLock(); try { checkOperation(OperationCategory.JOURNAL); checkNameNodeSafeMode("Log not rolled"); if (Server.isRpcInvocation()) { LOG.info("Roll Edit Log from " + Server.getRemoteAddress()); } result = getFSImage().rollEditLog(getEffectiveLayoutVersion()); } finally { writeUnlock(operationName); } logAuditEvent(true, operationName, null); return result; }
CheckpointSignature sig = rollEditLog(layoutVersion); return new CheckpointCommand(sig, needToReturnImg);
RollingUpgradeInfo startRollingUpgrade() throws IOException { final String operationName = "startRollingUpgrade"; checkSuperuserPrivilege(operationName); checkOperation(OperationCategory.WRITE); writeLock(); try { checkOperation(OperationCategory.WRITE); if (isRollingUpgrade()) { return rollingUpgradeInfo; } long startTime = now(); if (!haEnabled) { // for non-HA, we require NN to be in safemode startRollingUpgradeInternalForNonHA(startTime); } else { // for HA, NN cannot be in safemode checkNameNodeSafeMode("Failed to start rolling upgrade"); startRollingUpgradeInternal(startTime); } getEditLog().logStartRollingUpgrade(rollingUpgradeInfo.getStartTime()); if (haEnabled) { // roll the edit log to make sure the standby NameNode can tail getFSImage().rollEditLog(getEffectiveLayoutVersion()); } } finally { writeUnlock(operationName); } getEditLog().logSync(); logAuditEvent(true, operationName, null, null, null); return rollingUpgradeInfo; }
RollingUpgradeInfo finalizeRollingUpgrade() throws IOException { final String operationName = "finalizeRollingUpgrade"; checkSuperuserPrivilege(operationName); checkOperation(OperationCategory.WRITE); writeLock(); try { checkOperation(OperationCategory.WRITE); if (!isRollingUpgrade()) { return null; } checkNameNodeSafeMode("Failed to finalize rolling upgrade"); finalizeRollingUpgradeInternal(now()); getEditLog().logFinalizeRollingUpgrade(rollingUpgradeInfo.getFinalizeTime()); if (haEnabled) { // roll the edit log to make sure the standby NameNode can tail getFSImage().rollEditLog(getEffectiveLayoutVersion()); } getFSImage().updateStorageVersion(); getFSImage().renameCheckpoint(NameNodeFile.IMAGE_ROLLBACK, NameNodeFile.IMAGE); } finally { writeUnlock(operationName); } if (!haEnabled) { // Sync not needed for ha since the edit was rolled after logging. getEditLog().logSync(); } logAuditEvent(true, operationName, null, null, null); return rollingUpgradeInfo; }
synchronized CheckpointSignature rollEditLog() throws IOException { if (isInSafeMode()) { throw new SafeModeException("Checkpoint not created", safeMode); } LOG.info("Roll Edit Log from " + Server.getRemoteAddress()); return getFSImage().rollEditLog(); }
CheckpointSignature rollEditLog() throws IOException { checkSuperuserPrivilege(); checkOperation(OperationCategory.JOURNAL); writeLock(); try { checkOperation(OperationCategory.JOURNAL); checkNameNodeSafeMode("Log not rolled"); if (Server.isRpcInvocation()) { LOG.info("Roll Edit Log from " + Server.getRemoteAddress()); } return getFSImage().rollEditLog(); } finally { writeUnlock("rollEditLog"); } }
CheckpointSignature rollEditLog() throws IOException { writeLock(); try { if (isInSafeMode()) { throw new SafeModeException("Checkpoint not created", safeMode); } LOG.info("Roll Edit Log from " + Server.getRemoteAddress() + " editlog file " + getFSImage().getEditLog().getFsEditName() + " editlog timestamp " + getFSImage().getEditLog().getFsEditTime()); return getFSImage().rollEditLog(); } finally { writeUnlock(); } }
CheckpointSignature rollEditLog() throws IOException { checkSuperuserPrivilege(); checkOperation(OperationCategory.JOURNAL); writeLock(); try { checkOperation(OperationCategory.JOURNAL); checkNameNodeSafeMode("Log not rolled"); if (Server.isRpcInvocation()) { LOG.info("Roll Edit Log from " + Server.getRemoteAddress()); } return getFSImage().rollEditLog(); } finally { writeUnlock("rollEditLog"); } }
editLog.open(); if (!saveNamespace) { fsImage.rollEditLog();
fsimage.rollEditLog(); fsimage.rollEditLog();
if (haEnabled) { getFSImage().rollEditLog();
CheckpointSignature sig = rollEditLog(); return new CheckpointCommand(sig, needToReturnImg);
if (haEnabled) { getFSImage().rollEditLog();
if (haEnabled) { getFSImage().rollEditLog();
if (haEnabled) { getFSImage().rollEditLog();
CheckpointSignature sig = rollEditLog(); return new CheckpointCommand(sig, needToReturnImg);