|
Clio
develop
The XRP Ledger API server.
|
Implementation of WriterStateInterface that manages ETL writer state. More...
#include <WriterState.hpp>


Public Member Functions | |
| WriterState (std::shared_ptr< SystemState > state) | |
| Construct a WriterState with the given system state. | |
| bool | isReadOnly () const override |
| Check if the ETL process is in strict read-only mode. | |
| bool | isWriting () const override |
| Check if the ETL process is currently writing to the database. | |
| void | startWriting () override |
| Request to start writing to the database. | |
| void | giveUpWriting () override |
| Request to stop writing to the database. | |
| void | setWriterDecidingFallback () override |
| Switch the cluster to the fallback writer decision mechanism. | |
| bool | isFallback () const override |
| Check if the cluster is using the fallback writer decision mechanism. | |
| bool | isLoadingCache () const override |
| Whether clio is still loading cache after startup. | |
| std::unique_ptr< WriterStateInterface > | clone () const override |
| Create a clone of this writer state. | |
Implementation of WriterStateInterface that manages ETL writer state.
This class coordinates with SystemState to manage whether the ETL process is actively writing to the database. It provides methods to query the current writing state and request transitions between writing and non-writing states.
| etl::WriterState::WriterState | ( | std::shared_ptr< SystemState > | state | ) |
Construct a WriterState with the given system state.
| state | Shared pointer to the system state for coordination |
|
overridevirtual |
Create a clone of this writer state.
Creates a new WriterState instance sharing the same system state.
Implements etl::WriterStateInterface.
|
overridevirtual |
Request to stop writing to the database.
If not currently writing, this method does nothing. Otherwise, it sets the shouldGiveUpWriter flag in the system state to signal the request.
Implements etl::WriterStateInterface.
|
overridevirtual |
Check if the cluster is using the fallback writer decision mechanism.
Implements etl::WriterStateInterface.
|
overridevirtual |
Whether clio is still loading cache after startup.
Implements etl::WriterStateInterface.
|
overridevirtual |
Check if the ETL process is in strict read-only mode.
Implements etl::WriterStateInterface.
|
overridevirtual |
Check if the ETL process is currently writing to the database.
Implements etl::WriterStateInterface.
|
overridevirtual |
Switch the cluster to the fallback writer decision mechanism.
Sets the isWriterDecidingFallback flag in the system state, which will be propagated to other nodes in the cluster through the ClioNode DbRole::Fallback state.
Implements etl::WriterStateInterface.
|
overridevirtual |
Request to start writing to the database.
If already writing, this method does nothing. Otherwise, it sets the shouldTakeoverWriting flag in the system state to signal the request.
Implements etl::WriterStateInterface.