blob: ffcdfbaf365ec7ae0f9a930d48d636ab1ffaefc1 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include <vespa/vespalib/util/thread_bundle.h>
namespace search::engine {
class SearchRequest;
class SearchReply;
class DocsumRequest;
struct DocsumReply;
}
namespace proton {
/**
* This interface describes a sync summary operation handler. It is
* implemented by the DocumentDB class, and used by the SummaryEngine
* class to delegate operations to the appropriate db.
*/
class ISearchHandler {
protected:
ISearchHandler() = default;
using DocsumReply = search::engine::DocsumReply;
using SearchReply = search::engine::SearchReply;
using SearchRequest = search::engine::SearchRequest;
using DocsumRequest = search::engine::DocsumRequest;
using ThreadBundle = vespalib::ThreadBundle;
public:
typedef std::unique_ptr<ISearchHandler> UP;
typedef std::shared_ptr<ISearchHandler> SP;
ISearchHandler(const ISearchHandler &) = delete;
ISearchHandler & operator = (const ISearchHandler &) = delete;
virtual ~ISearchHandler() { }
/**
* @return Use the request and produce the document summary result.
*/
virtual std::unique_ptr<DocsumReply> getDocsums(const DocsumRequest & request) = 0;
virtual std::unique_ptr<SearchReply>
match(const ISearchHandler::SP &self, const SearchRequest &req, ThreadBundle &threadBundle) const = 0;
};
} // namespace proton
|