void markAsCorruptedAndScheduleRebuild(@NotNull Throwable cause) throws RuntimeException, Error {
    try {
      int corruptions = corruptionsDetected.incrementAndGet();
      records.setErrorsAccumulated(corruptions);
      if (corruptions == 1) {
        //Persist ErrorsAccumulated.
        // No need to force() on each error -- we don't bother not persist exact count of errors,
        // but we do want to persist (errors > 0) transition:
        doForce();
      }
      corruptionNotificationThrottler.runThrottled(System.nanoTime(), () -> {
        Application app = ApplicationManager.getApplication();
          if (app != null && !app.isHeadlessEnvironment()) {
            boolean insistRestart = (corruptions >= INSIST_TO_RESTART_AFTER_ERRORS_COUNT);
            showCorruptionNotification(insistRestart);
          }
      });
    }
    catch (IOException ioException) {
      LOG.error(ioException);
    }
  }
void markAsCorruptedAndScheduleRebuild(@NotNull Throwable cause)