On Wed, 29 Sep 2004 14:07:54 -0400 [EMAIL PROTECTED] wrote: CRC> I have a sub-agent which provides access to a table that is fairly CRC> expensive to build [...]. CRC> CRC> [...] As I CRC> understand it -- and I'm happy to be corrected -- when a request comes in CRC> for table data, the (sub-)agent gathers information about the size of the CRC> table and its keys [...] then uses that information to CRC> figure out what keys to give get_dot1dTpFdbAddress(), etc. to get all the CRC> data necessary to satisfy all the requests in the message. Right so far?
yep. CRC> My first-pass implementation gets external data and caches it in an array CRC> of structures inside the get_*_data_point() routines but it takes a while. CRC> As a result, if a client asks for individual values from the table (one CRC> request per message), then I build the table over and over again, CRC> incurring all of the overhead on every request. This is a know issue with the table iterator code. CRC> One solution would be to put some sort of timer on my cache so that CRC> I don't refill it for _every_ message. That has problems with stale data, CRC> etc. And that is the easiest solution. CRC> It's fairly easy and cheap for me to get _one_ record for one MAC address Is it easy to know if the external data has changed (eg data added or deleted)? If so, then you would only have to rebuild your cache when rows were added/deleted. CRC> [...] if there were just some way to bypass the CRC> get_*_data_point() routines and let the data access routine build CRC> individual records in the cache (or return data directly) but I don't see CRC> how the table iterator architecture lets me do that. You are right, it wasn't designed to work that way. CRC> I'd rather not have to recode without the table helpers but I seem to have CRC> a mismatch between my requirements and the table interator stuff. I hope CRC> someone more familiar with this area can provide some net-snmp insight. The main purpose of the table iterator is to isolate you from having to deal with index lookups. If you want to do the index lookups, then you should register a regular table handler. All your existing handler code remains almost exactly the same. You just have to do the data lookup first. -- Robert Story; NET-SNMP Junkie <http://www.net-snmp.org/> <irc://irc.freenode.net/#net-snmp> Archive: <http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-users> You are lost in a twisty maze of little standards, all different. ------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ Net-snmp-users mailing list [EMAIL PROTECTED] Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users