| 27 | |
| 28 | |
| 29 | void TestGetLockInfo(lock::Lock &lock, const int topic_id, const int lock_id, |
| 30 | const string &lock_key, uint64_t &version) { |
| 31 | NLVerb("begin"); |
| 32 | |
| 33 | comm::proto::GetLockInfoRequest req; |
| 34 | comm::proto::GetLockInfoResponse resp; |
| 35 | |
| 36 | req.set_topic_id(topic_id); |
| 37 | req.set_lock_id(lock_id); |
| 38 | req.set_lock_key(lock_key); |
| 39 | |
| 40 | comm::RetCode ret{lock.GetLockInfo(req, resp)}; |
| 41 | if (comm::RetCode::RET_OK != ret) { |
| 42 | NLErr("lock GetLockInfo ret %d", as_integer(ret)); |
| 43 | |
| 44 | return; |
| 45 | } |
| 46 | |
| 47 | NLVerb("lock_key %s version %" PRIu64 " client_id %s lease_time_ms %" PRIu64, |
| 48 | resp.lock_info().lock_key().c_str(), resp.lock_info().version(), |
| 49 | resp.lock_info().client_id().c_str(), resp.lock_info().lease_time_ms()); |
| 50 | |
| 51 | version = resp.lock_info().version(); |
| 52 | } |
| 53 | |
| 54 | void TestAcquireLock(lock::Lock &lock, const int topic_id, const int lock_id, |
| 55 | const string &lock_key, const uint64_t version) { |
no test coverage detected