提交 f5b426df 编写于 作者: W wxyu

MS-405 Add delete task support


Former-commit-id: a47592ffd6463d4e5a2addf4df1438cc57937b93
上级 f32315d0
......@@ -41,6 +41,7 @@ Please mark all change in change log and use the ticket from JIRA.
- MS-400 - Add timestamp record in task state change function
- MS-402 - Add dump implementation for TaskTableItem
- MS-404 - Release index after search task done avoid memory increment continues
- MS-405 - Add delete task support
## New Feature
- MS-343 - Implement ResourceMgr
......
......@@ -6,10 +6,14 @@
#include "DeleteTask.h"
namespace zilliz {
namespace milvus {
namespace engine {
XDeleteTask::XDeleteTask(DeleteContextPtr &delete_context)
: delete_context_ptr_(delete_context) {}
void
XDeleteTask::Load(LoadType type, uint8_t device_id) {
......@@ -17,12 +21,13 @@ XDeleteTask::Load(LoadType type, uint8_t device_id) {
void
XDeleteTask::Execute() {
delete_context_ptr_->ResourceDone();
}
TaskPtr
XDeleteTask::Clone() {
return nullptr;
auto task = std::make_shared<XDeleteTask>(delete_context_ptr_);
return task;
}
}
......
......@@ -5,6 +5,7 @@
******************************************************************************/
#pragma once
#include <src/db/scheduler/context/DeleteContext.h>
#include "Task.h"
......@@ -14,6 +15,9 @@ namespace engine {
class XDeleteTask : public Task {
public:
explicit
XDeleteTask(DeleteContextPtr &delete_context);
void
Load(LoadType type, uint8_t device_id) override;
......@@ -22,6 +26,9 @@ public:
TaskPtr
Clone() override;
public:
DeleteContextPtr delete_context_ptr_;
};
}
......
......@@ -35,6 +35,7 @@ public:
virtual void
Execute() = 0;
// TODO: dont use this method to support task move
virtual TaskPtr
Clone() = 0;
......
......@@ -22,8 +22,9 @@ TaskConvert(const ScheduleTaskPtr &schedule_task) {
return task;
}
case ScheduleTaskType::kDelete: {
// TODO: convert to delete task
return nullptr;
auto delete_task = std::static_pointer_cast<DeleteTask>(schedule_task);
auto task = std::make_shared<XDeleteTask>(delete_task->context_);
return task;
}
default: {
// TODO: unexpected !!!
......
......@@ -4,9 +4,11 @@
* Proprietary and confidential.
******************************************************************************/
#include "src/db/scheduler/task/IndexLoadTask.h"
#include "db/scheduler/task/DeleteTask.h"
#include "db/scheduler/task/IndexLoadTask.h"
#include "Task.h"
#include "SearchTask.h"
#include "DeleteTask.h"
namespace zilliz {
namespace milvus {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册