aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_mapper.h
blob: b0831bf2fccbc9698d7f0276e384abf9625dc6b0 (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
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include <vespa/searchlib/common/i_document_meta_store_context.h>
#include <vespa/searchlib/common/i_gid_to_lid_mapper.h>

namespace proton {

class DocumentMetaStore;

/*
 * Class for mapping from gid to lid. Instances should be short lived
 * due to read guards preventing resource reuse.
 */
class GidToLidMapper : public search::IGidToLidMapper
{
    search::IDocumentMetaStoreContext::IReadGuard::UP _guard;
public:
    GidToLidMapper(const search::IDocumentMetaStoreContext &dmsContext);
    virtual ~GidToLidMapper();
    virtual void foreach(const search::IGidToLidMapperVisitor &visitor) const override;
};

} // namespace proton