Support pagination of output for rtarget group introspect
Limit the maximum number of entries displayed on a single page.
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 introspect commands to bgp_peer.sandesh
- Move code from rtarget_group_mgr.cc to bgp_show_rtarget_group.cc
- Use class template BgpShowHandler to avoid code duplication
- Implement iteration limit to avoid hogging CPU from introspect
- Make some typedefs in RTargetGroupMgr private
- Add unit tests to cover combinations of page and iteration limits
Reviewed: https:/ /review. opencontrail. org/13188 github. org/Juniper/ contrail- controller/ commit/ 1daccd58653d7fb ea482aacf222f1b afae384800
Committed: http://
Submitter: Zuul
Branch: R2.20
commit 1daccd58653d7fb ea482aacf222f1b afae384800
Author: Nischal Sheth <email address hidden>
Date: Tue Aug 18 08:53:41 2015 -0700
Support pagination of output for rtarget group introspect
Limit the maximum number of entries displayed on a single page.
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 introspect commands to bgp_peer.sandesh group_mgr. cc to bgp_show_ rtarget_ group.cc
- Move code from rtarget_
- Use class template BgpShowHandler to avoid code duplication
- Implement iteration limit to avoid hogging CPU from introspect
- Make some typedefs in RTargetGroupMgr private
- Add unit tests to cover combinations of page and iteration limits
Change-Id: I526b983b03024d 248f5220d4692b0 ef5880dcb9a
Closes-Bug: 1485726