checkOperation(OperationCategory.WRITE); checkNameNodeSafeMode("Cannot create snapshot for " + snapshotRoot); snapshotPath = FSDirSnapshotOp.createSnapshot(dir, pc, snapshotManager, snapshotRoot, snapshotName, logRetryCache); success = true;
/** * Create a snapshot * @param snapshotRoot The directory path where the snapshot is taken * @param snapshotName The name of the snapshot */ String createSnapshot(String snapshotRoot, String snapshotName, boolean logRetryCache) throws IOException { final String operationName = "createSnapshot"; String snapshotPath = null; writeLock(); try { checkOperation(OperationCategory.WRITE); checkNameNodeSafeMode("Cannot create snapshot for " + snapshotRoot); snapshotPath = FSDirSnapshotOp.createSnapshot(dir, snapshotManager, snapshotRoot, snapshotName, logRetryCache); } finally { writeUnlock(operationName); } getEditLog().logSync(); logAuditEvent(snapshotPath != null, operationName, snapshotRoot, snapshotPath, null); return snapshotPath; }
/** * Create a snapshot * @param snapshotRoot The directory path where the snapshot is taken * @param snapshotName The name of the snapshot */ String createSnapshot(String snapshotRoot, String snapshotName, boolean logRetryCache) throws IOException { final String operationName = "createSnapshot"; String snapshotPath = null; writeLock(); try { checkOperation(OperationCategory.WRITE); checkNameNodeSafeMode("Cannot create snapshot for " + snapshotRoot); snapshotPath = FSDirSnapshotOp.createSnapshot(dir, snapshotManager, snapshotRoot, snapshotName, logRetryCache); } finally { writeUnlock(operationName); } getEditLog().logSync(); logAuditEvent(snapshotPath != null, operationName, snapshotRoot, snapshotPath, null); return snapshotPath; }