MCPcopy Create free account
hub / github.com/PaddlePaddle/Serving / Hash

Method Hash

core/predictor/framework/request_cache.cpp:46–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46int RequestCache::Hash(const Request& req, uint64_t* key) {
47 uint64_t log_id = req.log_id();
48 bool profile_server = req.profile_server();
49 Request* r = const_cast<Request*>(&req);
50 r->clear_log_id();
51 r->clear_profile_server();
52 std::string buf = req.SerializeAsString();
53 *key = std::hash<std::string>{}(buf);
54 r->set_log_id(log_id);
55 r->set_profile_server(profile_server);
56 return 0;
57}
58
59int RequestCache::Get(const Request& req, Response* res, uint64_t* key) {
60 if (!Enabled()) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected