SearchTask.h 1.6 KB
Newer Older
1
// Copyright (C) 2019-2020 Zilliz. All rights reserved.
J
jinhai 已提交
2
//
3 4
// Licensed 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
J
jinhai 已提交
5
//
6 7 8 9 10
// 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.
J
jinhai 已提交
11

12 13
#pragma once

Z
Zhiru Zhu 已提交
14
#include <memory>
15
#include <string>
Z
Zhiru Zhu 已提交
16 17
#include <vector>

G
groot 已提交
18 19
#include "db/SnapshotVisitor.h"
#include "db/engine/ExecutionEngine.h"
W
wxyu 已提交
20
#include "scheduler/Definition.h"
S
starlord 已提交
21
#include "scheduler/job/SearchJob.h"
G
groot 已提交
22
#include "scheduler/task/Task.h"
23 24

namespace milvus {
W
wxyu 已提交
25
namespace scheduler {
26

G
groot 已提交
27
class SearchTask : public Task {
S
starlord 已提交
28
 public:
G
groot 已提交
29 30
    explicit SearchTask(const server::ContextPtr& context, const engine::DBOptions& options,
                        const query::QueryPtr& query_ptr, engine::snapshot::ID_TYPE segment_id, TaskLabelPtr label);
W
wxyu 已提交
31

32 33 34 35 36 37
    void
    Load(LoadType type, uint8_t device_id) override;

    void
    Execute() override;

G
groot 已提交
38 39
    std::string
    IndexName();
40

G
groot 已提交
41 42 43
 private:
    void
    CreateExecEngine();
44

S
starlord 已提交
45
 public:
Z
Zhiru Zhu 已提交
46 47
    const std::shared_ptr<server::Context> context_;

G
groot 已提交
48 49 50
    const engine::DBOptions& options_;
    query::QueryPtr query_ptr_;
    engine::snapshot::ID_TYPE segment_id_;
G
groot 已提交
51

G
groot 已提交
52
    engine::SSExecutionEnginePtr execution_engine_;
53 54
};

S
starlord 已提交
55 56
}  // namespace scheduler
}  // namespace milvus