MCPcopy Create free account
hub / github.com/apache/brpc / getManifestToCollectionId

Method getManifestToCollectionId

src/brpc/couchbase.cpp:87–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87bool 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
109bool CouchbaseManifestManager::jsonToCollectionManifest(
110 const std::string& json,

Callers 1

Calls 2

findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected