code: 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");
    }
docs: Save namespace image.
  This will save current namespace into fsimage file and empty edits file.
  Requires superuser privilege and safe mode.
  
  @param force if true, then the namenode need not already be in safemode.
  @throws AccessControlException if superuser privilege is violated.
  @throws IOException            if