MCPcopy Create free account
hub / github.com/Qihoo360/evpp / OnMultiGetCommandOneResponse

Method OnMultiGetCommandOneResponse

apps/evmc/command.cc:116–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114}
115
116void MultiGetCommand::OnMultiGetCommandOneResponse(int resp_code, std::string& key, std::string& value) {
117 if (resp_code == PROTOCOL_BINARY_RESPONSE_SUCCESS || resp_code == PROTOCOL_BINARY_RESPONSE_KEY_ENOENT) {
118 auto& result_map = get_handler()->get_result();
119 auto it = result_map.find(key);
120 assert(it != result_map.end());
121 auto& get_result = it->second;
122 get_result.code = resp_code;
123 get_result.value.swap(value);
124 } else { //返回值不带key,将serverid对应的key都设置为resp_code
125 auto& keys = get_handler()->FindKeysByid(vbucket_id());
126 auto& result_map = get_handler()->get_result();
127 auto k = result_map.begin();
128 for (auto& it : keys) {
129 k = result_map.find(it);
130 assert(k != result_map.end());
131 k->second.code = resp_code;
132 }
133 }
134}
135
136void MultiGetCommand::PacketRequest(const std::vector<std::string>& keys,
137 const std::vector<uint16_t>& vbuckets, const uint32_t id, std::string& buf) {

Callers 1

OnResponsePacketMethod · 0.45

Calls 2

endMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected