From fcd7522922333b762eb81bfe9fd09804574dc5f0 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Tue, 13 Aug 2013 14:05:32 -0700 Subject: [PATCH] Put ledgerAdvance jobs in their own class. --- modules/ripple_app/ledger/LedgerMaster.cpp | 2 +- modules/ripple_core/functional/ripple_Job.cpp | 3 +++ modules/ripple_core/functional/ripple_Job.h | 19 ++++++++++--------- .../functional/ripple_JobQueue.cpp | 1 + 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/modules/ripple_app/ledger/LedgerMaster.cpp b/modules/ripple_app/ledger/LedgerMaster.cpp index bed082bc70..8938e43dff 100644 --- a/modules/ripple_app/ledger/LedgerMaster.cpp +++ b/modules/ripple_app/ledger/LedgerMaster.cpp @@ -746,7 +746,7 @@ void LedgerMaster::tryAdvance() if (!mAdvanceThread && mValidLedger) { mAdvanceThread = true; - getApp().getJobQueue ().addJob (jtPUBLEDGER, "Ledger::advanceThread", + getApp().getJobQueue ().addJob (jtADVANCE, "advanceLedger", BIND_TYPE (&LedgerMaster::advanceThread, this)); } } diff --git a/modules/ripple_core/functional/ripple_Job.cpp b/modules/ripple_core/functional/ripple_Job.cpp index c6d8d7df75..2398223910 100644 --- a/modules/ripple_core/functional/ripple_Job.cpp +++ b/modules/ripple_core/functional/ripple_Job.cpp @@ -88,6 +88,9 @@ const char* Job::toString (JobType t) case jtPUBLEDGER: return "publishNewLedger"; + case jtADVANCE: + return "advanceLedger"; + case jtVALIDATION_t: return "trustedValidation"; diff --git a/modules/ripple_core/functional/ripple_Job.h b/modules/ripple_core/functional/ripple_Job.h index 5e77253728..8e28111830 100644 --- a/modules/ripple_core/functional/ripple_Job.h +++ b/modules/ripple_core/functional/ripple_Job.h @@ -22,15 +22,16 @@ enum JobType jtLEDGER_DATA = 7, // Received data for a ledger we're acquiring jtUPDATE_PF = 8, // Update pathfinding requests jtCLIENT = 9, // A websocket command from the client - jtTRANSACTION = 10, // A transaction received from the network - jtPUBLEDGER = 11, // Publish a fully-accepted ledger - jtTXN_DATA = 12, // Fetch a proposed set - jtWAL = 13, // Write-ahead logging - jtVALIDATION_t = 14, // A validation from a trusted source - jtWRITE = 15, // Write out hashed objects - jtPROPOSAL_t = 16, // A proposal from a trusted source - jtSWEEP = 17, // Sweep for stale structures - jtADMIN = 18, // An administrative operation + jtTRANSACTION = 10, // A transaction received from the network + jtADVANCE = 11, // Advance validated/acquired ledgers + jtPUBLEDGER = 12, // Publish a fully-accepted ledger + jtTXN_DATA = 13, // Fetch a proposed set + jtWAL = 14, // Write-ahead logging + jtVALIDATION_t = 15, // A validation from a trusted source + jtWRITE = 16, // Write out hashed objects + jtPROPOSAL_t = 17, // A proposal from a trusted source + jtSWEEP = 18, // Sweep for stale structures + jtADMIN = 19, // An administrative operation // special types not dispatched by the job pool jtPEER = 24, diff --git a/modules/ripple_core/functional/ripple_JobQueue.cpp b/modules/ripple_core/functional/ripple_JobQueue.cpp index 6b01cf3a88..8cc2a82387 100644 --- a/modules/ripple_core/functional/ripple_JobQueue.cpp +++ b/modules/ripple_core/functional/ripple_JobQueue.cpp @@ -454,6 +454,7 @@ int JobQueue::getJobLimit (JobType type) case jtCLIENT: case jtTRANSACTION: case jtPUBLEDGER: + case jtADVANCE: case jtWAL: case jtVALIDATION_t: case jtWRITE: