5 #include <sandesh/request_pipeline.h>
7 #include <boost/bind.hpp>
8 #include <boost/assign/list_of.hpp>
19 #include "config_client_show_types.h"
31 #include "ifmap/ifmap_server_show_types.h"
32 #include "ifmap/ifmap_server_show_internal_types.h"
33 #include "ifmap/ifmap_log_types.h"
38 #include <pugixml/pugixml.hpp>
40 using namespace boost::assign;
54 dest->node_name = src_node->
ToString();
63 dest->dbentryflags.append(
"No state, ");
67 dest->dbentryflags.append(
"Deleted, ");
70 dest->dbentryflags.append(
"OnList, ");
73 dest->dbentryflags.append(
"OnRemoveQ");
76 dest->obj_info.reserve(src_node->
list_.size());
77 for (IFMapNode::ObjectList::const_iterator iter =
78 src_node->
list_.begin(); iter != src_node->
list_.end(); ++iter) {
81 IFMapObjectShowInfo dest_obj;
84 dest_obj.data = GetIFMapObjectData(src_obj);
86 dest->obj_info.push_back(dest_obj);
90 int neighbor_count = 0;
92 src_node->
begin(graph); iter != src_node->
end(graph); ++iter) {
95 dest->neighbors.reserve(neighbor_count);
97 src_node->
begin(graph); iter != src_node->
end(graph); ++iter) {
99 dest->neighbors.push_back(adj->
ToString());
106 pugi::xml_document xdoc;
107 pugi::xml_node xnode = xdoc.append_child(
"iq");
112 string objdata = oss.str();
123 static const uint32_t kMaxElementsPerRound = 50;
139 static bool BufferStageCommon(
const IFMapTableShowReq *request,
141 const string &next_table_name,
142 const string &last_node_name);
143 static bool BufferStage(
const Sandesh *sr,
146 static bool BufferStageIterate(
const Sandesh *sr,
149 static void SendStageCommon(
const IFMapTableShowReq *request,
151 IFMapTableShowResp *response);
153 int stage,
int instNum,
155 static bool SendStageIterate(
const Sandesh *sr,
158 static bool TableToBuffer(
const IFMapTableShowReq *request,
160 const string &last_node_name,
161 ShowData *show_data, uint32_t page_limit);
162 static bool BufferAllTables(
const IFMapTableShowReq *req,
164 const string &next_table_name,
165 const string &last_node_name);
166 static bool BufferOneTable(
const IFMapTableShowReq *request,
168 const string &last_node_name);
169 static bool ConvertReqIterateToReq(
170 const IFMapTableShowReqIterate *req_iterate,
171 IFMapTableShowReq *req,
string *next_table_name,
172 string *last_node_name);
178 const string &last_node_name,
179 ShowData *show_data, uint32_t page_limit) {
181 if (last_node_name.length()) {
194 bool buffer_full =
false;
195 regex search_expr(request->get_search_string());
198 src = partition->GetFirst();
200 for (; src != NULL; src = partition->GetNext(src)) {
205 IFMapNodeShowInfo dest;
226 const string &last_node_name) {
231 request->get_table_name());
234 uint32_t page_limit = GetPageLimit(sctx);
236 TableToBuffer(request, table, sctx->
ifmap_server(), last_node_name,
237 show_data, page_limit);
239 IFMAP_WARN(IFMapTblNotFound,
"Cant show/find table ",
240 request->get_table_name());
248 const string &next_table_name,
249 const string &last_node_name) {
252 string last_name = last_node_name;
256 if (next_table_name.empty()) {
263 uint32_t page_limit = GetPageLimit(sctx);
265 for (; iter != db->
end(); ++iter) {
266 if (iter->first.find(
"__ifmap__.") != 0) {
270 bool buffer_full = TableToBuffer(request, table, sctx->
ifmap_server(),
271 last_name, show_data, page_limit);
288 const IFMapTableShowReqIterate *req_iterate,
289 IFMapTableShowReq *req,
string *next_table_name,
290 string *last_node_name) {
293 req->set_context(req_iterate->context());
295 string node_info = req_iterate->get_node_info();
300 if (pos1 == string::npos) {
303 string table_name = node_info.substr(0, pos1);
307 if (pos2 == string::npos) {
310 string search_string = node_info.substr((pos1 + sep_size),
311 pos2 - (pos1 + sep_size));
315 if (pos3 == string::npos) {
318 *next_table_name = node_info.substr((pos2 + sep_size),
319 pos3 - (pos2 + sep_size));
322 *last_node_name = node_info.substr(pos3 + sep_size);
325 req->set_table_name(table_name);
326 req->set_search_string(search_string);
332 const string &next_table_name,
333 const string &last_node_name) {
335 if (request->get_table_name().length()) {
336 return BufferOneTable(request, data, last_node_name);
338 return BufferAllTables(request, data, next_table_name, last_node_name);
344 int stage,
int instNum,
346 const IFMapTableShowReq *request =
347 static_cast<const IFMapTableShowReq *
>(ps.
snhRequest_.get());
348 string next_table_name;
349 string last_node_name;
350 return BufferStageCommon(request, data, next_table_name, last_node_name);
355 int stage,
int instNum,
357 const IFMapTableShowReqIterate *request_iterate =
358 static_cast<const IFMapTableShowReqIterate *
>(ps.
snhRequest_.get());
360 string next_table_name;
361 string last_node_name;
362 IFMapTableShowReq *request =
new IFMapTableShowReq;
363 bool success = ConvertReqIterateToReq(request_iterate, request,
364 &next_table_name, &last_node_name);
366 BufferStageCommon(request, data, next_table_name, last_node_name);
374 IFMapTableShowResp *response) {
381 vector<IFMapNodeShowInfo> dest_buffer;
387 uint32_t page_limit = GetPageLimit(sctx);
388 if (dest_buffer.size() == page_limit) {
395 response->set_ifmap_db(dest_buffer);
396 response->set_next_batch(next_batch);
401 int stage,
int instNum,
403 const IFMapTableShowReq *request =
404 static_cast<const IFMapTableShowReq *
>(ps.
snhRequest_.get());
405 IFMapTableShowResp *response =
new IFMapTableShowResp;
406 SendStageCommon(request, ps, response);
408 response->set_context(request->context());
409 response->set_more(
false);
410 response->Response();
416 int stage,
int instNum,
418 const IFMapTableShowReqIterate *request_iterate =
419 static_cast<const IFMapTableShowReqIterate *
>(ps.
snhRequest_.get());
421 string next_table_name;
422 string last_node_name;
424 IFMapTableShowResp *response =
new IFMapTableShowResp;
425 IFMapTableShowReq *request =
new IFMapTableShowReq;
426 bool success = ConvertReqIterateToReq(request_iterate, request,
427 &next_table_name, &last_node_name);
429 SendStageCommon(request, ps, response);
432 response->set_context(request->context());
433 response->set_more(
false);
434 response->Response();
440 void IFMapTableShowReq::HandleRequest()
const {
458 ps.stages_ = list_of(s0)(s1)
459 .convert_to_container<vector<RequestPipeline::StageSpec> >();
463 void IFMapTableShowReqIterate::HandleRequest()
const {
481 ps.stages_ = list_of(s0)(s1)
482 .convert_to_container<vector<RequestPipeline::StageSpec> >();
490 static const uint32_t kMaxElementsPerRound = 50;
506 static bool IncludeLink(
DBEntryBase *src,
const string &search_string,
507 const regex &search_expr,
const string &metadata,
508 const regex &metadata_expr);
509 static void CopyNode(IFMapLinkShowInfo *dest,
DBEntryBase *src,
511 static bool BufferStageCommon(
const IFMapLinkTableShowReq *request,
513 const string &last_link_name);
514 static bool BufferStage(
const Sandesh *sr,
517 static bool BufferStageIterate(
const Sandesh *sr,
519 int stage,
int instNum,
521 static void SendStageCommon(
const IFMapLinkTableShowReq *request,
523 IFMapLinkTableShowResp *response);
525 int stage,
int instNum,
527 static bool SendStageIterate(
const Sandesh *sr,
530 static bool ConvertReqIterateToReq(
531 const IFMapLinkTableShowReqIterate *req_iterate,
532 IFMapLinkTableShowReq *req,
string *last_link_name);
536 const string &search_string,
537 const regex &search_expr,
538 const string &metadata,
539 const regex &metadata_expr) {
546 if (!search_string.empty() &&
565 if (src_link->
left()) {
568 if (src_link->
right()) {
578 dest->dbentryflags.append(
"No state, ");
582 dest->dbentryflags.append(
"Deleted, ");
585 dest->dbentryflags.append(
"OnList");
588 dest->dbentryflags.append(
"OnRemoveQ");
592 for (std::vector<IFMapLink::LinkOriginInfo>::const_iterator iter =
596 IFMapLinkOriginShowInfo dest_origin;
599 dest->origins.push_back(dest_origin);
609 const IFMapLinkTableShowReqIterate *req_iterate,
610 IFMapLinkTableShowReq *req,
string *last_link_name) {
613 req->set_context(req_iterate->context());
615 string link_info = req_iterate->get_link_info();
620 if (pos1 == string::npos) {
623 string search_string = link_info.substr(0, pos1);
627 if (pos2 == string::npos) {
630 string metadata = link_info.substr((pos1 + sep_size),
631 pos2 - (pos1 + sep_size));
634 *last_link_name = link_info.substr(pos2 + sep_size);
637 req->set_search_string(search_string);
638 req->set_metadata(metadata);
644 const string &last_link_name) {
645 bool buffer_full =
false;
652 regex search_expr(request->get_search_string());
653 regex metadata_expr(request->get_metadata());
655 uint32_t page_limit = GetPageLimit(sctx);
656 show_data->send_buffer.reserve(page_limit);
657 show_data->table_size = table->
Size();
661 if (last_link_name.length()) {
666 for (; src != NULL; src = partition->
GetNext(src)) {
667 if (IncludeLink(src, request->get_search_string(), search_expr,
668 request->get_metadata(), metadata_expr)) {
669 IFMapLinkShowInfo dest;
671 show_data->send_buffer.push_back(dest);
673 uint32_t page_limit = GetPageLimit(sctx);
674 if (show_data->send_buffer.size() == page_limit) {
676 show_data->last_link_name = src_link->
link_name();
683 IFMAP_WARN(IFMapTblNotFound,
"Cant show/find ",
"link table");
691 int stage,
int instNum,
693 const IFMapLinkTableShowReq *request =
694 static_cast<const IFMapLinkTableShowReq *
>(ps.
snhRequest_.get());
695 string last_link_name;
696 BufferStageCommon(request, data, last_link_name);
702 int stage,
int instNum,
704 const IFMapLinkTableShowReqIterate *request_iterate =
705 static_cast<const IFMapLinkTableShowReqIterate *
>(ps.
snhRequest_.get());
707 IFMapLinkTableShowReq *request =
new IFMapLinkTableShowReq;
708 string last_link_name;
709 bool success = ConvertReqIterateToReq(request_iterate, request,
712 BufferStageCommon(request, data, last_link_name);
720 IFMapLinkTableShowResp *response) {
724 (prev_stage_data->at(0));
726 vector<IFMapLinkShowInfo> dest_buffer;
734 uint32_t page_limit = GetPageLimit(sctx);
735 if (dest_buffer.size() == page_limit) {
741 response->set_table_size(show_data.
table_size);
742 response->set_ifmap_db(dest_buffer);
743 response->set_next_batch(next_batch);
748 int stage,
int instNum,
750 const IFMapLinkTableShowReq *request =
751 static_cast<const IFMapLinkTableShowReq *
>(ps.
snhRequest_.get());
752 IFMapLinkTableShowResp *response =
new IFMapLinkTableShowResp;
753 SendStageCommon(request, ps, response);
755 response->set_context(request->context());
756 response->set_more(
false);
757 response->Response();
763 int stage,
int instNum,
765 const IFMapLinkTableShowReqIterate *request_iterate =
766 static_cast<const IFMapLinkTableShowReqIterate *
>(ps.
snhRequest_.get());
768 IFMapLinkTableShowResp *response =
new IFMapLinkTableShowResp;
769 IFMapLinkTableShowReq *request =
new IFMapLinkTableShowReq;
770 string last_link_name;
771 bool success = ConvertReqIterateToReq(request_iterate, request,
774 SendStageCommon(request, ps, response);
777 response->set_context(request->context());
778 response->set_more(
false);
779 response->Response();
785 void IFMapLinkTableShowReq::HandleRequest()
const {
803 ps.stages_ = list_of(s0)(s1)
804 .convert_to_container<vector<RequestPipeline::StageSpec> >();
808 void IFMapLinkTableShowReqIterate::HandleRequest()
const {
826 ps.stages_ = list_of(s0)(s1)
827 .convert_to_container\
828 <vector<RequestPipeline::StageSpec> >();
834 int stage,
int instNum,
836 const IFMapNodeShowReq *request =
837 static_cast<const IFMapNodeShowReq *
>(ps.
snhRequest_.get());
841 IFMapNodeShowResp *response =
new IFMapNodeShowResp();
843 string fq_node_name = request->get_fq_node_name();
845 size_t type_length = fq_node_name.find(
":");
846 if (type_length != string::npos) {
847 string node_type = fq_node_name.substr(0, type_length);
849 string node_name = fq_node_name.substr(type_length + 1);
856 IFMapNodeShowInfo dest;
858 response->set_node_info(dest);
860 IFMAP_WARN(IFMapIdentifierNotFound,
"Cant find identifier",
864 IFMAP_WARN(IFMapTblNotFound,
"Cant show/find table with node-type",
869 response->set_context(request->context());
870 response->set_more(
false);
871 response->Response();
877 void IFMapNodeShowReq::HandleRequest()
const {
887 ps.stages_ = list_of(s0)
888 .convert_to_container\
889 <vector<RequestPipeline::StageSpec> >();
895 static const uint32_t kMaxElementsPerRound = 50;
911 static bool ConvertReqIterateToReq(
912 const IFMapPerClientNodesShowReqIterate *req_iterate,
913 IFMapPerClientNodesShowReq *req,
string *next_table_name,
914 string *last_node_name);
915 static bool CopyNode(IFMapPerClientNodesShowInfo *dest,
IFMapNode *src,
917 static bool TableToBuffer(
const IFMapPerClientNodesShowReq *request,
919 const string &last_node_name,
int client_index,
920 ShowData *show_data);
921 static bool BufferStageCommon(
const IFMapPerClientNodesShowReq *request,
923 const string &next_table_name,
924 const string &last_node_name);
925 static bool BufferStage(
const Sandesh *sr,
928 static bool BufferStageIterate(
const Sandesh *sr,
930 int stage,
int instNum,
932 static void SendStageCommon(
const IFMapPerClientNodesShowReq *request,
934 IFMapPerClientNodesShowResp *response);
936 int stage,
int instNum,
938 static bool SendStageIterate(
const Sandesh *sr,
950 const IFMapPerClientNodesShowReqIterate *req_iterate,
951 IFMapPerClientNodesShowReq *req,
string *next_table_name,
952 string *last_node_name) {
955 req->set_context(req_iterate->context());
957 string node_info = req_iterate->get_node_info();
962 if (pos1 == string::npos) {
965 string client_index_or_name = node_info.substr(0, pos1);
969 if (pos2 == string::npos) {
972 string search_string = node_info.substr((pos1 + sep_size),
973 pos2 - (pos1 + sep_size));
977 if (pos3 == string::npos) {
980 *next_table_name = node_info.substr((pos2 + sep_size),
981 pos3 - (pos2 + sep_size));
984 *last_node_name = node_info.substr(pos3 + sep_size);
987 req->set_client_index_or_name(client_index_or_name);
988 req->set_search_string(search_string);
1008 dest->interest_tracked =
"Yes";
1010 dest->interest_tracked =
"No";
1013 dest->interest_tracked =
"No tracker";
1019 dest->advertised_tracked =
"Yes";
1021 dest->advertised_tracked =
"No";
1024 dest->advertised_tracked =
"No tracker";
1033 const IFMapPerClientNodesShowReq *request,
IFMapTable *table,
1034 IFMapServer *ifmap_server,
const string &last_node_name,
1035 int client_index,
ShowData *show_data) {
1038 if (last_node_name.length()) {
1051 bool buffer_full =
false;
1052 string search_string = request->get_search_string();
1057 for (; src != NULL; src = partition->
GetNext(src)) {
1059 if (!search_string.empty() &&
1060 (src_node->
ToString().find(search_string) == string::npos)) {
1063 IFMapPerClientNodesShowInfo dest;
1064 bool send = CopyNode(&dest, src_node, ifmap_server, client_index);
1073 if (show_data->
send_buffer.size() == page_limit) {
1089 const IFMapPerClientNodesShowReq *request,
1091 const string &last_node_name) {
1099 string client_index_or_name = request->get_client_index_or_name();
1108 string last_name = last_node_name;
1109 string search_string = request->get_search_string();
1113 if (next_table_name.empty()) {
1119 uint32_t page_limit = GetPageLimit(sctx);
1122 for (; iter != db->
end(); ++iter) {
1123 if (iter->first.find(
"__ifmap__.") != 0) {
1127 bool buffer_full = TableToBuffer(request, table, ifmap_server,
1128 last_name, client_index, show_data);
1141 int stage,
int instNum,
1143 const IFMapPerClientNodesShowReq *request =
1144 static_cast<const IFMapPerClientNodesShowReq *
>(ps.
snhRequest_.get());
1147 if (request->get_client_index_or_name().empty()) {
1151 string next_table_name;
1152 string last_node_name;
1153 return BufferStageCommon(request, data, next_table_name, last_node_name);
1159 const IFMapPerClientNodesShowReqIterate *request_iterate =
1160 static_cast<const IFMapPerClientNodesShowReqIterate *
>
1163 string next_table_name;
1164 string last_node_name;
1165 IFMapPerClientNodesShowReq *request =
new IFMapPerClientNodesShowReq;
1166 bool success = ConvertReqIterateToReq(request_iterate, request,
1167 &next_table_name, &last_node_name);
1169 BufferStageCommon(request, data, next_table_name, last_node_name);
1176 const IFMapPerClientNodesShowReq *request,
1178 IFMapPerClientNodesShowResp *response) {
1182 (prev_stage_data->at(0));
1184 vector<IFMapPerClientNodesShowInfo> dest_buffer;
1192 uint32_t page_limit = GetPageLimit(sctx);
1193 if (dest_buffer.size() == page_limit) {
1200 response->set_node_db(dest_buffer);
1201 response->set_next_batch(next_batch);
1206 int stage,
int instNum,
1208 const IFMapPerClientNodesShowReq *request =
1209 static_cast<const IFMapPerClientNodesShowReq *
>(ps.
snhRequest_.get());
1210 IFMapPerClientNodesShowResp *response =
new IFMapPerClientNodesShowResp;
1211 SendStageCommon(request, ps, response);
1213 response->set_context(request->context());
1214 response->set_more(
false);
1215 response->Response();
1222 const IFMapPerClientNodesShowReqIterate *request_iterate =
1223 static_cast<const IFMapPerClientNodesShowReqIterate *
>
1226 string next_table_name;
1227 string last_node_name;
1229 IFMapPerClientNodesShowResp *response =
new IFMapPerClientNodesShowResp;
1230 IFMapPerClientNodesShowReq *request =
new IFMapPerClientNodesShowReq;
1231 bool success = ConvertReqIterateToReq(request_iterate, request,
1232 &next_table_name, &last_node_name);
1234 SendStageCommon(request, ps, response);
1237 response->set_context(request->context());
1238 response->set_more(
false);
1239 response->Response();
1245 void IFMapPerClientNodesShowReq::HandleRequest()
const {
1263 ps.stages_ = list_of(s0)(s1)
1264 .convert_to_container\
1265 <vector<RequestPipeline::StageSpec> >();
1269 void IFMapPerClientNodesShowReqIterate::HandleRequest()
const {
1287 ps.stages_ = list_of(s0)(s1)
1288 .convert_to_container\
1289 <vector<RequestPipeline::StageSpec> >();
1295 static const uint32_t kMaxElementsPerRound = 50;
1301 static bool HandleRequest(
const Sandesh *sr,
1303 int stage,
int instNum,
1305 static bool HandleRequestIterate(
const Sandesh *sr,
1307 int stage,
int instNum,
1309 static bool ConvertReqIterateToReq(
1310 const IFMapPerClientLinksShowReqIterate *req_iterate,
1311 IFMapPerClientLinksShowReq *req,
string *last_node_name);
1312 static bool SkipLink(
IFMapLink *src,
const string &search_string);
1313 static bool CopyNode(IFMapPerClientLinksShowInfo *dest,
IFMapLink *src,
1315 static void BufferTable(
const IFMapPerClientLinksShowReq *request,
1316 const string &last_link_name,
1317 IFMapPerClientLinksShowResp *response);
1338 dest->interest_tracked =
"Yes";
1340 dest->interest_tracked =
"No";
1343 dest->interest_tracked =
"No tracker";
1349 dest->advertised_tracked =
"Yes";
1351 dest->advertised_tracked =
"No";
1354 dest->advertised_tracked =
"No tracker";
1363 const string &search_string) {
1364 if (search_string.empty()) {
1371 if ((src_link->
metadata().find(search_string) == string::npos) &&
1372 (!left || (left->
ToString().find(search_string) == string::npos)) &&
1373 (!right || (right->
ToString().find(search_string) == string::npos))) {
1385 const IFMapPerClientLinksShowReqIterate *req_iterate,
1386 IFMapPerClientLinksShowReq *req,
string *last_node_name) {
1389 req->set_context(req_iterate->context());
1391 string node_info = req_iterate->get_link_info();
1396 if (pos1 == string::npos) {
1399 string client_index_or_name = node_info.substr(0, pos1);
1403 if (pos2 == string::npos) {
1406 string search_string = node_info.substr((pos1 + sep_size),
1407 pos2 - (pos1 + sep_size));
1410 *last_node_name = node_info.substr(pos2 + sep_size);
1413 req->set_client_index_or_name(client_index_or_name);
1414 req->set_search_string(search_string);
1419 const IFMapPerClientLinksShowReq *request,
const string &last_link_name,
1420 IFMapPerClientLinksShowResp *response) {
1424 string client_index_or_name = request->get_client_index_or_name();
1425 if (client_index_or_name.empty()) {
1442 uint32_t page_limit = GetPageLimit(sctx);
1444 vector<IFMapPerClientLinksShowInfo> dest_buffer;
1445 dest_buffer.reserve(page_limit);
1449 if (last_link_name.length()) {
1454 for (; src != NULL; src = partition->
GetNext(src)) {
1456 if (SkipLink(src_link, request->get_search_string())) {
1459 IFMapPerClientLinksShowInfo dest;
1460 bool send = CopyNode(&dest, src_link, sctx->
ifmap_server(),
1463 dest_buffer.push_back(dest);
1464 if (dest_buffer.size() == page_limit) {
1465 string next_batch = request->get_client_index_or_name() +
1468 response->set_next_batch(next_batch);
1473 response->set_link_db(dest_buffer);
1475 IFMAP_WARN(IFMapTblNotFound,
"Cant show/find ",
"link table");
1482 const IFMapPerClientLinksShowReq *request =
1483 static_cast<const IFMapPerClientLinksShowReq *
>(ps.
snhRequest_.get());
1485 string last_link_name;
1486 IFMapPerClientLinksShowResp *response =
new IFMapPerClientLinksShowResp();
1487 BufferTable(request, last_link_name, response);
1489 response->set_context(request->context());
1490 response->set_more(
false);
1491 response->Response();
1500 const IFMapPerClientLinksShowReqIterate *request_iterate =
1501 static_cast<const IFMapPerClientLinksShowReqIterate *
>
1504 string last_link_name;
1505 IFMapPerClientLinksShowReq *request =
new IFMapPerClientLinksShowReq();
1506 IFMapPerClientLinksShowResp *response =
new IFMapPerClientLinksShowResp();
1507 bool success = ConvertReqIterateToReq(request_iterate, request,
1510 BufferTable(request, last_link_name, response);
1513 response->set_context(request->context());
1514 response->set_more(
false);
1515 response->Response();
1522 void IFMapPerClientLinksShowReq::HandleRequest()
const {
1531 ps.stages_ = list_of(s0)
1532 .convert_to_container\
1533 <vector<RequestPipeline::StageSpec> >();
1537 void IFMapPerClientLinksShowReqIterate::HandleRequest()
const {
1546 ps.stages_ = list_of(s0)
1547 .convert_to_container\
1548 <vector<RequestPipeline::StageSpec> >();
1554 static const int kMaxElementsPerRound = 50;
1560 static bool ProcessRequestCommon(
const IFMapUuidToNodeMappingReq *req,
1561 const string &last_uuid);
1563 static bool ProcessRequest(
1567 static bool ProcessRequestIterate(
1573 const IFMapUuidToNodeMappingReq *req,
const string &last_uuid) {
1576 uint32_t page_limit = GetPageLimit(sctx);
1580 vector<IFMapUuidToNodeMappingEntry> dest_buffer;
1581 IFMapUuidMapper::UuidNodeMap::const_iterator iter;
1582 if (last_uuid.size()) {
1587 for (uint32_t iter_count = 0; (iter_count != page_limit) &&
1588 (iter != uuid_mapper.
uuid_node_map_.end()); iter++, iter_count++) {
1589 IFMapUuidToNodeMappingEntry dest;
1590 dest.set_uuid(iter->first);
1592 dest.set_node_name(node->
ToString());
1593 dest_buffer.push_back(dest);
1596 IFMapUuidToNodeMappingResp *response =
new IFMapUuidToNodeMappingResp();
1597 response->set_map_count(dest_buffer.size());
1598 response->set_uuid_to_node_map(dest_buffer);
1600 response->set_next_batch(dest_buffer.back().get_uuid());
1602 response->set_context(req->context());
1603 response->set_more(
false);
1604 response->Response();
1611 const IFMapUuidToNodeMappingReqIterate *request_iterate =
1612 static_cast<const IFMapUuidToNodeMappingReqIterate *
>
1614 IFMapUuidToNodeMappingReq *request =
new IFMapUuidToNodeMappingReq;
1615 request->set_context(request_iterate->context());
1616 string last_uuid = request_iterate->get_uuid_info();
1617 ProcessRequestCommon(request, last_uuid);
1625 const IFMapUuidToNodeMappingReq *request =
1626 static_cast<const IFMapUuidToNodeMappingReq *
>(ps.
snhRequest_.get());
1628 ProcessRequestCommon(request, last_uuid);
1633 void IFMapUuidToNodeMappingReq::HandleRequest()
const {
1643 ps.stages_ = boost::assign::list_of(s0)
1644 .convert_to_container<vector<RequestPipeline::StageSpec> >();
1648 void IFMapUuidToNodeMappingReqIterate::HandleRequest()
const {
1658 ps.stages_ = boost::assign::list_of(s0)
1659 .convert_to_container<vector<RequestPipeline::StageSpec> >();
1665 static const int kMaxElementsPerRound = 50;
1671 static bool ProcessRequestCommon(
const IFMapNodeToUuidMappingReq *req,
1672 const string &last_uuid);
1674 static bool ProcessRequest(
1678 static bool ProcessRequestIterate(
1684 const IFMapNodeToUuidMappingReq *req,
const string &last_uuid) {
1687 uint32_t page_limit = GetPageLimit(sctx);
1691 vector<IFMapNodeToUuidMappingEntry> dest_buffer;
1692 IFMapVmUuidMapper::NodeUuidMap::const_iterator iter;
1693 if (last_uuid.size()) {
1700 for (uint32_t iter_count = 0; (iter_count != page_limit) &&
1702 IFMapNodeToUuidMappingEntry dest;
1703 node =
static_cast<IFMapNode *
>(iter->first);
1704 dest.set_node_name(node->
ToString());
1705 dest.set_uuid(iter->second);
1706 dest_buffer.push_back(dest);
1708 IFMapNodeToUuidMappingResp *response =
new IFMapNodeToUuidMappingResp();
1709 response->set_map_count(dest_buffer.size());
1710 response->set_node_to_uuid_map(dest_buffer);
1712 string next_batch = iter->second;
1713 response->set_next_batch(next_batch);
1715 response->set_context(req->context());
1716 response->set_more(
false);
1717 response->Response();
1724 const IFMapNodeToUuidMappingReqIterate *request_iterate =
1725 static_cast<const IFMapNodeToUuidMappingReqIterate
1727 IFMapNodeToUuidMappingReq *request =
new IFMapNodeToUuidMappingReq;
1728 request->set_context(request_iterate->context());
1729 string last_uuid = request_iterate->get_uuid_info();
1730 ProcessRequestCommon(request, last_uuid);
1738 const IFMapNodeToUuidMappingReq *request =
1739 static_cast<const IFMapNodeToUuidMappingReq *
>(ps.
snhRequest_.get());
1741 ProcessRequestCommon(request, last_uuid);
1745 void IFMapNodeToUuidMappingReq::HandleRequest()
const {
1755 ps.stages_ = boost::assign::list_of(s0)
1756 .convert_to_container<vector<RequestPipeline::StageSpec> >();
1760 void IFMapNodeToUuidMappingReqIterate::HandleRequest()
const {
1770 ps.stages_ = boost::assign::list_of(s0)
1771 .convert_to_container<vector<RequestPipeline::StageSpec> >();
1777 static const int kMaxElementsPerRound = 50;
1796 vector<IFMapPendingVmRegEntry>::const_iterator
first;
1803 static bool BufferStage(
const Sandesh *sr,
1807 int stage,
int instNum,
1813 int stage,
int instNum,
1815 const IFMapPendingVmRegReq *request =
1816 static_cast<const IFMapPendingVmRegReq *
>(ps.
snhRequest_.get());
1824 for (IFMapVmUuidMapper::PendingVmRegMap::const_iterator iter =
1827 IFMapPendingVmRegEntry dest;
1828 dest.set_vm_uuid(iter->first);
1829 dest.set_vr_name(iter->second);
1839 int stage,
int instNum,
1844 (prev_stage_data->at(0));
1848 vector<IFMapPendingVmRegEntry> dest_buffer;
1849 vector<IFMapPendingVmRegEntry>::const_iterator first, last;
1852 if (tracker_data->
init) {
1854 tracker_data->
init = 0;
1856 first = tracker_data->
first;
1858 int rem_num = show_data.
send_buffer.end() - first;
1859 const IFMapPendingVmRegReq *request =
1860 static_cast<const IFMapPendingVmRegReq *
>(ps.
snhRequest_.get());
1863 uint32_t page_limit = GetPageLimit(sctx);
1864 int send_num = (rem_num < (int)page_limit) ? rem_num : (int)page_limit;
1865 last = first + send_num;
1866 copy(first, last, back_inserter(dest_buffer));
1868 if ((rem_num - send_num) > 0) {
1873 IFMapPendingVmRegResp *response =
new IFMapPendingVmRegResp();
1874 response->set_map_count(dest_buffer.size());
1875 response->set_vm_reg_map(dest_buffer);
1876 response->set_context(request->context());
1877 response->set_more(more);
1878 response->Response();
1879 tracker_data->
first = first + send_num;
1885 void IFMapPendingVmRegReq::HandleRequest()
const {
1904 ps.stages_ = list_of(s0)(s1)
1905 .convert_to_container<vector<RequestPipeline::StageSpec> >();
1912 const IFMapServerClientShowReq *request =
1913 static_cast<const IFMapServerClientShowReq *
>(ps.
snhRequest_.get());
1917 IFMapServerClientShowResp *response =
new IFMapServerClientShowResp();
1918 string search_string = request->get_search_string();
1920 IFMapServerShowClientMap name_list;
1922 IFMapServerShowIndexMap index_list;
1924 IFMapServerClientHistoryList history_list;
1927 response->set_name_list(name_list);
1928 response->set_index_list(index_list);
1929 response->set_history_list(history_list);
1930 response->set_context(request->context());
1931 response->set_more(
false);
1932 response->Response();
1938 void IFMapServerClientShowReq::HandleRequest()
const {
1948 ps.stages_ = boost::assign::list_of(s0)
1949 .convert_to_container<vector<RequestPipeline::StageSpec> >();
1956 const IFMapNodeTableListShowReq *request =
1957 static_cast<const IFMapNodeTableListShowReq *
>(ps.
snhRequest_.get());
1961 vector<IFMapNodeTableListShowEntry> dest_buffer;
1965 IFMapNodeTableListShowResp *response =
new IFMapNodeTableListShowResp();
1966 response->set_table_list(dest_buffer);
1967 response->set_context(request->context());
1968 response->set_more(
false);
1969 response->Response();
1975 void IFMapNodeTableListShowReq::HandleRequest()
const {
1985 ps.stages_ = boost::assign::list_of(s0)
1986 .convert_to_container<vector<RequestPipeline::StageSpec> >();
1992 static const uint32_t kMaxElementsPerRound = 50;
2006 static bool BufferStageCommon(
const ConfigDBUUIDCacheReq *request,
2008 const string &last_uuid);
2009 static bool BufferStage(
const Sandesh *sr,
2012 static bool BufferStageIterate(
const Sandesh *sr,
2015 static void SendStageCommon(
const ConfigDBUUIDCacheReq *request,
2017 ConfigDBUUIDCacheResp *response);
2019 int stage,
int instNum,
2021 static bool SendStageIterate(
const Sandesh *sr,
2024 static bool SortList(
const ConfigDBUUIDCacheEntry &lhs,
2025 const ConfigDBUUIDCacheEntry &rhs);
2026 static bool ConvertReqIterateToReq(
2027 const ConfigDBUUIDCacheReqIterate *req_iterate,
2028 ConfigDBUUIDCacheReq *req,
string *last_uuid);
2032 const ConfigDBUUIDCacheEntry &lhs,
2033 const ConfigDBUUIDCacheEntry &rhs) {
2044 const ConfigDBUUIDCacheReqIterate *req_iterate,
2045 ConfigDBUUIDCacheReq *req,
string *last_uuid) {
2048 req->set_context(req_iterate->context());
2050 string uuid_info = req_iterate->get_uuid_info();
2055 if (pos1 == string::npos) {
2058 string search_string = uuid_info.substr(0, pos1);
2061 *last_uuid = uuid_info.substr((pos1 + sep_size));
2064 req->set_search_string(search_string);
2070 const ConfigDBUUIDCacheReq *req,
int instNum,
2076 uint32_t page_limit = GetPageLimit(sctx);
2080 last_uuid, page_limit,
2087 int stage,
int instNum,
2089 const ConfigDBUUIDCacheReq *request =
2090 static_cast<const ConfigDBUUIDCacheReq *
>(ps.
snhRequest_.get());
2092 return BufferStageCommon(request, instNum, data, last_uuid);
2098 const ConfigDBUUIDCacheReqIterate *request_iterate =
2099 static_cast<const ConfigDBUUIDCacheReqIterate *
>(ps.
snhRequest_.get());
2101 ConfigDBUUIDCacheReq *request =
new ConfigDBUUIDCacheReq;
2103 bool success = ConvertReqIterateToReq(request_iterate, request,
2106 BufferStageCommon(request, instNum, data, last_uuid);
2114 ConfigDBUUIDCacheResp *response) {
2117 vector<ConfigDBUUIDCacheEntry> uuid_cache_list;
2118 for (
size_t i = 0; i < prev_stage_data->size(); ++i) {
2122 size_t list_size = uuid_cache_list.size();
2123 uuid_cache_list.reserve(list_size + show_data.
send_buffer.size());
2126 std::back_inserter(uuid_cache_list));
2128 std::inplace_merge(uuid_cache_list.begin(),
2129 uuid_cache_list.begin() + list_size,
2130 uuid_cache_list.end(),
2141 uint32_t page_limit = GetPageLimit(sctx);
2142 if (uuid_cache_list.size() > page_limit) {
2143 vector<ConfigDBUUIDCacheEntry> ouput_list(uuid_cache_list.begin(),
2144 uuid_cache_list.begin()
2146 response->set_uuid_cache(ouput_list);
2148 + ouput_list.back().uuid;
2150 response->set_uuid_cache(uuid_cache_list);
2153 response->set_next_batch(next_batch);
2158 int stage,
int instNum,
2160 const ConfigDBUUIDCacheReq *request =
2161 static_cast<const ConfigDBUUIDCacheReq *
>(ps.
snhRequest_.get());
2162 ConfigDBUUIDCacheResp *response =
new ConfigDBUUIDCacheResp;
2163 SendStageCommon(request, ps, response);
2164 response->set_context(request->context());
2165 response->set_more(
false);
2166 response->Response();
2172 int stage,
int instNum,
2174 const ConfigDBUUIDCacheReqIterate *request_iterate =
2175 static_cast<const ConfigDBUUIDCacheReqIterate *
>(ps.
snhRequest_.get());
2177 ConfigDBUUIDCacheResp *response =
new ConfigDBUUIDCacheResp;
2178 ConfigDBUUIDCacheReq *request =
new ConfigDBUUIDCacheReq;
2180 bool success = ConvertReqIterateToReq(request_iterate, request,
2183 SendStageCommon(request, ps, response);
2186 response->set_context(request->context());
2187 response->set_more(
false);
2188 response->Response();
2194 void ConfigDBUUIDCacheReq::HandleRequest()
const {
2214 ps.stages_ = list_of(s0)(s1)
2215 .convert_to_container<vector<RequestPipeline::StageSpec> >();
2219 void ConfigDBUUIDCacheReqIterate::HandleRequest()
const {
2239 ps.stages_ = list_of(s0)(s1)
2240 .convert_to_container\
2241 <vector<RequestPipeline::StageSpec> >();
2247 static const int kMaxElementsPerRound = 50;
2253 static bool ProcessRequestCommon(
const ConfigDBUUIDToFQNameReq *req,
2254 const string &last_uuid);
2256 static bool ProcessRequest(
2260 static bool ProcessRequestIterate(
2264 static bool ConvertReqIterateToReq(
2265 const ConfigDBUUIDToFQNameReqIterate *req_iterate,
2266 ConfigDBUUIDToFQNameReq *req,
string *last_uuid);
2275 const ConfigDBUUIDToFQNameReqIterate *req_iterate,
2276 ConfigDBUUIDToFQNameReq *req,
string *last_uuid) {
2279 req->set_context(req_iterate->context());
2281 string uuid_info = req_iterate->get_uuid_info();
2286 if (pos1 == string::npos) {
2289 string search_string = uuid_info.substr(0, pos1);
2292 *last_uuid = uuid_info.substr((pos1 + sep_size));
2295 req->set_search_string(search_string);
2300 const ConfigDBUUIDToFQNameReq *req,
const string &last_uuid) {
2303 uint32_t page_limit = GetPageLimit(sctx);
2305 vector<ConfigDBFQNameCacheEntry> dest_buffer;
2307 req->get_search_string(), last_uuid, page_limit, &dest_buffer);
2309 ConfigDBUUIDToFQNameResp *response =
new ConfigDBUUIDToFQNameResp();
2311 next_batch = req->get_search_string()
2314 response->set_fqname_cache(dest_buffer);
2315 response->set_next_batch(next_batch);
2316 response->set_context(req->context());
2317 response->set_more(
false);
2318 response->Response();
2325 const ConfigDBUUIDToFQNameReqIterate *request_iterate =
2326 static_cast<const ConfigDBUUIDToFQNameReqIterate
2328 ConfigDBUUIDToFQNameReq *request =
new ConfigDBUUIDToFQNameReq;
2330 bool success = ConvertReqIterateToReq(request_iterate, request,
2333 ProcessRequestCommon(request, last_uuid);
2342 const ConfigDBUUIDToFQNameReq *request =
2343 static_cast<const ConfigDBUUIDToFQNameReq*
>(ps.
snhRequest_.get());
2345 ProcessRequestCommon(request, last_uuid);
2349 void ConfigDBUUIDToFQNameReq::HandleRequest()
const {
2359 ps.stages_ = boost::assign::list_of(s0)
2360 .convert_to_container\
2361 <vector<RequestPipeline::StageSpec> >();
2365 void ConfigDBUUIDToFQNameReqIterate::HandleRequest()
const {
2375 ps.stages_ = boost::assign::list_of(s0)
2376 .convert_to_container
2377 <vector<RequestPipeline::StageSpec> >();
static bool BufferStage(const Sandesh *sr, const RequestPipeline::PipeSpec ps, int stage, int instNum, RequestPipeline::InstData *data)
static void SendStageCommon(const ConfigDBUUIDCacheReq *request, const RequestPipeline::PipeSpec ps, ConfigDBUUIDCacheResp *response)
static int GetPageLimit(IFMapSandeshContext *sctx)
std::vector< int > instances_
const string kShowIterSeparator
static bool SendStage(const Sandesh *sr, const RequestPipeline::PipeSpec ps, int stage, int instNum, RequestPipeline::InstData *data)
static bool SendStageIterate(const Sandesh *sr, const RequestPipeline::PipeSpec ps, int stage, int instNum, RequestPipeline::InstData *data)
static bool ProcessRequestIterate(const Sandesh *sr, const RequestPipeline::PipeSpec ps, int stage, int instNum, RequestPipeline::InstData *data)
static bool BufferStage(const Sandesh *sr, const RequestPipeline::PipeSpec ps, int stage, int instNum, RequestPipeline::InstData *data)
UuidNodeMap uuid_node_map_
IFMapServer * ifmap_server()
ConfigClientManager * get_config_manager()
static void BufferTable(const IFMapPerClientLinksShowReq *request, const string &last_link_name, IFMapPerClientLinksShowResp *response)
virtual DBEntryBase * GetFirst()=0
The TaskScheduler keeps track of what tasks are currently schedulable. When a task is enqueued it is ...
const std::string & metadata() const
vector< IFMapPerClientNodesShowInfo > send_buffer
vector< IFMapLinkShowInfo > send_buffer
bool test(size_t pos) const
boost::ptr_vector< InstData > StageData
static bool ConvertReqIterateToReq(const ConfigDBUUIDCacheReqIterate *req_iterate, ConfigDBUUIDCacheReq *req, string *last_uuid)
static int GetPageLimit(IFMapSandeshContext *sctx)
NodeUuidMap node_uuid_map_
static bool HandleRequestIterate(const Sandesh *sr, const RequestPipeline::PipeSpec ps, int stage, int instNum, RequestPipeline::InstData *data)
virtual std::string ToString() const
static bool ConvertReqIterateToReq(const IFMapPerClientNodesShowReqIterate *req_iterate, IFMapPerClientNodesShowReq *req, string *next_table_name, string *last_node_name)
static bool BufferStage(const Sandesh *sr, const RequestPipeline::PipeSpec ps, int stage, int instNum, RequestPipeline::InstData *data)
static bool BufferStage(const Sandesh *sr, const RequestPipeline::PipeSpec ps, int stage, int instNum, RequestPipeline::InstData *data)
static bool SendStage(const Sandesh *sr, const RequestPipeline::PipeSpec ps, int stage, int instNum, RequestPipeline::InstData *data)
const BitSet & interest() const
static bool ProcessRequest(const Sandesh *sr, const RequestPipeline::PipeSpec ps, int stage, int instNum, RequestPipeline::InstData *data)
static bool IncludeLink(DBEntryBase *src, const string &search_string, const regex &search_expr, const string &metadata, const regex &metadata_expr)
ConfigDbClient * config_db_client() const
static bool ConvertReqIterateToReq(const IFMapTableShowReqIterate *req_iterate, IFMapTableShowReq *req, string *next_table_name, string *last_node_name)
bool stringToInteger(const std::string &str, NumberType &num)
IFMapOrigin origin() const
static void SendStageCommon(const IFMapLinkTableShowReq *request, const RequestPipeline::PipeSpec ps, IFMapLinkTableShowResp *response)
iterator FindTableIter(const std::string &name)
static bool TableToBuffer(const IFMapPerClientNodesShowReq *request, IFMapTable *table, IFMapServer *server, const string &last_node_name, int client_index, ShowData *show_data)
static bool SendStageIterate(const Sandesh *sr, const RequestPipeline::PipeSpec ps, int stage, int instNum, RequestPipeline::InstData *data)
IFMapNode * GetVmNodeByUuid(const std::string &vm_uuid)
void FillClientHistory(IFMapServerClientHistoryList *out_list, const std::string &search_string)
static RequestPipeline::InstData * AllocTracker(int stage)
static RequestPipeline::InstData * AllocBuffer(int stage)
const std::string last_change_at_str() const
IFMapExporter * exporter()
virtual DBEntryBase * GetNext(const DBEntryBase *)=0
bool ClientNameToIndex(const std::string &id, int *index)
static bool ConvertReqIterateToReq(const IFMapLinkTableShowReqIterate *req_iterate, IFMapLinkTableShowReq *req, string *last_link_name)
static bool SendStage(const Sandesh *sr, const RequestPipeline::PipeSpec ps, int stage, int instNum, RequestPipeline::InstData *data)
adjacency_iterator end(DBGraph *graph)
static bool BufferAllTables(const IFMapTableShowReq *req, RequestPipeline::InstData *data, const string &next_table_name, const string &last_node_name)
static bool IFMapNodeTableListShowReqHandleRequest(const Sandesh *sr, const RequestPipeline::PipeSpec ps, int stage, int instNum, RequestPipeline::InstData *data)
static bool BufferStageIterate(const Sandesh *sr, const RequestPipeline::PipeSpec ps, int stage, int instNum, RequestPipeline::InstData *data)
static bool CopyNode(IFMapPerClientLinksShowInfo *dest, IFMapLink *src, IFMapServer *server, int client_index)
static int GetNumConfigReader()
static bool CopyNode(IFMapPerClientNodesShowInfo *dest, IFMapNode *src, IFMapServer *server, int client_index)
int GetTaskId(const std::string &name)
static bool BufferStageCommon(const IFMapPerClientNodesShowReq *request, RequestPipeline::InstData *data, const string &next_table_name, const string &last_node_name)
PendingVmRegMap::size_type PendingVmRegCount()
virtual bool UUIDToFQNameShow(const std::string &search_string, const std::string &last_uuid, uint32_t num_entries, std::vector< ConfigDBFQNameCacheEntry > *entries) const
static RequestPipeline::InstData * AllocBuffer(int stage)
bool ClientHasConfigTracker(TrackerType tracker_type, int index)
static bool regex_match(const std::string &input, const regex ®ex)
static RequestPipeline::InstData * AllocBuffer(int stage)
virtual size_t Size() const
string GetIFMapObjectData(const IFMapObject *src_obj)
static RequestPipeline::InstData * AllocBuffer(int stage)
static int GetPageLimit(IFMapSandeshContext *sctx)
PendingVmRegMap pending_vmreg_map_
uint64_t sequence_number()
bool ClientConfigTrackerHasState(TrackerType tracker_type, int index, IFMapState *state)
static bool ProcessRequestCommon(const IFMapUuidToNodeMappingReq *req, const string &last_uuid)
const BitSet & advertised() const
IFMapNodeState * NodeStateLookup(IFMapNode *node)
#define BOOL_KEY_COMPARE(x, y)
static TaskScheduler * GetInstance()
vector< ConfigDBUUIDCacheEntry > send_buffer
IFMapNode * FindNode(const std::string &name)
vector< IFMapNodeShowInfo > send_buffer
TableMap::iterator iterator
static bool ProcessRequestIterate(const Sandesh *sr, const RequestPipeline::PipeSpec ps, int stage, int instNum, RequestPipeline::InstData *data)
static void FillNodeTableList(DB *db, std::vector< IFMapNodeTableListShowEntry > *table_list)
static void SendStageCommon(const IFMapPerClientNodesShowReq *request, const RequestPipeline::PipeSpec ps, IFMapPerClientNodesShowResp *response)
IFMapNode * FindNextNode(const std::string &name)
static bool SkipLink(IFMapLink *src, const string &search_string)
static int GetPageLimit(IFMapSandeshContext *sctx)
static bool BufferStage(const Sandesh *sr, const RequestPipeline::PipeSpec ps, int stage, int instNum, RequestPipeline::InstData *data)
const std::string & name() const
static int GetPageLimit(IFMapSandeshContext *sctx)
static bool regex_search(const std::string &input, const regex ®ex)
const std::string & name() const
iterator lower_bound(const std::string &name)
static bool SendStageIterate(const Sandesh *sr, const RequestPipeline::PipeSpec ps, int stage, int instNum, RequestPipeline::InstData *data)
static bool IFMapServerClientShowReqHandleRequest(const Sandesh *sr, const RequestPipeline::PipeSpec ps, int stage, int instNum, RequestPipeline::InstData *data)
vector< IFMapPendingVmRegEntry > send_buffer
virtual DBTablePartBase * GetTablePartition(const DBRequestKey *key)
std::vector< LinkOriginInfo > origin_info_
static bool ProcessRequestCommon(const IFMapNodeToUuidMappingReq *req, const string &last_uuid)
uint32_t page_limit() const
static bool BufferStageIterate(const Sandesh *sr, const RequestPipeline::PipeSpec ps, int stage, int instNum, RequestPipeline::InstData *data)
#define IFMAP_WARN(obj,...)
static bool ConvertReqIterateToReq(const IFMapPerClientLinksShowReqIterate *req_iterate, IFMapPerClientLinksShowReq *req, string *last_node_name)
static bool BufferStageCommon(const ConfigDBUUIDCacheReq *request, int instNum, RequestPipeline::InstData *data, const string &last_uuid)
static IFMapTable * FindTable(DB *db, const std::string &element_type)
static int GetPageLimit(IFMapSandeshContext *sctx)
static bool ProcessRequest(const Sandesh *sr, const RequestPipeline::PipeSpec ps, int stage, int instNum, RequestPipeline::InstData *data)
static bool BufferStageCommon(const IFMapTableShowReq *request, RequestPipeline::InstData *data, const string &next_table_name, const string &last_node_name)
static bool IFMapNodeShowReqHandleRequest(const Sandesh *sr, const RequestPipeline::PipeSpec ps, int stage, int instNum, RequestPipeline::InstData *data)
IFMapNodeCopier(IFMapNodeShowInfo *dest, DBEntryBase *src, IFMapServer *server)
static bool SendStageIterate(const Sandesh *sr, const RequestPipeline::PipeSpec ps, int stage, int instNum, RequestPipeline::InstData *data)
static RequestPipeline::InstData * AllocBuffer(int stage)
static bool BufferStageIterate(const Sandesh *sr, const RequestPipeline::PipeSpec ps, int stage, int instNum, RequestPipeline::InstData *data)
boost::shared_ptr< const SandeshRequest > snhRequest_
void FillIndexMap(IFMapServerShowIndexMap *out_map, const std::string &search_string)
IFMapLinkState * LinkStateLookup(IFMapLink *link)
static void CopyNode(IFMapLinkShowInfo *dest, DBEntryBase *src, IFMapServer *server)
const std::string & link_name() const
static bool HandleRequest(const Sandesh *sr, const RequestPipeline::PipeSpec ps, int stage, int instNum, RequestPipeline::InstData *data)
IFMapVmUuidMapper * vm_uuid_mapper()
vector< IFMapPendingVmRegEntry >::const_iterator first
void FillClientMap(IFMapServerShowClientMap *out_map, const std::string &search_string)
static bool TableToBuffer(const IFMapTableShowReq *request, IFMapTable *table, IFMapServer *server, const string &last_node_name, ShowData *show_data, uint32_t page_limit)
static int GetPageLimit(IFMapSandeshContext *sctx)
IFMapUuidMapper uuid_mapper_
static bool BufferOneTable(const IFMapTableShowReq *request, RequestPipeline::InstData *data, const string &last_node_name)
std::string ToNumberedString() const
static int GetPageLimit(IFMapSandeshContext *sctx)
static bool BufferStageIterate(const Sandesh *sr, const RequestPipeline::PipeSpec ps, int stage, int instNum, RequestPipeline::InstData *data)
std::string ToString() const
const StageData * GetStageData(int stage) const
virtual bool UUIDToObjCacheShow(const std::string &search_string, int inst_num, const std::string &last_uuid, uint32_t num_entries, std::vector< ConfigDBUUIDCacheEntry > *entries) const =0
static bool SortList(const ConfigDBUUIDCacheEntry &lhs, const ConfigDBUUIDCacheEntry &rhs)
static bool ProcessRequestCommon(const ConfigDBUUIDToFQNameReq *req, const string &last_uuid)
IFMapLink * FindNextLink(const std::string &name)
adjacency_iterator begin(DBGraph *graph)
static bool BufferStageCommon(const IFMapLinkTableShowReq *request, RequestPipeline::InstData *data, const string &last_link_name)
virtual void EncodeUpdate(pugi::xml_node *parent) const =0
static bool ProcessRequest(const Sandesh *sr, const RequestPipeline::PipeSpec ps, int stage, int instNum, RequestPipeline::InstData *data)
static bool ProcessRequestIterate(const Sandesh *sr, const RequestPipeline::PipeSpec ps, int stage, int instNum, RequestPipeline::InstData *data)
static bool SendStage(const Sandesh *sr, const RequestPipeline::PipeSpec ps, int stage, int instNum, RequestPipeline::InstData *data)
static int GetPageLimit(IFMapSandeshContext *sctx)
static void SendStageCommon(const IFMapTableShowReq *request, const RequestPipeline::PipeSpec ps, IFMapTableShowResp *response)
static bool SendStage(const Sandesh *sr, const RequestPipeline::PipeSpec ps, int stage, int instNum, RequestPipeline::InstData *data)
DBTableBase * FindTable(const std::string &name)
static bool ConvertReqIterateToReq(const ConfigDBUUIDToFQNameReqIterate *req_iterate, ConfigDBUUIDToFQNameReq *req, string *last_uuid)