Support pagination of output for instance config introspect
Limit the maximum number of entries displayed on a single page. A
next_batch link is generated if there are more entries to display.
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:
- Add class template BgpShowHandler to facilitate code reuse
- Move code from bgp_sandesh.cc to bgp_show_config.cc
- Implement iteration limit to avoid hogging CPU from introspect
- Reuse typed tests to also cover instance config
- Fix a few typos in comments for typed tests
Reviewed: https:/ /review. opencontrail. org/12654 github. org/Juniper/ contrail- controller/ commit/ d69d6d50c85e88b 9ada9557d6cc784 0cb20a999f
Committed: http://
Submitter: Zuul
Branch: R2.20
commit d69d6d50c85e88b 9ada9557d6cc784 0cb20a999f
Author: Nischal Sheth <email address hidden>
Date: Fri Jul 24 14:26:15 2015 -0700
Support pagination of output for instance config introspect
Limit the maximum number of entries displayed on a single page. A
next_batch link is generated if there are more entries to display.
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:
- Add class template BgpShowHandler to facilitate code reuse
- Move code from bgp_sandesh.cc to bgp_show_config.cc
- Implement iteration limit to avoid hogging CPU from introspect
- Reuse typed tests to also cover instance config
- Fix a few typos in comments for typed tests
Change-Id: I48389edd40fd09 9539210723690d6 cbad317efa8
Closes-Bug: 1478154