MCPcopy Create free account
hub / github.com/baidu/tera / GetTask

Method GetTask

src/sdk/sdk_task.cc:123–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121}
122
123SdkTask* SdkTimeoutManager::GetTask(int64_t task_id) {
124 uint32_t shard_id = Shard(task_id);
125 TaskMap& map = map_shard_[shard_id];
126 Mutex& mutex = mutex_shard_[shard_id];
127
128 MutexLock l(&mutex);
129 IdHashMap::iterator it = map.id_hash_map.find(task_id);
130 if (it != map.id_hash_map.end()) {
131 SdkTask* task = it->second;
132 CHECK_EQ(task->GetId(), task_id);
133 task->IncRef();
134 return task;
135 } else {
136 return NULL;
137 }
138}
139
140SdkTask* SdkTimeoutManager::PopTask(int64_t task_id) {
141 uint32_t shard_id = Shard(task_id);

Callers 8

CollectFailedTasksMethod · 0.80
BatchMutateCallBackMethod · 0.80
MutateCallBackMethod · 0.80
DistributeTasksByIdMethod · 0.80
ReaderCallBackMethod · 0.80
CommitTasksByIdMethod · 0.80
WakeUpPendingRequestMethod · 0.80

Calls 2

IncRefMethod · 0.80
GetIdMethod · 0.45

Tested by

no test coverage detected