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

Method CommitTasksById

src/sdk/table_impl.cc:1367–1397  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1365}
1366
1367void TableImpl::CommitTasksById(const std::string& server_addr, std::vector<int64_t>& task_id_list,
1368 SdkTask::TYPE task_type) {
1369 std::vector<RowMutationImpl*> mutation_list;
1370 std::vector<RowReaderImpl*> reader_list;
1371 std::vector<BatchMutationImpl*> batch_mutation_list;
1372
1373 for (size_t i = 0; i < task_id_list.size(); i++) {
1374 int64_t task_id = task_id_list[i];
1375 SdkTask* task = task_pool_.GetTask(task_id);
1376 if (task == NULL) {
1377 VLOG(10) << "commit task, type " << task_type << ", id " << task_id << " timeout";
1378 continue;
1379 }
1380 perf_counter_.total_commit_cnt.Inc();
1381 CHECK_EQ(task->Type(), task_type);
1382 if (task_type == SdkTask::MUTATION) {
1383 mutation_list.push_back((RowMutationImpl*)task);
1384 } else if (task_type == SdkTask::READ) {
1385 reader_list.push_back((RowReaderImpl*)task);
1386 } else if (task_type == SdkTask::BATCH_MUTATION) {
1387 batch_mutation_list.push_back((BatchMutationImpl*)task);
1388 }
1389 }
1390 if (task_type == SdkTask::MUTATION) {
1391 CommitMutations(server_addr, mutation_list);
1392 } else if (task_type == SdkTask::READ) {
1393 CommitReaders(server_addr, reader_list);
1394 } else if (task_type == SdkTask::BATCH_MUTATION) {
1395 CommitBatchMutations(server_addr, batch_mutation_list);
1396 }
1397}
1398
1399bool TableImpl::GetTabletMetaForKey(const std::string& key, TabletMeta* meta) {
1400 MutexLock lock(&meta_mutex_);

Callers

nothing calls this directly

Calls 5

GetTaskMethod · 0.80
IncMethod · 0.80
push_backMethod · 0.80
sizeMethod · 0.45
TypeMethod · 0.45

Tested by

no test coverage detected