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