Clio  develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
data::LedgerCacheLoadingStateInterface Class Referenceabstract

Interface for coordinating cache loading permissions across a cluster. More...

#include <LedgerCacheLoadingState.hpp>

Inheritance diagram for data::LedgerCacheLoadingStateInterface:

Public Member Functions

virtual void allowLoading ()=0
 Allow this node to begin loading the cache from the backend.
virtual bool isLoadingAllowed () const =0
 Check whether loading has been permitted.
virtual void waitForLoadingAllowed () const =0
 Block until loading is permitted.
virtual bool isCurrentlyLoading () const =0
 Check whether the cache is currently being loaded from the backend.
virtual std::unique_ptr< LedgerCacheLoadingStateInterfaceclone () const =0
 Create a clone that shares the same loading-allowed flag.

Detailed Description

Interface for coordinating cache loading permissions across a cluster.

Controls whether this node is allowed to load the ledger cache from the backend. In a cluster, at most one node should load the cache at a time; this state is used to gate loading until permission is granted.

Member Function Documentation

◆ allowLoading()

virtual void data::LedgerCacheLoadingStateInterface::allowLoading ( )
pure virtual

Allow this node to begin loading the cache from the backend.

Implemented in data::LedgerCacheLoadingState.

◆ clone()

virtual std::unique_ptr< LedgerCacheLoadingStateInterface > data::LedgerCacheLoadingStateInterface::clone ( ) const
nodiscardpure virtual

Create a clone that shares the same loading-allowed flag.

Note
Clones share the isLoadingAllowed_ atomic, so allowLoading() on any copy is visible to all clones.
Returns
A new instance sharing the same loading permission state

Implemented in data::LedgerCacheLoadingState.

◆ isCurrentlyLoading()

virtual bool data::LedgerCacheLoadingStateInterface::isCurrentlyLoading ( ) const
nodiscardpure virtual

Check whether the cache is currently being loaded from the backend.

Returns
true if the underlying cache has been marked as loading and is not yet full

Implemented in data::LedgerCacheLoadingState.

◆ isLoadingAllowed()

virtual bool data::LedgerCacheLoadingStateInterface::isLoadingAllowed ( ) const
nodiscardpure virtual

Check whether loading has been permitted.

Returns
true if allowLoading() has been called

Implemented in data::LedgerCacheLoadingState.

◆ waitForLoadingAllowed()

virtual void data::LedgerCacheLoadingStateInterface::waitForLoadingAllowed ( ) const
pure virtual

Block until loading is permitted.

Note
Returns immediately if allowLoading() was already called.

Implemented in data::LedgerCacheLoadingState.


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