code: public void formatAndRestartMasters() throws Exception {
      stopMasters();
      Format.format(Format.Mode.MASTER, ServerConfiguration.global());
      startMasters();
    }
docs: Stops the masters, formats them, and then restarts them. This is useful if a fresh state is
  desired, for example when restoring from a backup.