MCPcopy Create free account
hub / github.com/Tencent/phxqueue / GetBackLogByCursorID

Method GetBackLogByCursorID

phxqueue/store/syncctrl.cpp:311–324  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

309}
310
311comm::RetCode SyncCtrl::GetBackLogByCursorID(const int queue_id,
312 const uint64_t cursor_id, int &backlog) {
313 backlog = 0;
314
315 auto meta_queue(impl_->store->GetBaseMgr()->GetMetaQueue(queue_id));
316 if (!meta_queue) {
317 QLErr("GetMetaQueue fail. queue_id %d", queue_id);
318 return comm::RetCode::RET_ERR_RANGE_QUEUE;
319 }
320 if (-1 == cursor_id) backlog = meta_queue->Size();
321 else backlog = meta_queue->SizeGT(StoreMeta(cursor_id));
322
323 return comm::RetCode::RET_OK;
324}
325
326
327comm::RetCode SyncCtrl::SyncCursorID(const proto::SyncCtrlInfo &sync_ctrl_info) {

Callers 1

ReportBacklogMethod · 0.80

Calls 5

StoreMetaClass · 0.85
GetMetaQueueMethod · 0.80
GetBaseMgrMethod · 0.80
SizeMethod · 0.80
SizeGTMethod · 0.80

Tested by

no test coverage detected