rippled
|
Handles the download and import of one or more shard archives. More...
Public Types | |
using | TimerOpCounter = ClosureCounter< void, boost::system::error_code const & > |
Public Member Functions | |
ShardArchiveHandler (Application &app) | |
virtual | ~ShardArchiveHandler ()=default |
bool | init () |
bool | add (std::uint32_t shardIndex, std::pair< parsedURL, std::string > &&url) |
bool | start () |
Starts downloading and importing archives. More... | |
void | stop () |
void | release () |
Static Public Member Functions | |
static boost::filesystem::path | getDownloadDirectory (Config const &config) |
static std::unique_ptr< ShardArchiveHandler > | makeShardArchiveHandler (Application &app) |
static std::unique_ptr< ShardArchiveHandler > | tryMakeRecoveryHandler (Application &app) |
Private Member Functions | |
ShardArchiveHandler ()=delete | |
ShardArchiveHandler (ShardArchiveHandler const &)=delete | |
ShardArchiveHandler & | operator= (ShardArchiveHandler &&)=delete |
ShardArchiveHandler & | operator= (ShardArchiveHandler const &)=delete |
bool | initFromDB (std::lock_guard< std::mutex > const &) |
bool | add (std::uint32_t shardIndex, parsedURL &&url, std::lock_guard< std::mutex > const &) |
Add an archive to be downloaded and imported. More... | |
bool | next (std::lock_guard< std::mutex > const &l) |
void | complete (boost::filesystem::path dstPath) |
void | process (boost::filesystem::path const &dstPath) |
void | remove (std::lock_guard< std::mutex > const &) |
void | doRelease (std::lock_guard< std::mutex > const &) |
bool | onClosureFailed (std::string const &errorMsg, std::lock_guard< std::mutex > const &lock) |
bool | removeAndProceed (std::lock_guard< std::mutex > const &lock) |
Private Attributes | |
std::mutex | m_ |
std::atomic_bool | stopping_ {false} |
std::shared_ptr< DatabaseDownloader > | downloader_ |
std::map< std::uint32_t, parsedURL > | archives_ |
bool | process_ |
std::unique_ptr< DatabaseCon > | sqlDB_ |
Application & | app_ |
const beast::Journal | j_ |
const boost::filesystem::path | downloadDir_ |
boost::asio::basic_waitable_timer< std::chrono::steady_clock > | timer_ |
JobCounter | jobCounter_ |
TimerOpCounter | timerCounter_ |
ShardVerificationScheduler | verificationScheduler_ |
Handles the download and import of one or more shard archives.
Definition at line 42 of file ShardArchiveHandler.h.
using ripple::RPC::ShardArchiveHandler::TimerOpCounter = ClosureCounter<void, boost::system::error_code const&> |
Definition at line 46 of file ShardArchiveHandler.h.
|
explicit |
Definition at line 71 of file ShardArchiveHandler.cpp.
|
virtualdefault |
|
privatedelete |
|
privatedelete |
|
static |
Definition at line 38 of file ShardArchiveHandler.cpp.
|
static |
Definition at line 50 of file ShardArchiveHandler.cpp.
|
static |
Definition at line 56 of file ShardArchiveHandler.cpp.
bool ripple::RPC::ShardArchiveHandler::init | ( | ) |
Definition at line 90 of file ShardArchiveHandler.cpp.
bool ripple::RPC::ShardArchiveHandler::add | ( | std::uint32_t | shardIndex, |
std::pair< parsedURL, std::string > && | url | ||
) |
Definition at line 200 of file ShardArchiveHandler.cpp.
bool ripple::RPC::ShardArchiveHandler::start | ( | ) |
Starts downloading and importing archives.
Definition at line 236 of file ShardArchiveHandler.cpp.
void ripple::RPC::ShardArchiveHandler::stop | ( | ) |
Definition at line 177 of file ShardArchiveHandler.cpp.
void ripple::RPC::ShardArchiveHandler::release | ( | ) |
Definition at line 288 of file ShardArchiveHandler.cpp.
|
privatedelete |
|
privatedelete |
|
private |
Definition at line 132 of file ShardArchiveHandler.cpp.
|
private |
Add an archive to be downloaded and imported.
shardIndex | the index of the shard to be imported. |
url | the location of the archive. |
true
if successfully added. Definition at line 215 of file ShardArchiveHandler.cpp.
|
private |
Definition at line 295 of file ShardArchiveHandler.cpp.
|
private |
Definition at line 392 of file ShardArchiveHandler.cpp.
|
private |
Definition at line 473 of file ShardArchiveHandler.cpp.
|
private |
Definition at line 512 of file ShardArchiveHandler.cpp.
|
private |
Definition at line 534 of file ShardArchiveHandler.cpp.
|
private |
Definition at line 561 of file ShardArchiveHandler.cpp.
|
private |
Definition at line 574 of file ShardArchiveHandler.cpp.
|
mutableprivate |
Definition at line 137 of file ShardArchiveHandler.h.
|
private |
Definition at line 138 of file ShardArchiveHandler.h.
|
private |
Definition at line 139 of file ShardArchiveHandler.h.
|
private |
Definition at line 140 of file ShardArchiveHandler.h.
|
private |
Definition at line 141 of file ShardArchiveHandler.h.
|
private |
Definition at line 142 of file ShardArchiveHandler.h.
|
private |
Definition at line 145 of file ShardArchiveHandler.h.
|
private |
Definition at line 146 of file ShardArchiveHandler.h.
|
private |
Definition at line 147 of file ShardArchiveHandler.h.
|
private |
Definition at line 148 of file ShardArchiveHandler.h.
|
private |
Definition at line 149 of file ShardArchiveHandler.h.
|
private |
Definition at line 150 of file ShardArchiveHandler.h.
|
private |
Definition at line 151 of file ShardArchiveHandler.h.