| 987 | |
| 988 | |
| 989 | void |
| 990 | CallDeleteOne(MongoCollection *collection, DeleteOneParams *deleteOneParams, |
| 991 | int64 shardKeyHash, text *transactionId, bool forceInlineWrites, |
| 992 | DeleteOneResult *result) |
| 993 | { |
| 994 | /* In single node scenarios (like DocumentDB where we can inline the write, call the internal) |
| 995 | * delete functions directly. |
| 996 | * Alternatively in a distributed scenario, if the shard is colocated on the current node anyway, |
| 997 | * then we don't need to go remote - we can simply call the delete internal functions directly. |
| 998 | */ |
| 999 | if (DefaultInlineWriteOperations || collection->shardTableName[0] != '\0' || |
| 1000 | forceInlineWrites) |
| 1001 | { |
| 1002 | DeleteOneInternalCore(collection, shardKeyHash, deleteOneParams, |
| 1003 | transactionId, result); |
| 1004 | } |
| 1005 | else |
| 1006 | { |
| 1007 | /* |
| 1008 | * If the cluster supports it, and we need to go remote, call the update worker |
| 1009 | * function with the appropriate spec args. |
| 1010 | */ |
| 1011 | pgbsonsequence *docSequence = NULL; |
| 1012 | pgbson *workerResult = CallDeleteWorker(collection, |
| 1013 | SerializeDeleteOneParams(deleteOneParams), |
| 1014 | shardKeyHash, transactionId, docSequence); |
| 1015 | DeserializeWorkerDeleteResultForDeleteOne(workerResult, result); |
| 1016 | } |
| 1017 | } |
| 1018 | |
| 1019 | |
| 1020 | static pgbson * |
no test coverage detected