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/12645 github. org/Juniper/ contrail- controller/ commit/ 48541a2aca59631 38689ffb908ea4a f4bbc03762
Committed: http://
Submitter: Zuul
Branch: master
commit 48541a2aca59631 38689ffb908ea4a f4bbc03762
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