From: Dave S. <D.T...@cs...> - 2003-08-15 10:15:11
|
Dave> this stash_cache seems to be completely separate from my cache_handler. Dave> Is it worth looking at merging the two? Wes> Yes... it was my end goal to make one make use of the other but I Wes> hadn't gotten that far yet. Initial concepts were checked in, but Wes> they're not polished. Wes> Remember, my philosophy is "incremental changes" Fair comment. And it sounds as if we're reasonably in agreement over the changes to the cache handler. So that would mean that the stash_cache would be primarily concerned with loading and storing the data. Dave> It's probably not applicable to the dataset helper Wes> Actually, the dataset helper might get a pretty big speed enhancement Wes> as well, since its a linked list and the stash_cache uses a tree structure. Hmmm.... That's got me thinking.... As I understand it, the stash_cache is currently handling three separate (though related) things. a) auto-loading the data b) storing it in an appropriate structure c) freeing it when "too old" c) will be more sensibly handled by the cache_handler, once we've sorted out the deficiencies in my original design. b) sounds to be *exactly* the role of the current data_set handler (just loaded at initialisation and/or SET, rather than dynamically) So both the data_set and stash_cache helpers need some form of storing the data (it doesn't really matter how). The differences lie in how and when this storage is populated. So how about the following set of helpers: A) a 'stash' helper, which takes SNMP data (in some defined format) and stores it in an appropriate (efficient) structure. B) an 'auto-stash' helper, which uses the cache_handler, and re-loads the 'stash' helper when required. SET requests would typically invalidate the stash. C) a 'data_stash' helper, which populates the stash at initialisation, and updates it on demand. SET requests would typically *NOT* invalidate the stash. The bulk of the work feels to be in A) The other two are really just wrappers round it. (I'm not actually sure whether A) and C) are sufficiently distinct to require separate helpers, but I'll leave it like that for clarity). Thoughts? Dave |