Remove the JSONCache. It was basically a failed experiment.

This commit is contained in:
JoelKatz
2013-06-28 16:07:32 -07:00
parent 27c761aa9c
commit ca4a2ad104
9 changed files with 1 additions and 327 deletions

View File

@@ -23,7 +23,7 @@ NetworkOPs::NetworkOPs (boost::asio::io_service& io_service, LedgerMaster* pLedg
mFeatureBlocked (false),
mNetTimer (io_service), mLedgerMaster (pLedgerMaster), mCloseTimeOffset (0), mLastCloseProposers (0),
mLastCloseConvergeTime (1000 * LEDGER_IDLE_INTERVAL), mLastCloseTime (0), mLastValidationTime (0),
mJSONCache (120), mFetchPack ("FetchPack", 2048, 20), mLastFetchPack (0), mFetchSeq (static_cast<uint32> (-1)),
mFetchPack ("FetchPack", 2048, 20), mLastFetchPack (0), mFetchSeq (static_cast<uint32> (-1)),
mLastLoadBase (256), mLastLoadFactor (256)
{
}
@@ -2219,7 +2219,6 @@ void NetworkOPs::makeFetchPack (Job&, boost::weak_ptr<Peer> wPeer,
void NetworkOPs::sweepFetchPack ()
{
mFetchPack.sweep ();
mJSONCache.sweep ();
}
void NetworkOPs::addFetchPack (uint256 const& hash, boost::shared_ptr< Blob >& data)

View File

@@ -225,28 +225,6 @@ public:
int getFetchSize ();
void sweepFetchPack ();
float getJSONHitRate ()
{
return mJSONCache.getHitRate ();
}
// VFALCO TODO Rename this to getNumberOfCachedJSONItems or something similar
int getJSONEntries ()
{
return mJSONCache.getNumberOfEntries ();
}
void storeJSONCache (JSONCache::Kind kind, const uint256& ledger, const uint160& object,
const boost::shared_ptr <Json::Value>& data)
{
mJSONCache.storeEntry (kind, ledger, object, data);
}
boost::shared_ptr<Json::Value> getJSONCache (JSONCache::Kind kind, const uint256& ledger, const uint160& object)
{
return mJSONCache.getEntry (kind, ledger, object);
}
// network state machine
void checkState (const boost::system::error_code& result);
void switchLastClosedLedger (Ledger::pointer newLedger, bool duringConsensus); // Used for the "jump" case
@@ -417,8 +395,6 @@ private:
subMapType mSubTransactions; // all accepted transactions
subMapType mSubRTTransactions; // all proposed and accepted transactions
JSONCache mJSONCache;
TaggedCache< uint256, Blob , UptimeTimerAdapter > mFetchPack;
uint32 mLastFetchPack;
uint32 mFetchSeq;

View File

@@ -2412,8 +2412,6 @@ Json::Value RPCHandler::doGetCounts (Json::Value params, LoadType* loadType, Sco
ret["node_hit_rate"] = theApp->getHashedObjectStore ().getCacheHitRate ();
ret["ledger_hit_rate"] = theApp->getLedgerMaster ().getCacheHitRate ();
ret["AL_hit_rate"] = AcceptedLedger::getCacheHitRate ();
ret["JC_hit_rate"] = theApp->getOPs ().getJSONHitRate ();
ret["JC_size"] = theApp->getOPs ().getJSONEntries ();
ret["fullbelow_size"] = SHAMap::getFullBelowSize ();