Thank you for the answers.
 
I do have another question.
 
Suppose i have tables that are related. For instance, one table is a generic table of programs currently present in a video stream which contains some common information for each program. The other table contains a specific information regarding the program which structure depends on the type of the program.
 
I would like to perform some actions on both of the tables. For example, refreshing the indexes information at the same time (e.g. as a result of some event). Can I register a handler for treating multiple tables? Can I register a handler for handling a range of nodes/tables, or a whole node tree (including the sub nodes)?
 
Thanks,
Michael.
 
On 1/26/06, Dave Shield <[EMAIL PROTECTED]> wrote:
On Thu, 2006-01-26 at 12:29 +0200, Michael G wrote:
> Regarding option 2, I can't see how can I cache only the indexes.
> Consider the following scenario:
>       * Caching the indexes.
>       * The internal module data changes (The dynamic indexes change
>         too).
>       * Getting a request from NMS station.
>       * Trying to fetch index that is no longer exist ???

Then invalidate the cache, and reload the index information.
You can then try processing the request again.

Caching the indexes basically helps you when:

a) The internal module data has not changed since
    the cache was last loaded, or
b) The internal module data has changed, but the
    list of valid rows has not.


> 2. Algorithm 2:
> Using a copy (cache) of the indexes and the data.
> Update the cache when you receive some signal from the module that the
> data was changed (when available) or on a time basis. (Hold access to
> data while refreshing the cache and assure data is valid).

That's basically the model used by the cache helper, and any table
helpers that can use it (including MfD, iterator, tdata, etc).

Not responding to an external signal, though that wouldn't be
too difficult to implement - but updating (or at least releasing)
the cache when it's regarded as "too old".


> (Do I have an option to reload the cache without using a timer event?)

Just call the routine "netsnmp_check_cache_and_reload()"



> Also I would like to know if there is a way to use a scheme that
> generates a cache driven code but without all this code mass that is
> produced by the mfd option.

Most of the table helpers can use the cache helper.
Try

   mib2c -S cache=1 -c mib2c.table_data.conf  myTable

and look at the template generated.
(I'm not 100% sure that this is the right syntax, but I think it is).

Dave


Reply via email to