|
Clio
develop
The XRP Ledger API server.
|
Interface for managing writer state in the ETL subsystem. More...
#include <WriterState.hpp>

Public Member Functions | |
| virtual bool | isReadOnly () const =0 |
| Check if the ETL process is in strict read-only mode. | |
| virtual bool | isWriting () const =0 |
| Check if the ETL process is currently writing to the database. | |
| virtual void | startWriting ()=0 |
| Request to start writing to the database. | |
| virtual void | giveUpWriting ()=0 |
| Request to stop writing to the database. | |
| virtual bool | isFallback () const =0 |
| Check if the cluster is using the fallback writer decision mechanism. | |
| virtual bool | isFallbackRecovery () const =0 |
| Check if this node is in fallback recovery mode. | |
| virtual void | setFallbackRecovery (bool newValue)=0 |
| Set or clear the fallback recovery flag. | |
| virtual void | setWriterDecidingFallback ()=0 |
| Switch the cluster to the fallback writer decision mechanism. | |
| virtual bool | isEtlStarted () const =0 |
| Whether the ETL monitor has started and the node is ready to become a writer. | |
| virtual bool | isCacheFull () const =0 |
| Whether the ledger cache is fully loaded. | |
| virtual std::unique_ptr< WriterStateInterface > | clone () const =0 |
| Create a clone of this writer state. | |
Interface for managing writer state in the ETL subsystem.
This interface provides methods to query and control whether the ETL process is actively writing to the database. Implementations should coordinate with the ETL system state to manage write responsibilities.
|
nodiscardpure virtual |
Create a clone of this writer state.
Creates a new instance of the writer state with the same underlying system state. This is used when spawning operations that need their own writer state instance while sharing the same system state.
Implemented in etl::WriterState.
|
pure virtual |
Request to stop writing to the database.
This method signals that the process should give up writing responsibilities. The actual transition from writing state may not be immediate.
Implemented in etl::WriterState.
|
nodiscardpure virtual |
Whether the ledger cache is fully loaded.
Implemented in etl::WriterState.
|
nodiscardpure virtual |
Whether the ETL monitor has started and the node is ready to become a writer.
Implemented in etl::WriterState.
|
nodiscardpure virtual |
Check if the cluster is using the fallback writer decision mechanism.
Implemented in etl::WriterState.
|
nodiscardpure virtual |
Check if this node is in fallback recovery mode.
Fallback recovery is an intermediate state entered when the node has been in fallback mode long enough to attempt returning to election-based writer selection. In this state the node continues participating in the fallback write-race while coordinating with other nodes to exit fallback together.
Implemented in etl::WriterState.
|
nodiscardpure virtual |
Check if the ETL process is in strict read-only mode.
Implemented in etl::WriterState.
|
nodiscardpure virtual |
Check if the ETL process is currently writing to the database.
Implemented in etl::WriterState.
|
pure virtual |
Set or clear the fallback recovery flag.
When newValue is true, the node enters fallback recovery mode:
DbRole::Fallback; it publishes DbRole::FallbackRecovery instead.When newValue is false, the recovery flag is cleared without touching the plain fallback flag. This is used when the recovery coordination completes and the node transitions back to election mode.
| newValue | true to enter recovery mode, false to leave it |
Implemented in etl::WriterState.
|
pure virtual |
Switch the cluster to the fallback writer decision mechanism.
This method is called when the cluster needs to transition from the cluster communication mechanism to the slower but more reliable fallback mechanism. Once set, this flag propagates to all nodes in the cluster through the ClioNode DbRole::Fallback state.
Also clears the fallback recovery flag (isFallbackRecovery) because entering a fresh fallback period cancels any in-progress recovery attempt.
Implemented in etl::WriterState.
|
pure virtual |
Request to start writing to the database.
This method signals that the process should take over writing responsibilities. The actual transition to writing state may not be immediate.
Implemented in etl::WriterState.