| 4988 | } |
| 4989 | |
| 4990 | void TabletImpl::ExtractIndexDataInternal( |
| 4991 | std::shared_ptr<::fedb::storage::Table> table, |
| 4992 | std::shared_ptr<::fedb::storage::MemTableSnapshot> memtable_snapshot, |
| 4993 | ::fedb::common::ColumnKey& column_key, uint32_t idx, |
| 4994 | uint32_t partition_num, std::shared_ptr<::fedb::api::TaskInfo> task) { |
| 4995 | uint64_t offset = 0; |
| 4996 | uint32_t tid = table->GetId(); |
| 4997 | uint32_t pid = table->GetPid(); |
| 4998 | if (memtable_snapshot->ExtractIndexData(table, column_key, idx, |
| 4999 | partition_num, offset) < 0) { |
| 5000 | PDLOG(WARNING, "fail to extract index. tid %u pid %u", tid, pid); |
| 5001 | SetTaskStatus(task, ::fedb::api::TaskStatus::kFailed); |
| 5002 | return; |
| 5003 | } |
| 5004 | PDLOG(INFO, "extract index success. tid %u pid %u", tid, pid); |
| 5005 | std::shared_ptr<LogReplicator> replicator = GetReplicator(tid, pid); |
| 5006 | if (replicator) { |
| 5007 | replicator->SetSnapshotLogPartIndex(offset); |
| 5008 | } |
| 5009 | SetTaskStatus(task, ::fedb::api::TaskStatus::kDone); |
| 5010 | } |
| 5011 | |
| 5012 | void TabletImpl::AddIndex(RpcController* controller, |
| 5013 | const ::fedb::api::AddIndexRequest* request, |
nothing calls this directly
no test coverage detected