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

Method ClearInvalidSubIDs

phxqueue/consumer/hblock.cpp:181–193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

179}
180
181void HeartBeatLock::ClearInvalidSubIDs(const set<int> &valid_sub_ids) {
182 comm::utils::RWLock l(impl_->rwlock, comm::utils::RWLock::LockMode::WRITE);
183
184 for (int vpid{0}; vpid < impl_->nproc; ++vpid) {
185 Queue_t *queue{&impl_->buf->queues[vpid]};
186 if (LOCK_ITEM_MAGIC == queue->magic) {
187 if (valid_sub_ids.end() == valid_sub_ids.find(queue->sub_id)) {
188 QLInfo("QUEUEINFO: vpid %d clear sub %u store %u queue %u", vpid, queue->sub_id, queue->store_id, queue->queue_id);
189 memset(queue, 0, sizeof(Queue_t));
190 }
191 }
192 }
193}
194
195void HeartBeatLock::DistubePendingQueues(const map<int, vector<Queue_t>> &sub_id2pending_queues) {
196 //if (impl_->ossid) OssAttrInc(impl_->ossid, 20, 1);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected