MCPcopy Create free account
hub / github.com/documentdb/documentdb / BuildResultData

Function BuildResultData

pg_documentdb/src/commands/coll_stats.c:367–382  ·  view source on GitHub ↗

* Helper method on the coordinator that populates the * CollStatsResult with the merged worker statistics (along with any * additional statistics that may be needed from the coordinator). */

Source from the content-addressed store, hash-verified

365 * additional statistics that may be needed from the coordinator).
366 */
367static void
368BuildResultData(Datum databaseName, Datum collectionName, CollStatsResult *result,
369 MongoCollection *collection, int32 scale, CollStatsAggMode mode)
370{
371 List *workerBsons;
372 int numValues = 3;
373 Datum values[3] = { databaseName, collectionName, Float8GetDatum((float8) mode) };
374 Oid types[3] = { TEXTOID, TEXTOID, FLOAT8OID };
375 workerBsons = RunQueryOnAllServerNodes("CollStats", values, types, numValues,
376 command_coll_stats_worker,
377 ApiToApiInternalSchemaName,
378 "coll_stats_worker");
379
380 /* Now that we have the worker BSON results, merge them to the final one */
381 MergeWorkerResults(result, collection, workerBsons, scale, mode);
382}
383
384
385/*

Callers 2

CollStatsCoordinatorFunction · 0.70

Calls 2

RunQueryOnAllServerNodesFunction · 0.85
MergeWorkerResultsFunction · 0.70

Tested by

no test coverage detected