new LogState(logStateopt)
State machine synchronized by module:brig/consensus~Consensus.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
logState | module:brig/log~LogStateOptions | <optional> | State to initialize with. |
- Source
Members
lastTerm
The last term number.
- Source
Methods
serialize() → {buffer}
Serializes the state to a buffer.
- Source
Returns:
- Type:
- buffer
setCurrentRole(role) → {module:brig/log~LogState}
Sets the current role to the given symbol.
Parameters:
Name | Type | Description |
---|---|---|
role | module:brig/roles~Follower | | Symbol for the role to set. |
- Source
Returns:
- Type:
- module:brig/log~LogState
toNextTerm() → {module:brig/consensus~NodeStateMachine}
Increments the current term by 1.
- Source
Returns:
- Type:
- module:brig/consensus~NodeStateMachine
voteFor(id) → {module:brig/log~LogState}
Sets the current vote for the given ID.
Parameters:
Name | Type | Description |
---|---|---|
id | buffer | Node ID to vote for. |
- Source
Returns:
- Type:
- module:brig/log~LogState
(static) deserialize(serializedNodeState)
Creates a Log state instance from the serialized buffer.
Parameters:
Name | Type | Description |
---|---|---|
serializedNodeState | buffer | Output from module:brig/log~LogState#serialize |
- Source