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/12568 github. org/Juniper/ contrail- controller/ commit/ 0f98cc72fb6c3e0 d15be13e8a3a736 9593a706d6
Committed: http://
Submitter: Zuul
Branch: R2.20
commit 0f98cc72fb6c3e0 d15be13e8a3a736 9593a706d6
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