101 std::reference_wrapper<util::config::ClioConfigDefinition const> config_;
102 std::shared_ptr<BackendInterface> backend_;
103 std::shared_ptr<LoadBalancerInterface> balancer_;
104 std::shared_ptr<NetworkValidatedLedgersInterface> ledgers_;
105 std::shared_ptr<LedgerPublisherInterface> publisher_;
106 std::shared_ptr<CacheLoaderInterface> cacheLoader_;
107 std::shared_ptr<CacheUpdaterInterface> cacheUpdater_;
108 std::shared_ptr<ExtractorInterface> extractor_;
109 std::shared_ptr<LoaderInterface> loader_;
110 std::shared_ptr<InitialLoadObserverInterface> initialLoadObserver_;
111 std::shared_ptr<TaskManagerProviderInterface> taskManagerProvider_;
112 std::shared_ptr<MonitorProviderInterface> monitorProvider_;
113 std::shared_ptr<SystemState> state_;
115 std::optional<uint32_t> startSequence_;
116 std::optional<uint32_t> finishSequence_;
118 std::unique_ptr<MonitorInterface> monitor_;
119 std::unique_ptr<TaskManagerInterface> taskMan_;
121 boost::signals2::scoped_connection monitorNewSeqSubscription_;
122 boost::signals2::scoped_connection monitorDbStalledSubscription_;
123 boost::signals2::scoped_connection systemStateWriteCommandSubscription_;
125 std::atomic<size_t> runningWriteCommandHandlers_{0};
127 std::optional<util::async::AnyOperation<void>> mainLoop_;
144 static std::shared_ptr<ETLServiceInterface>
147 std::shared_ptr<SystemState> state,
149 std::shared_ptr<BackendInterface> backend,
150 std::shared_ptr<feed::SubscriptionManagerInterface> subscriptions,
151 std::shared_ptr<LoadBalancerInterface> balancer,
152 std::shared_ptr<NetworkValidatedLedgersInterface> ledgers
175 std::reference_wrapper<util::config::ClioConfigDefinition const> config,
176 std::shared_ptr<data::BackendInterface> backend,
177 std::shared_ptr<LoadBalancerInterface> balancer,
178 std::shared_ptr<NetworkValidatedLedgersInterface> ledgers,
179 std::shared_ptr<LedgerPublisherInterface> publisher,
180 std::shared_ptr<CacheLoaderInterface> cacheLoader,
181 std::shared_ptr<CacheUpdaterInterface> cacheUpdater,
182 std::shared_ptr<ExtractorInterface> extractor,
183 std::shared_ptr<LoaderInterface> loader,
184 std::shared_ptr<InitialLoadObserverInterface> initialLoadObserver,
185 std::shared_ptr<TaskManagerProviderInterface> taskManagerProvider,
186 std::shared_ptr<MonitorProviderInterface> monitorProvider,
187 std::shared_ptr<SystemState> state
207 std::optional<ETLState>
214 std::optional<data::LedgerRange>
215 loadInitialLedgerIfNeeded();
217 [[nodiscard]] uint32_t
221 updateCache(uint32_t seq);
224 startMonitor(uint32_t seq);
227 startLoading(uint32_t seq);
230 attemptTakeoverWriter();
ETLService(util::async::AnyExecutionContext ctx, std::reference_wrapper< util::config::ClioConfigDefinition const > config, std::shared_ptr< data::BackendInterface > backend, std::shared_ptr< LoadBalancerInterface > balancer, std::shared_ptr< NetworkValidatedLedgersInterface > ledgers, std::shared_ptr< LedgerPublisherInterface > publisher, std::shared_ptr< CacheLoaderInterface > cacheLoader, std::shared_ptr< CacheUpdaterInterface > cacheUpdater, std::shared_ptr< ExtractorInterface > extractor, std::shared_ptr< LoaderInterface > loader, std::shared_ptr< InitialLoadObserverInterface > initialLoadObserver, std::shared_ptr< TaskManagerProviderInterface > taskManagerProvider, std::shared_ptr< MonitorProviderInterface > monitorProvider, std::shared_ptr< SystemState > state)
Create an instance of ETLService.
Definition ETLService.cpp:144
static std::shared_ptr< ETLServiceInterface > makeETLService(util::config::ClioConfigDefinition const &config, std::shared_ptr< SystemState > state, util::async::AnyExecutionContext ctx, std::shared_ptr< BackendInterface > backend, std::shared_ptr< feed::SubscriptionManagerInterface > subscriptions, std::shared_ptr< LoadBalancerInterface > balancer, std::shared_ptr< NetworkValidatedLedgersInterface > ledgers)
A factory function to spawn new ETLService instances.
Definition ETLService.cpp:79
A type-erased execution context.
Definition AnyExecutionContext.hpp:41