Clio  develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
etl::WriterStateInterface Class Referenceabstract

Interface for managing writer state in the ETL subsystem. More...

#include <WriterState.hpp>

Inheritance diagram for etl::WriterStateInterface:

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 void setWriterDecidingFallback ()=0
 Switch the cluster to the fallback writer decision mechanism.
virtual bool isLoadingCache () const =0
 Whether clio is still loading cache after startup.
virtual std::unique_ptr< WriterStateInterfaceclone () const =0
 Create a clone of this writer state.

Detailed Description

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.

Member Function Documentation

◆ clone()

virtual std::unique_ptr< WriterStateInterface > etl::WriterStateInterface::clone ( ) const
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.

Returns
A unique pointer to the cloned writer state.

Implemented in etl::WriterState.

◆ giveUpWriting()

virtual void etl::WriterStateInterface::giveUpWriting ( )
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.

◆ isFallback()

virtual bool etl::WriterStateInterface::isFallback ( ) const
nodiscardpure virtual

Check if the cluster is using the fallback writer decision mechanism.

Returns
true if the cluster has switched to fallback mode, false otherwise

Implemented in etl::WriterState.

◆ isLoadingCache()

virtual bool etl::WriterStateInterface::isLoadingCache ( ) const
nodiscardpure virtual

Whether clio is still loading cache after startup.

Returns
true if clio is still loading cache, false otherwise.

Implemented in etl::WriterState.

◆ isReadOnly()

virtual bool etl::WriterStateInterface::isReadOnly ( ) const
nodiscardpure virtual

Check if the ETL process is in strict read-only mode.

Returns
true if the process is in strict read-only mode, false otherwise

Implemented in etl::WriterState.

◆ isWriting()

virtual bool etl::WriterStateInterface::isWriting ( ) const
nodiscardpure virtual

Check if the ETL process is currently writing to the database.

Returns
true if the process is writing, false otherwise

Implemented in etl::WriterState.

◆ setWriterDecidingFallback()

virtual void etl::WriterStateInterface::setWriterDecidingFallback ( )
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.

Implemented in etl::WriterState.

◆ startWriting()

virtual void etl::WriterStateInterface::startWriting ( )
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.


The documentation for this class was generated from the following file: