mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Move static treeNodeCache from SHAMap to the Application
These changes address two JIRA issues: - 291 unittest reported leaked objects - 292 SHAMap::treeNodeCache should be a dependency injection The treeNodeCache was a static member of SHAMap. It's now a non-static member of the Application accessed through getTreeNodeCache(). That addressed JIRA 291 The SHAMap constructors were adjusted so the treeNodeCache is passed in to the constructor. That addresses JIRA 292, It required that any code constructing a SHAMap needed to be edited to pass the new parameter to the constructed SHAMap. In the mean time, SHAMap was examined for dead/unused code and interfaces that could be made private. Dead and unused interfaces were removed and methods that could be private were made private.
This commit is contained in:
committed by
Vinnie Falco
parent
55222dc5d1
commit
837872c3f3
@@ -30,7 +30,7 @@
|
||||
#include <ripple/nodestore/Manager.h>
|
||||
#include <ripple/overlay/make_Overlay.h>
|
||||
#include <fstream>
|
||||
|
||||
|
||||
namespace ripple {
|
||||
|
||||
// VFALCO TODO Clean this global up
|
||||
@@ -147,6 +147,7 @@ public:
|
||||
std::unique_ptr <NodeStore::Manager> m_nodeStoreManager;
|
||||
|
||||
NodeCache m_tempNodeCache;
|
||||
TreeNodeCache m_treeNodeCache;
|
||||
SLECache m_sleCache;
|
||||
LocalCredentials m_localCredentials;
|
||||
TransactionMaster m_txMaster;
|
||||
@@ -230,6 +231,9 @@ public:
|
||||
, m_tempNodeCache ("NodeCache", 16384, 90, get_seconds_clock (),
|
||||
m_logs.journal("TaggedCache"))
|
||||
|
||||
, m_treeNodeCache ("TreeNodeCache", 65536, 60, get_seconds_clock (),
|
||||
deprecatedLogs().journal("TaggedCache"))
|
||||
|
||||
, m_sleCache ("LedgerEntryCache", 4096, 120, get_seconds_clock (),
|
||||
m_logs.journal("TaggedCache"))
|
||||
|
||||
@@ -421,6 +425,11 @@ public:
|
||||
return m_tempNodeCache;
|
||||
}
|
||||
|
||||
TreeNodeCache& getTreeNodeCache ()
|
||||
{
|
||||
return m_treeNodeCache;
|
||||
}
|
||||
|
||||
NodeStore::Database& getNodeStore ()
|
||||
{
|
||||
return *m_nodeStore;
|
||||
@@ -679,7 +688,8 @@ public:
|
||||
m_ledgerMaster->tune (getConfig ().getSize (siLedgerSize), getConfig ().getSize (siLedgerAge));
|
||||
m_sleCache.setTargetSize (getConfig ().getSize (siSLECacheSize));
|
||||
m_sleCache.setTargetAge (getConfig ().getSize (siSLECacheAge));
|
||||
SHAMap::setTreeCache (getConfig ().getSize (siTreeCacheSize), getConfig ().getSize (siTreeCacheAge));
|
||||
m_treeNodeCache.setTargetSize (getConfig ().getSize (siTreeCacheSize));
|
||||
m_treeNodeCache.setTargetAge (getConfig ().getSize (siTreeCacheAge));
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
@@ -1050,8 +1060,8 @@ public:
|
||||
logTimedCall (m_journal.warning, "AcceptedLedger::sweep", __FILE__, __LINE__,
|
||||
&AcceptedLedger::sweep);
|
||||
|
||||
logTimedCall (m_journal.warning, "SHAMap::sweep", __FILE__, __LINE__,
|
||||
&SHAMap::sweep);
|
||||
logTimedCall (m_journal.warning, "SHAMap::sweep", __FILE__, __LINE__,std::bind (
|
||||
&TreeNodeCache::sweep, &m_treeNodeCache));
|
||||
|
||||
logTimedCall (m_journal.warning, "NetworkOPs::sweepFetchPack", __FILE__, __LINE__, std::bind (
|
||||
&NetworkOPs::sweepFetchPack, m_networkOPs.get ()));
|
||||
|
||||
Reference in New Issue
Block a user