mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 11:05:54 +00:00
Move ApplicationImp::Sweep from the aux thread to the job pool.
This commit is contained in:
@@ -28,8 +28,9 @@ enum JobType
|
||||
jtWRITE = 13, // Write out hashed objects
|
||||
jtTRANSACTION_l = 14, // A local transaction
|
||||
jtPROPOSAL_t = 15, // A proposal from a trusted source
|
||||
jtADMIN = 16, // An administrative operation
|
||||
jtDEATH = 17, // job of death, used internally
|
||||
jtSWEEP = 16, // Sweep for stale structures
|
||||
jtADMIN = 17, // An administrative operation
|
||||
jtDEATH = 18, // job of death, used internally
|
||||
|
||||
// special types not dispatched by the job pool
|
||||
jtPEER = 24,
|
||||
@@ -40,6 +41,7 @@ enum JobType
|
||||
jtPATH_FIND = 29,
|
||||
jtHO_READ = 30,
|
||||
jtHO_WRITE = 31,
|
||||
jtGENERIC = 32, // Used just to measure time
|
||||
}; // CAUTION: If you add new types, add them to JobType.cpp too
|
||||
|
||||
// VFALCO TODO move this into the enum so it calculates itself?
|
||||
|
||||
@@ -277,6 +277,7 @@ public:
|
||||
void run ();
|
||||
void stop ();
|
||||
void sweep ();
|
||||
void doSweep (Job&);
|
||||
|
||||
private:
|
||||
void updateTables ();
|
||||
@@ -684,10 +685,17 @@ void ApplicationImp::sweep ()
|
||||
getApp().stop ();
|
||||
}
|
||||
|
||||
mJobQueue.addJob(jtSWEEP, "sweep",
|
||||
BIND_TYPE(&ApplicationImp::doSweep, this, P_1));
|
||||
}
|
||||
|
||||
void ApplicationImp::doSweep(Job& j)
|
||||
{
|
||||
// VFALCO NOTE Does the order of calls matter?
|
||||
// VFALCO TODO fix the dependency inversion using an observer,
|
||||
// have listeners register for "onSweep ()" notification.
|
||||
//
|
||||
|
||||
mMasterTransaction.sweep ();
|
||||
m_nodeStore.sweep ();
|
||||
mLedgerMaster.sweep ();
|
||||
@@ -698,7 +706,7 @@ void ApplicationImp::sweep ()
|
||||
AcceptedLedger::sweep (); // VFALCO NOTE AcceptedLedger is/has a singleton?
|
||||
SHAMap::sweep (); // VFALCO NOTE SHAMap is/has a singleton?
|
||||
mNetOps.sweepFetchPack ();
|
||||
// VFALCO NOTE does the call to sweep() happen on another thread?
|
||||
|
||||
mSweepTimer.expires_from_now (boost::posix_time::seconds (theConfig.getSize (siSweepInterval)));
|
||||
mSweepTimer.async_wait (BIND_TYPE (&ApplicationImp::sweep, this));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user