code: public void restoreAfterSafeModeRestart() {
      if (!clusterManager.safeMode) {
        return;
      }
  
      for (Session session : sessions.values()) {
        for (ResourceRequestInfo resourceRequestInfo :
          session.idToRequest.values()) {
  
          // The helper method to restore the ResourceRequestInfo instances
          // is placed in NodeManager because it makes use of other members
          // of NodeManager
          clusterManager.nodeManager.
            restoreResourceRequestInfo(resourceRequestInfo);
        }
        session.restoreAfterSafeModeRestart();
        clusterManager.getScheduler().addSession(session.getSessionId(),
          session);
      }
  
      clusterManager.getMetrics().setNumRunningSessions(sessions.size());
    }
docs: This method rebuilds members related to the SessionManager instance,
  which were not directly persisted themselves.