提交 a1f7b766 编写于 作者: W wxyu

MS-445 Rename CopyCompleted to LoadCompleted


Former-commit-id: 99d0df4b53e6daa19d91db1e058eaa99c77d980a
上级 d2d20b51
......@@ -68,6 +68,7 @@ Please mark all change in change log and use the ticket from JIRA.
- MS-428 - Add PushTaskByDataLocality in scheduler
- MS-440 - Add DumpTaskTables in sdk
- MS-442 - Merge Knowhere
- MS-445 - Rename CopyCompleted to LoadCompleted
## New Feature
- MS-343 - Implement ResourceMgr
......
......@@ -76,8 +76,8 @@ Scheduler::Process(const EventPtr &event) {
OnStartUp(event);
break;
}
case EventType::COPY_COMPLETED: {
OnCopyCompleted(event);
case EventType::LOAD_COMPLETED: {
OnLoadCompleted(event);
break;
}
case EventType::FINISH_TASK: {
......@@ -108,8 +108,8 @@ Scheduler::OnFinishTask(const EventPtr &event) {
}
void
Scheduler::OnCopyCompleted(const EventPtr &event) {
auto load_completed_event = std::static_pointer_cast<CopyCompletedEvent>(event);
Scheduler::OnLoadCompleted(const EventPtr &event) {
auto load_completed_event = std::static_pointer_cast<LoadCompletedEvent>(event);
if (auto resource = event->resource_.lock()) {
resource->WakeupExecutor();
......
......@@ -82,7 +82,7 @@ private:
* Pull task from neighbours;
*/
void
OnCopyCompleted(const EventPtr &event);
OnLoadCompleted(const EventPtr &event);
/*
* Process task table updated events, which happened on task_table->put;
......
......@@ -13,7 +13,7 @@ namespace engine {
enum class EventType {
START_UP,
COPY_COMPLETED,
LOAD_COMPLETED,
FINISH_TASK,
TASK_TABLE_UPDATED
};
......
......@@ -6,7 +6,7 @@
#include "Event.h"
#include "StartUpEvent.h"
#include "CopyCompletedEvent.h"
#include "LoadCompletedEvent.h"
#include "FinishTaskEvent.h"
#include "TaskTableUpdatedEvent.h"
......@@ -25,7 +25,7 @@ std::ostream &operator<<(std::ostream &out, const StartUpEvent &event) {
return out;
}
std::ostream &operator<<(std::ostream &out, const CopyCompletedEvent &event) {
std::ostream &operator<<(std::ostream &out, const LoadCompletedEvent &event) {
out << event.Dump();
return out;
}
......
......@@ -13,18 +13,18 @@ namespace zilliz {
namespace milvus {
namespace engine {
class CopyCompletedEvent : public Event {
class LoadCompletedEvent : public Event {
public:
CopyCompletedEvent(std::weak_ptr<Resource> resource, TaskTableItemPtr task_table_item)
: Event(EventType::COPY_COMPLETED, std::move(resource)),
LoadCompletedEvent(std::weak_ptr<Resource> resource, TaskTableItemPtr task_table_item)
: Event(EventType::LOAD_COMPLETED, std::move(resource)),
task_table_item_(std::move(task_table_item)) {}
inline std::string
Dump() const override {
return "<CopyCompletedEvent>";
return "<LoadCompletedEvent>";
}
friend std::ostream &operator<<(std::ostream &out, const CopyCompletedEvent &event);
friend std::ostream &operator<<(std::ostream &out, const LoadCompletedEvent &event);
public:
TaskTableItemPtr task_table_item_;
......
......@@ -113,10 +113,9 @@ void Resource::loader_function() {
break;
}
LoadFile(task_item->task);
// TODO: wrapper loaded
task_item->Loaded();
if (subscriber_) {
auto event = std::make_shared<CopyCompletedEvent>(shared_from_this(), task_item);
auto event = std::make_shared<LoadCompletedEvent>(shared_from_this(), task_item);
subscriber_(std::static_pointer_cast<Event>(event));
}
}
......
......@@ -14,7 +14,7 @@
#include "../event/Event.h"
#include "../event/StartUpEvent.h"
#include "../event/CopyCompletedEvent.h"
#include "../event/LoadCompletedEvent.h"
#include "../event/FinishTaskEvent.h"
#include "../event/TaskTableUpdatedEvent.h"
#include "../TaskTable.h"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册