| 213 | } |
| 214 | |
| 215 | static void hs_find2(const char* addr, int num, bool enable_cache) |
| 216 | { |
| 217 | const char* dbn = "test", *tbl = "user", *idx = "PRIMARY"; |
| 218 | const char* flds = "user_id,user_name,user_email"; |
| 219 | char buf[256]; |
| 220 | acl::hsclient client(addr, enable_cache); |
| 221 | |
| 222 | if (client.open_tbl(dbn, tbl, idx, flds) == false) |
| 223 | { |
| 224 | printf("open %s error: %s\n", addr, client.get_last_serror()); |
| 225 | return; |
| 226 | } |
| 227 | |
| 228 | for (int i = 0; i < num; i++) |
| 229 | { |
| 230 | snprintf(buf, sizeof(buf), "%d", i); |
| 231 | |
| 232 | const std::vector<acl::hsrow*>& rows = |
| 233 | client.get(buf, NULL); |
| 234 | if (rows.empty()) |
| 235 | { |
| 236 | printf("find(%s) error\n", buf); |
| 237 | break; |
| 238 | } |
| 239 | |
| 240 | |
| 241 | if (i % 10000 == 0) |
| 242 | { |
| 243 | snprintf(buf, sizeof(buf), "find, num: %d\n", i); |
| 244 | ACL_METER_TIME(buf); |
| 245 | } |
| 246 | if (i > 1000) |
| 247 | continue; |
| 248 | |
| 249 | hs_dump(rows); |
| 250 | } |
| 251 | } |
| 252 | |
| 253 | static void hs_update(const char* addr, int num, bool enable_cache) |
| 254 | { |
nothing calls this directly
no test coverage detected
searching dependent graphs…