MCPcopy Create free account
hub / github.com/4paradigm/OpenMLDB / ExtractIndexDataInternal

Method ExtractIndexDataInternal

src/tablet/tablet_impl.cc:4990–5010  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4988}
4989
4990void 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
5012void TabletImpl::AddIndex(RpcController* controller,
5013 const ::fedb::api::AddIndexRequest* request,

Callers

nothing calls this directly

Calls 4

GetIdMethod · 0.45
GetPidMethod · 0.45
ExtractIndexDataMethod · 0.45

Tested by

no test coverage detected