Batched transaction application:

Applying multiple transactions to the open ledger
reduces SHAMap modification overhead.
This commit is contained in:
Mark Travis
2015-05-29 00:09:44 -07:00
committed by Nik Bougalis
parent 4225b78bf5
commit ca800f9e8d
11 changed files with 370 additions and 172 deletions

View File

@@ -21,7 +21,6 @@
#include <ripple/app/ledger/LedgerMaster.h>
#include <ripple/app/ledger/InboundLedgers.h>
#include <ripple/app/ledger/LedgerHistory.h>
#include <ripple/app/ledger/LedgerHolder.h>
#include <ripple/app/ledger/OrderBookDB.h>
#include <ripple/app/ledger/PendingSaves.h>
#include <ripple/app/ledger/impl/LedgerCleaner.h>
@@ -398,27 +397,6 @@ public:
mBuildingLedgerSeq.store (i);
}
TER doTransaction (STTx::ref txn, TransactionEngineParams params, bool& didApply)
{
Ledger::pointer ledger;
TransactionEngine engine;
TER result;
didApply = false;
{
ScopedLockType sl (m_mutex);
ledger = mCurrentLedger.getMutable ();
engine.setLedger (ledger);
std::tie(result, didApply) = engine.applyTransaction (*txn, params);
}
if (didApply)
{
mCurrentLedger.set (ledger);
getApp().getOPs ().pubProposedTransaction (ledger, txn, result);
}
return result;
}
bool haveLedgerRange (std::uint32_t from, std::uint32_t to)
{
ScopedLockType sl (mCompleteLock);
@@ -1371,6 +1349,11 @@ public:
return mCurrentLedger.get ();
}
LedgerHolder& getCurrentLedgerHolder() override
{
return mCurrentLedger;
}
// The finalized ledger is the last closed/accepted ledger
Ledger::pointer getClosedLedger ()
{