void saveNamespace ( boolean force , boolean uncompressed ) throws AccessControlException , IOException { LOG . info ( "Saving namespace" ) ; writeLock ( ) ; try { checkSuperuserPrivilege ( ) ; if ( ! force && ! isInSafeMode ( ) ) { throw new IOException ( "Safe mode should be turned ON " + "in order to create namespace image." ) ; } getFSImage ( ) . saveNamespace ( uncompressed ) ; } finally { writeUnlock ( ) ; } LOG . info ( "Saving namespace - DONE" ) ; }
Save namespace image . This will save current namespace into fsimage file and empty edits file . Requires superuser privilege and safe mode .