On Fri, 1 Jun 2007 12:54:20 -0700 (PDT) Need wrote: NH> So Robert ..... instead of me implementing sub-containers, lets say I implement NH> your other suggestion of adding all the fields defined in Table2,3,4,5,6 into the "data_context" structure for Table1. I believe I will be able to use a "union" to define these new fields within the structure to conserve space since each table is mutually exclusive to each other.
Ok.. there is one issues with sharing a single container, but you may not care. The problem is that when walking the secondary tables, you will have to add code to each to make sure the current row index applied to the table in question, and then tell the agent to skip the row if it does not. So, if you have 1000 rows in Table1, and only 10 of which are in Table 2, there will be 990 wasted calls to Table2. Also note that there currently is any generated code to handle skipping an inappropriate row, as currently the assumption is that the container only has appropriate rows. But it should be fairly trivial to fix that. NH> I assume the "container_load()" procedure of Table1 (main table) will be called first That is an invalid assumption. By default, the container_load function is called when a request comes in for a table. So it is possible that the first query the agent gets will be for table2, and not table1. Luckily, there is a failry easy way around that, which is sharing a single cache as well. See the function _ifXTable_container_init to see how it looks up the ifTable cache to share a container. Now, the problem is that when you are loading the container, you will have no idea which of the 6 tables triggered the load. NH> When the "container_load()" procedure for Table1 is called, I would like to populate all of Table1 fields at this time, however, must I populate all fields defined in Table2,3,4,5,6 at this time as well? NH> NH> If I do not populate the fields from Table2,3,4,5,6 at this time, then how will I be NH> able to populate the fields later? Will the "container_load()" procedure for Table2,3,4,5,6 be called eventually and should I populate those fields at this time instead? If so, how will I know what correct table index (ie: row index) from Table1 the data should be inserted into at this time? No, as I said before, you can use the row_prep function to delay the data lookup until it is needed. NH> Also, just curious .... when the cache expires, then I assume the "container_load()" procedure is called again to regenerate the complete table over again as it originally did ... is this correct? I assume new rows will be allocated again. Be default, the container is flushed, and must be reloaded from scratch. But you can set some cache attributes to prevent that, but then you must be careful to correctly add new entries and remove old entries. See the ifTable implementation for an example of one way to do this. ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Net-snmp-coders mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
