| 
    rippled
    
   | 
 
#include <LedgerReplayTask.h>


Classes | |
| class | TaskParameter | 
Public Member Functions | |
| LedgerReplayTask (Application &app, InboundLedgers &inboundLedgers, LedgerReplayer &replayer, std::shared_ptr< SkipListAcquire > &skipListAcquirer, TaskParameter &¶meter) | |
| Constructor.   | |
| ~LedgerReplayTask () | |
| void | init () | 
| Start the task.   | |
| void | addDelta (std::shared_ptr< LedgerDeltaAcquire > const &delta) | 
| add a new LedgerDeltaAcquire subtask   | |
| TaskParameter const & | getTaskParameter () const | 
| bool | finished () const | 
| return if the task is finished   | |
| virtual void | cancel () | 
| Cancel the task by marking it as failed if the task is not done.   | |
| T | shared_from_this (T... args) | 
| T | weak_from_this (T... args) | 
Protected Types | |
| using | ScopedLockType = std::unique_lock< std::recursive_mutex > | 
Protected Member Functions | |
| void | setTimer (ScopedLockType &) | 
| Schedule a call to queueJob() after mTimerInterval.   | |
| void | queueJob (ScopedLockType &) | 
| Queue a job to call invokeOnTimer().   | |
| bool | isDone () const | 
Protected Attributes | |
| Application & | app_ | 
| beast::Journal | journal_ | 
| std::recursive_mutex | mtx_ | 
| uint256 const | hash_ | 
| The hash of the object (in practice, always a ledger) we are trying to fetch.   | |
| int | timeouts_ | 
| bool | complete_ | 
| bool | failed_ | 
| bool | progress_ | 
| Whether forward progress has been made.   | |
| std::chrono::milliseconds | timerInterval_ | 
| The minimum time to wait between calls to execute().   | |
| QueueJobParameter | queueJobParameter_ | 
Private Member Functions | |
| void | onTimer (bool progress, ScopedLockType &sl) override | 
| Hook called from invokeOnTimer().   | |
| std::weak_ptr< TimeoutCounter > | pmDowncast () override | 
| Return a weak pointer to this.   | |
| 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 | deltaReady (uint256 const &deltaHash) | 
| Notify this task (by a LedgerDeltaAcquire subtask) that a delta is ready.   | |
| void | trigger (ScopedLockType &sl) | 
| Trigger another round.   | |
| void | tryAdvance (ScopedLockType &sl) | 
| Try to build more ledgers.   | |
| void | invokeOnTimer () | 
| Calls onTimer() if in the right state.   | |
Static Private Member Functions | |
| static auto & | getCounter () noexcept | 
Private Attributes | |
| InboundLedgers & | inboundLedgers_ | 
| LedgerReplayer & | replayer_ | 
| TaskParameter | parameter_ | 
| uint32_t | maxTimeouts_ | 
| std::shared_ptr< SkipListAcquire > | skipListAcquirer_ | 
| std::shared_ptr< Ledger const > | parent_ = {} | 
| uint32_t | deltaToBuild_ = 0 | 
| std::vector< std::shared_ptr< LedgerDeltaAcquire > > | deltas_ | 
| boost::asio::basic_waitable_timer< std::chrono::steady_clock > | timer_ | 
Friends | |
| class | test::LedgerReplayClient | 
Definition at line 39 of file LedgerReplayTask.h.
      
  | 
  protectedinherited | 
Definition at line 83 of file TimeoutCounter.h.
| ripple::LedgerReplayTask::LedgerReplayTask | ( | Application & | app, | 
| InboundLedgers & | inboundLedgers, | ||
| LedgerReplayer & | replayer, | ||
| std::shared_ptr< SkipListAcquire > & | skipListAcquirer, | ||
| TaskParameter && | parameter | ||
| ) | 
Constructor.
| app | Application reference | 
| inboundLedgers | InboundLedgers reference | 
| replayer | LedgerReplayer reference | 
| skipListAcquirer | shared_ptr of SkipListAcquire subtask, to make sure it will not be destroyed. | 
| parameter | parameter of the task | 
Definition at line 88 of file LedgerReplayTask.cpp.
| ripple::LedgerReplayTask::~LedgerReplayTask | ( | ) | 
Definition at line 114 of file LedgerReplayTask.cpp.
| void ripple::LedgerReplayTask::init | ( | ) | 
Start the task.
Definition at line 120 of file LedgerReplayTask.cpp.
| void ripple::LedgerReplayTask::addDelta | ( | std::shared_ptr< LedgerDeltaAcquire > const & | delta | ) | 
add a new LedgerDeltaAcquire subtask
| delta | the new LedgerDeltaAcquire subtask | 
Definition at line 278 of file LedgerReplayTask.cpp.
| TaskParameter const & ripple::LedgerReplayTask::getTaskParameter | ( | ) | const | 
Definition at line 122 of file LedgerReplayTask.h.
| bool ripple::LedgerReplayTask::finished | ( | ) | const | 
return if the task is finished
Definition at line 308 of file LedgerReplayTask.cpp.
      
  | 
  overrideprivatevirtual | 
