controller#

The resilient controller: all resilient state and behavior of one session.

Classes:

ResilientController(session, config, adapter, *)

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: object

Resilient state of one session: journal, checkpoints, recovery and failover.

The controller is created by enable_resilient_mode(); users interact with it through session.resilient.

Parameters:
sessionobject

The product session.

configResilientConfig

Resilient-mode configuration.

adapterResilientAdapter

The product adapter.

poolWarmSessionPool, 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.

Methods:

__init__(session, config, adapter, *[, ...])

apply_command(path, command, kwds)

Handle an intercepted execute_cmd call.

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_var call.

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_cmd call.

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:
Exception

The 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_var call.

bind(session)#

Route session’s settings calls through this controller.

checkpoint(name)#

Write a checkpoint called name.

Raises:
CheckpointError

If 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:
ResilientError

If 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:
CheckpointError

If no matching checkpoint exists or the restore fails.

undo()#

Undo the most recent value write.

Raises:
ResilientError

If the most recent operation cannot be undone.

wait_for_standbys(timeout=None)#

Wait until every standby applied the changes queued for it.

Returns:
bool

Whether every standby applied them within timeout seconds and is in sync with the active session.