docs: private OperationResult applyCommand(Indexed<CommandEntry> entry) {
      // First check to ensure that the session exists.
      RaftSession session = raft.getSessions().getSession(entry.entry().session());
  
      // If the session is null, return an UnknownSessionException. Commands applied to the state machine must
      // have a session. We ensure that session register/unregister entries are not compacted from the log
      // until all associated commands have been cleaned.
      // Note that it's possible for a session to be unknown if a later snapshot has been taken, so we don't want
      // to log warnings here.
      if (session == null) {
        logger.debug("Unknown session: " + entry.entry().session());
        throw new RaftException.UnknownSession("unknown session: " + entry.entry().session());
      }
  
      // Increment the load counter to avoid snapshotting under high load.
      raft.getLoadMonitor().recordEvent();
  
      // Execute the command using the state machine associated with the session.
      return session.getService()
          .executeCommand(
              entry.index(),
              entry.entry().sequenceNumber(),
              entry.entry().timestamp(),
              session,
              entry.entry().operation());
    }