20 #ifndef RIPPLE_APP_LEDGER_LEDGERREPLAYTASK_H_INCLUDED
21 #define RIPPLE_APP_LEDGER_LEDGERREPLAYTASK_H_INCLUDED
23 #include <ripple/app/ledger/InboundLedger.h>
24 #include <ripple/app/ledger/impl/TimeoutCounter.h>
25 #include <ripple/app/main/Application.h>
33 class LedgerDeltaAcquire;
35 class SkipListAcquire;
37 class LedgerReplayClient;
69 uint256 const& finishLedgerHash,
std::vector< std::shared_ptr< LedgerDeltaAcquire > > deltas_
std::unique_lock< std::recursive_mutex > ScopedLockType
void onTimer(bool progress, ScopedLockType &sl) override
Hook called from invokeOnTimer().
Tracks the number of instances of an object.
InboundLedger::Reason reason_
LedgerReplayer & replayer_
TaskParameter const & getTaskParameter() const
void deltaReady(uint256 const &deltaHash)
Notify this task (by a LedgerDeltaAcquire subtask) that a delta is ready.
LedgerReplayTask(Application &app, InboundLedgers &inboundLedgers, LedgerReplayer &replayer, std::shared_ptr< SkipListAcquire > &skipListAcquirer, TaskParameter &¶meter)
Constructor.
std::weak_ptr< TimeoutCounter > pmDowncast() override
Return a weak pointer to this.
void trigger(ScopedLockType &sl)
Trigger another round.
This class is an "active" object.
void updateSkipList(uint256 const &hash, std::uint32_t seq, std::vector< uint256 > const &sList)
Update this task (by a SkipListAcquire subtask) when skip list is ready.
void tryAdvance(ScopedLockType &sl)
Try to build more ledgers.
bool update(uint256 const &hash, std::uint32_t seq, std::vector< uint256 > const &sList)
fill all the fields that was not filled during construction
void addDelta(std::shared_ptr< LedgerDeltaAcquire > const &delta)
add a new LedgerDeltaAcquire subtask
Integers of any length that is a multiple of 32-bits.
std::shared_ptr< Ledger const > parent_
TaskParameter(InboundLedger::Reason r, uint256 const &finishLedgerHash, std::uint32_t totalNumLedgers)
constructor
InboundLedgers & inboundLedgers_
bool finished() const
return if the task is finished
Ledger replay client side.
Manages the lifetime of inbound ledgers.
void init()
Start the task.
std::vector< uint256 > skipList_
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
std::shared_ptr< SkipListAcquire > skipListAcquirer_
Manages the lifetime of ledger replay tasks.
std::uint32_t totalLedgers_
bool canMergeInto(TaskParameter const &existingTask) const
check if this task can be merged into an existing task