Hook called from invokeOnTimer().
Implements ripple::TimeoutCounter.
Definition at line 256 of file LedgerReplayTask.cpp.
      
  | 
  overrideprivatevirtual | 
Return a weak pointer to this.
Implements ripple::TimeoutCounter.
Definition at line 272 of file LedgerReplayTask.cpp.
      
  | 
  private | 
Update this task (by a SkipListAcquire subtask) when skip list is ready.
| hash | hash of the ledger that has the skip list | 
| seq | sequence number of the ledger that has the skip list | 
| sList | skip list | 
Definition at line 232 of file LedgerReplayTask.cpp.
      
  | 
  private | 
Notify this task (by a LedgerDeltaAcquire subtask) that a delta is ready.
| deltaHash | ledger hash of the delta | 
Definition at line 178 of file LedgerReplayTask.cpp.
      
  | 
  private | 
Trigger another round.
| sl | lock. this function must be called with the lock | 
Definition at line 150 of file LedgerReplayTask.cpp.
      
  | 
  private | 
Try to build more ledgers.
| sl | lock. this function must be called with the lock | 
Definition at line 188 of file LedgerReplayTask.cpp.
      
  | 
  virtualinherited | 
Cancel the task by marking it as failed if the task is not done.
Definition at line 118 of file TimeoutCounter.cpp.
      
  | 
  protectedinherited | 
Schedule a call to queueJob() after mTimerInterval.
Definition at line 50 of file TimeoutCounter.cpp.
      
  | 
  protectedinherited | 
Queue a job to call invokeOnTimer().
Definition at line 69 of file TimeoutCounter.cpp.
      
  | 
  protectedinherited | 
Definition at line 118 of file TimeoutCounter.h.
      
  | 
  privateinherited | 
Calls onTimer() if in the right state.
Only called by queueJob().
Definition at line 93 of file TimeoutCounter.cpp.
      
  | 
  staticprivatenoexceptinherited | 
Definition at line 129 of file CountedObject.h.
      
  | 
  friend | 
Definition at line 180 of file LedgerReplayTask.h.
      
  | 
  private | 
Definition at line 171 of file LedgerReplayTask.h.
      
  | 
  private | 
Definition at line 172 of file LedgerReplayTask.h.
      
  | 
  private | 
Definition at line 173 of file LedgerReplayTask.h.
      
  | 
  private | 
Definition at line 174 of file LedgerReplayTask.h.
      
  | 
  private | 
Definition at line 175 of file LedgerReplayTask.h.
      
  | 
  private | 
Definition at line 176 of file LedgerReplayTask.h.
      
  | 
  private | 
Definition at line 177 of file LedgerReplayTask.h.
      
  | 
  private | 
Definition at line 178 of file LedgerReplayTask.h.
      
  | 
  protectedinherited | 
Definition at line 125 of file TimeoutCounter.h.
      
  | 
  protectedinherited | 
Definition at line 126 of file TimeoutCounter.h.
      
  | 
  mutableprotectedinherited | 
Definition at line 127 of file TimeoutCounter.h.
      
  | 
  protectedinherited | 
The hash of the object (in practice, always a ledger) we are trying to fetch.
Definition at line 131 of file TimeoutCounter.h.
      
  | 
  protectedinherited | 
Definition at line 132 of file TimeoutCounter.h.
      
  | 
  protectedinherited | 
Definition at line 133 of file TimeoutCounter.h.
      
  | 
  protectedinherited | 
Definition at line 134 of file TimeoutCounter.h.
      
  | 
  protectedinherited | 
Whether forward progress has been made.
Definition at line 136 of file TimeoutCounter.h.
      
  | 
  protectedinherited | 
The minimum time to wait between calls to execute().
Definition at line 138 of file TimeoutCounter.h.
      
  | 
  protectedinherited | 
Definition at line 140 of file TimeoutCounter.h.
      
  | 
  privateinherited | 
Definition at line 149 of file TimeoutCounter.h.