Annotation Interface StateMachineWrite
Marks a method as a write operation in the Raft state machine.
Write operations modify the state machine and must go through the Raft consensus protocol to ensure consistency across all nodes in the cluster. These operations are replicated to all nodes and applied in the same order.
Each write operation must be uniquely identifiable within the state machine definition by its id and version
combination. The same id/version pair cannot be shared between write operations.
The version parameter enables backwards compatibility when evolving the state machine interface over time.
- Since:
- 2.0
- Author:
- José Bolina
- See Also:
-
Required Element Summary
Required ElementsModifier and TypeRequired ElementDescriptionintUnique identifier for this write operation within the state machine definition. -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionintVersion number for backwards compatibility.
-
Element Details
-
id
int idUnique identifier for this write operation within the state machine definition.- Returns:
- the operation identifier
-
version
int versionVersion number for backwards compatibility.Allows evolution of the state machine interface while maintaining compatibility with existing clients.
- Returns:
- the operation version, defaults to 1
- Default:
1
-