Support pagination of output for routing instance introspect
Limit the maximum number of entries displayed on a single page for
both regular and summary requests. A next_batch link is generated
if there are more entries to be displayed.
Also limit maximum number of entries examined in one invocation of
the callback routine. This comes into play when there is a search
string specified and many entries don't match it. A partial page
is saved in user-allocated data and the next invocation of callback
appends to it. This is repeated till there's a full page or there
are no more entries in the table.
Following changes are implemented:
- Move code from bgp_sandesh.cc to bgp_show_routing_instance.cc
- Use templates to reuse code for regular and summary requests
- Implement iteration limit to avoid hogging CPU from introspect
- Add unit tests to cover combinations of page and iteration limits
- Remove older unit tests which were limited in scope
- Sprinkle const as required
Reviewed: https:/ /review. opencontrail. org/12569 github. org/Juniper/ contrail- controller/ commit/ ef6aafd77493908 5dfcf9a31bcb40e 58c16d401f
Committed: http://
Submitter: Zuul
Branch: master
commit ef6aafd77493908 5dfcf9a31bcb40e 58c16d401f
Author: Nischal Sheth <email address hidden>
Date: Thu Jul 16 13:31:32 2015 -0700
Support pagination of output for routing instance introspect
Limit the maximum number of entries displayed on a single page for
both regular and summary requests. A next_batch link is generated
if there are more entries to be displayed.
Also limit maximum number of entries examined in one invocation of
the callback routine. This comes into play when there is a search
string specified and many entries don't match it. A partial page
is saved in user-allocated data and the next invocation of callback
appends to it. This is repeated till there's a full page or there
are no more entries in the table.
Following changes are implemented:
- Move code from bgp_sandesh.cc to bgp_show_ routing_ instance. cc
- Use templates to reuse code for regular and summary requests
- Implement iteration limit to avoid hogging CPU from introspect
- Add unit tests to cover combinations of page and iteration limits
- Remove older unit tests which were limited in scope
- Sprinkle const as required
Change-Id: I9ef440fc569828 be5dd34bd9ce699 c95f9bf5aac
Closes-Bug: 1475803