22#include "data/LedgerCacheInterface.hpp"
23#include "etl/SystemState.hpp"
24#include "util/log/Logger.hpp"
36 std::reference_wrapper<SystemState> state_;
37 std::reference_wrapper<data::LedgerCacheInterface> cache_;
49 : state_{std::ref(state)}, cache_{std::ref(cache)}
59 if (not state_.get().isCorruptionDetected) {
60 state_.get().isCorruptionDetected =
true;
62 LOG(log_.
error()) <<
"Disabling the cache to avoid corrupting the DB further. Please investigate.";
63 cache_.get().setDisabled();
Cache for an entire ledger.
Definition LedgerCacheInterface.hpp:38
A helper to notify Clio operator about a corruption in the DB.
Definition CorruptionDetector.hpp:35
void onCorruptionDetected()
Notify the operator about a corruption in the DB.
Definition CorruptionDetector.hpp:57
CorruptionDetector(SystemState &state, data::LedgerCacheInterface &cache)
Construct a new Corruption Detector object.
Definition CorruptionDetector.hpp:48
A simple thread-safe logger for the channel specified in the constructor.
Definition Logger.hpp:111
Pump error(SourceLocationType const &loc=CURRENT_SRC_LOCATION) const
Interface for logging at Severity::ERR severity.
Definition Logger.cpp:229
This namespace contains everything to do with the ETL and ETL sources.
Definition CacheLoader.hpp:37
Represents the state of the ETL subsystem.
Definition SystemState.hpp:33