FinishTaskEvent.h 1.5 KB
Newer Older
J
jinhai 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License.  You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.

W
wxyu 已提交
18 19
#pragma once

S
starlord 已提交
20
#include "scheduler/TaskTable.h"
S
starlord 已提交
21
#include "scheduler/event/Event.h"
W
wxyu 已提交
22

S
starlord 已提交
23 24
#include <memory>
#include <string>
S
starlord 已提交
25
#include <utility>
W
wxyu 已提交
26 27

namespace milvus {
W
wxyu 已提交
28
namespace scheduler {
W
wxyu 已提交
29 30

class FinishTaskEvent : public Event {
S
starlord 已提交
31
 public:
32
    FinishTaskEvent(std::shared_ptr<Resource> resource, TaskTableItemPtr task_table_item)
S
starlord 已提交
33
        : Event(EventType::FINISH_TASK, std::move(resource)), task_table_item_(std::move(task_table_item)) {
S
starlord 已提交
34
    }
W
wxyu 已提交
35

W
wxyu 已提交
36 37 38 39 40
    inline std::string
    Dump() const override {
        return "<FinishTaskEvent>";
    }

S
starlord 已提交
41 42
    friend std::ostream&
    operator<<(std::ostream& out, const FinishTaskEvent& event);
W
wxyu 已提交
43

S
starlord 已提交
44
 public:
45
    TaskTableItemPtr task_table_item_;
W
wxyu 已提交
46 47
};

S
starlord 已提交
48 49
}  // namespace scheduler
}  // namespace milvus