diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2017-03-21 06:15:49 -0700 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2017-03-21 06:15:49 -0700 |
commit | c62141fd9870eabf6f987da8e2a82ff5a999ddcf (patch) | |
tree | c9c50d6552d4c4895e0db2714939fd8ee9f613a0 /controller/EmbeddedNetworkController.hpp | |
parent | ae303ee90276f7cf85079c66d35716f80ea2321f (diff) | |
download | infinitytier-c62141fd9870eabf6f987da8e2a82ff5a999ddcf.tar.gz infinitytier-c62141fd9870eabf6f987da8e2a82ff5a999ddcf.zip |
Make controller do a simple write-through cache without revalidating. Means you must restart if files change on disk, but will decrease I/O considerably.
Diffstat (limited to 'controller/EmbeddedNetworkController.hpp')
-rw-r--r-- | controller/EmbeddedNetworkController.hpp | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/controller/EmbeddedNetworkController.hpp b/controller/EmbeddedNetworkController.hpp index a7277ace..5d2454ed 100644 --- a/controller/EmbeddedNetworkController.hpp +++ b/controller/EmbeddedNetworkController.hpp @@ -99,12 +99,7 @@ public: private: static void _circuitTestCallback(ZT_Node *node,ZT_CircuitTest *test,const ZT_CircuitTestReport *report); - void _request( - uint64_t nwid, - const InetAddress &fromAddr, - uint64_t requestPacketId, - const Identity &identity, - const Dictionary<ZT_NETWORKCONFIG_METADATA_DICT_CAPACITY> &metaData); + void _request(uint64_t nwid,const InetAddress &fromAddr,uint64_t requestPacketId,const Identity &identity,const Dictionary<ZT_NETWORKCONFIG_METADATA_DICT_CAPACITY> &metaData); struct _RQEntry { @@ -134,12 +129,9 @@ private: }; std::map<uint64_t,_NetworkMemberInfo> _nmiCache; Mutex _nmiCache_m; + void _getNetworkMemberInfo(uint64_t now,uint64_t nwid,_NetworkMemberInfo &nmi); - inline void _clearNetworkMemberInfoCache(const uint64_t nwid) - { - Mutex::Lock _l(_nmiCache_m); - _nmiCache.erase(nwid); - } + inline void _clearNetworkMemberInfoCache(const uint64_t nwid) { Mutex::Lock _l(_nmiCache_m); _nmiCache.erase(nwid); } void _pushMemberUpdate(uint64_t now,uint64_t nwid,const nlohmann::json &member); |