This module contains glue code that allows one to create and manage sessions and their filesystem presence. It allows SessionState to be de-coupled from SessionStorageRepository, SessionStorage, SessionSuspendHelper and SessionResumeHelper.
Manager class for coupling SessionStorage with SessionState.
This class allows application code to manage disk state of sessions. Using the checkpoint() method applications can create persistent snapshots of the SessionState associated with each SessionManager.
Create a checkpoint of the session.
After calling this method you can later reopen the same session with SessionManager.load_session().
Create a session manager with a fresh session.
This method populates the session storage with all of the well known directories (using WellKnownDirsHelper.populate())
Parameters: |
|
---|---|
Ptype job_list: | list of IJobDefinition. |
Ptype repo: | |
Ptype legacy_mode: | |
bool |
|
Returns: | fresh SessionManager instance |
Create a session manager by wrapping existing session state.
This method populates the session storage with all of the well known directories (using WellKnownDirsHelper.populate())
Parameters: |
|
---|---|
Ptype repo: | |
Ptype legacy_mode: | |
bool |
|
Returns: | fresh SessionManager instance |
Destroy all of the filesystem artifacts of the session.
This basically calls remove()
Load a previously checkpointed session.
This method allows one to re-open a session that was previously created by SessionManager.checkpoint()
Parameters: |
|
---|---|
Ptype storage: | |
Raises: | Anything that can be raised by load_checkpoint() and resume() |
Returns: | Fresh instance of SessionManager |
SessionState associated with this manager
SessionStorage associated with this manager
Helper class that knows about well known directories for SessionStorage.
This class simply gets rid of various magic directory names that we associate with session storage. It also provides a convenience utility method populate() to create all of those directories, if needed.
Create all of the well known directories that are expected to exist inside a freshly created session storage directory
SessionStorage associated with this helper