* 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). */
| 365 | * additional statistics that may be needed from the coordinator). |
| 366 | */ |
| 367 | static void |
| 368 | BuildResultData(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 | /* |
no test coverage detected