journal#
The operation journal: every state-changing settings call, in order.
The journal records operations (value writes, commands and object changes), not copies of the server state. It serves two purposes:
undo / redo of value writes, using the value read just before each write;
catching up a standby session that is not up to date with the active session, starting from the newest checkpoint.
Classes:
|
A command executed with |
|
Ordered, bounded record of state-changing operations with undo / redo. |
|
A structural change: |
|
A value written with |
- class ansys.fluent.core.resilient.engine.journal.CommandOp(path, command, args=<factory>, irreversible=False, checkpoint=None, seq=-1, created_at=<factory>)#
Bases:
objectA command executed with
execute_cmd.Attributes:
Return the command path including the command name.
Methods:
describe()Return a one-line description of the operation.
to_dict()Return the operation as a plain dictionary.
- describe()#
Return a one-line description of the operation.
- to_dict()#
Return the operation as a plain dictionary.
- class ansys.fluent.core.resilient.engine.journal.Journal(*, max_ops=10000)#
Bases:
objectOrdered, bounded record of state-changing operations with undo / redo.
- Parameters:
- max_ops
int,optional Maximum number of operations kept. When exceeded, the oldest operations are dropped (replay from before that point is then impossible and a failover requires a newer checkpoint).
- max_ops
Methods:
__init__(*[, max_ops])can_redo()Return whether there is an undone operation to redo.
can_undo()Return whether there is an operation to undo.
live_since(seq)Return the live operations with a sequence number of at least
seq.record(op)Append an operation, discarding any undone operations after the cursor.
redo(write)Re-apply the most recently undone value write.
Return the live operations as plain dictionaries.
truncate(seq)Forget every operation with a sequence number of at least
seq.undo(write)Undo the most recent value write by writing back its previous value.
Attributes:
Sequence number the next recorded operation receives.
Return the live operations (oldest first).
- __init__(*, max_ops=10000)#
- can_redo()#
Return whether there is an undone operation to redo.
- can_undo()#
Return whether there is an operation to undo.
- live_since(seq)#
Return the live operations with a sequence number of at least
seq.- Raises:
ResilientErrorIf operations after
seqwere already dropped from the journal.
- record(op)#
Append an operation, discarding any undone operations after the cursor.
- redo(write)#
Re-apply the most recently undone value write.
- Raises:
ResilientErrorIf there is nothing to redo.
- to_script()#
Return the live operations as plain dictionaries.
- truncate(seq)#
Forget every operation with a sequence number of at least
seq.
- undo(write)#
Undo the most recent value write by writing back its previous value.
- Raises:
ResilientErrorIf there is nothing to undo, if the most recent operation is not a value write, or if its previous value was not captured.
- class ansys.fluent.core.resilient.engine.journal.ObjectOp(method, path, args=(), seq=-1, created_at=<factory>)#
Bases:
objectA structural change:
create,delete,renameor a list resize.Attributes:
Methods:
describe()Return a one-line description of the operation.
to_dict()Return the operation as a plain dictionary.
- describe()#
Return a one-line description of the operation.
- to_dict()#
Return the operation as a plain dictionary.
- class ansys.fluent.core.resilient.engine.journal.SetOp(path, new_value, old_value=None, old_value_known=False, seq=-1, created_at=<factory>)#
Bases:
objectA value written with
set_var.Attributes:
Whether
old_valuewas read before the write (required for undo).Methods:
describe()Return a one-line description of the operation.
to_dict()Return the operation as a plain dictionary.
- describe()#
Return a one-line description of the operation.
- to_dict()#
Return the operation as a plain dictionary.