MCPcopy Create free account
hub / github.com/alibaba/proxima / evaluate

Method evaluate

src/query/equal_query.cc:86–105  ·  view source on GitHub ↗

Evaluate query, and collection feedback

Source from the content-addressed store, hash-verified

84
85//! Evaluate query, and collection feedback
86int EqualQuery::evaluate() {
87 TaskPtrList tasks(tasks_.begin(), tasks_.end());
88 int code = executor()->execute_tasks(tasks);
89 if (code == 0) {
90 // one result or nothing
91 for (auto &task : tasks_) {
92 if (task->hit()) { // Pick first hit document, drop others
93 proto::Document *doc = response_->mutable_document();
94 doc->set_primary_key(primary_key());
95 code = fill_forward(task->forward(), doc);
96 if (code != 0) {
97 LOG_WARN("Fill forward failed. code[%d] what[%s]", code,
98 ErrorCode::What(code));
99 }
100 break;
101 }
102 }
103 }
104 return code;
105}
106
107int EqualQuery::finalize() {
108 return 0;

Callers

nothing calls this directly

Calls 5

execute_tasksMethod · 0.80
hitMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
set_primary_keyMethod · 0.45

Tested by

no test coverage detected