| 85 | } |
| 86 | |
| 87 | bool brpc::CouchbaseManifestManager::getManifestToCollectionId( |
| 88 | CouchbaseManifestManager::CollectionManifest* manifest, std::string scope, |
| 89 | std::string collection, uint8_t* collection_id) { |
| 90 | if (manifest == nullptr || collection_id == nullptr) { |
| 91 | DEBUG_PRINT("Invalid input: manifest or collection_id is null"); |
| 92 | return false; |
| 93 | } |
| 94 | auto it1 = manifest->scope_to_collection_id_map.find(scope); |
| 95 | if (it1 == manifest->scope_to_collection_id_map.end()) { |
| 96 | DEBUG_PRINT("Scope: " << scope << " not found in manifest"); |
| 97 | return false; |
| 98 | } |
| 99 | auto it2 = it1->second.find(collection); |
| 100 | if (it2 == it1->second.end()) { |
| 101 | DEBUG_PRINT("Collection: " << collection |
| 102 | << " not found in scope: " << scope); |
| 103 | return false; |
| 104 | } |
| 105 | *collection_id = it2->second; |
| 106 | return true; |
| 107 | } |
| 108 | |
| 109 | bool CouchbaseManifestManager::jsonToCollectionManifest( |
| 110 | const std::string& json, |
no test coverage detected