20 #ifndef RIPPLE_RPC_SHARDARCHIVEHANDLER_H_INCLUDED
21 #define RIPPLE_RPC_SHARDARCHIVEHANDLER_H_INCLUDED
23 #include <ripple/app/main/Application.h>
24 #include <ripple/basics/BasicConfig.h>
25 #include <ripple/basics/StringUtilities.h>
26 #include <ripple/core/DatabaseCon.h>
27 #include <ripple/net/DatabaseDownloader.h>
28 #include <ripple/rpc/ShardVerificationScheduler.h>
30 #include <boost/asio/basic_waitable_timer.hpp>
31 #include <boost/filesystem.hpp>
36 class ShardArchiveHandler_test;
38 #endif // ENABLE_TESTS
49 #endif // ENABLE_TESTS
51 static boost::filesystem::path
111 complete(boost::filesystem::path dstPath);
115 process(boost::filesystem::path
const& dstPath);
148 boost::asio::basic_waitable_timer<std::chrono::steady_clock>
timer_;
static boost::filesystem::path getDownloadDirectory(Config const &config)
std::shared_ptr< DatabaseDownloader > downloader_
const boost::filesystem::path downloadDir_
void remove(std::lock_guard< std::mutex > const &)
TimerOpCounter timerCounter_
ShardVerificationScheduler verificationScheduler_
ShardArchiveHandler & operator=(ShardArchiveHandler &&)=delete
static std::unique_ptr< ShardArchiveHandler > makeShardArchiveHandler(Application &app)
bool removeAndProceed(std::lock_guard< std::mutex > const &lock)
virtual ~ShardArchiveHandler()=default
bool start()
Starts downloading and importing archives.
bool add(std::uint32_t shardIndex, std::pair< parsedURL, std::string > &&url)
void doRelease(std::lock_guard< std::mutex > const &)
RecoveryHandler(Application &app)
bool initFromDB(std::lock_guard< std::mutex > const &)
bool onClosureFailed(std::string const &errorMsg, std::lock_guard< std::mutex > const &lock)
std::atomic_bool stopping_
boost::asio::basic_waitable_timer< std::chrono::steady_clock > timer_
void process(boost::filesystem::path const &dstPath)
void complete(boost::filesystem::path dstPath)
A generic endpoint for log messages.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
bool next(std::lock_guard< std::mutex > const &l)
static std::unique_ptr< ShardArchiveHandler > tryMakeRecoveryHandler(Application &app)
std::map< std::uint32_t, parsedURL > archives_
Handles the download and import of one or more shard archives.
ShardArchiveHandler()=delete
std::unique_ptr< DatabaseCon > sqlDB_