controller#
The resilient controller: all resilient state and behavior of one session.
Classes:
|
Resilient state of one session: journal, checkpoints, recovery and failover. |
- class ansys.fluent.core.resilient.engine.controller.ResilientController(session, config, adapter, *, pool=None, journal_complete=False)#
Bases:
objectResilient state of one session: journal, checkpoints, recovery and failover.
The controller is created by
enable_resilient_mode(); users interact with it throughsession.resilient.- Parameters:
- session
object The product session.
- config
ResilientConfig Resilient-mode configuration.
- adapter
ResilientAdapter The product adapter.
- pool
WarmSessionPool,optional Warm standby sessions for failover.
- journal_completebool,
optional Whether the journal records the session from its launch, so that a standby launched the same way can be brought to the same state by replaying it.
- session
Methods:
__init__(session, config, adapter, *[, ...])apply_command(path, command, kwds)Handle an intercepted
execute_cmdcall.apply_object_change(method, path, args)Handle an intercepted
create/delete/rename/ resize call.apply_query(method, args, kwargs)Handle a delegated read; fail over if the server died.
apply_set(path, value)Handle an intercepted
set_varcall.bind(session)Route
session's settings calls through this controller.checkpoint(name)Write a checkpoint called
name.disable()Stop intercepting settings calls and exit the standby sessions.
on_event(listener)Register a listener called with every
ResilientEvent.redo()Re-apply the most recently undone value write.
rollback([name])Restore the newest checkpoint, or the newest one called
name.undo()Undo the most recent value write.
wait_for_standbys([timeout])Wait until every standby applied the changes queued for it.
- __init__(session, config, adapter, *, pool=None, journal_complete=False)#
- apply_command(path, command, kwds)#
Handle an intercepted
execute_cmdcall.
- apply_object_change(method, path, args)#
Handle an intercepted
create/delete/rename/ resize call.
- apply_query(method, args, kwargs)#
Handle a delegated read; fail over if the server died.
Reads have no side effects, so a read that fails because the server died is repeated on the standby that takes over.
- Raises:
ExceptionThe error of the read when it is not caused by a dead server, or when no standby is configured.
- apply_set(path, value)#
Handle an intercepted
set_varcall.
- bind(session)#
Route
session’s settings calls through this controller.
- checkpoint(name)#
Write a checkpoint called
name.- Raises:
CheckpointErrorIf the session has nothing to checkpoint or the write fails.
- disable()#
Stop intercepting settings calls and exit the standby sessions.
- on_event(listener)#
Register a listener called with every
ResilientEvent.
- redo()#
Re-apply the most recently undone value write.
- Raises:
ResilientErrorIf there is nothing to redo.
- rollback(name=None)#
Restore the newest checkpoint, or the newest one called
name.Newer checkpoints and the journal entries recorded after the restored checkpoint are discarded.
- Raises:
CheckpointErrorIf no matching checkpoint exists or the restore fails.
- undo()#
Undo the most recent value write.
- Raises:
ResilientErrorIf the most recent operation cannot be undone.