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

#pragma once

#include "i_gid_to_lid_change_handler.h"
#include <vector>
#include <mutex>
#include <vespa/vespalib/stllike/hash_map.h>
#include <vespa/document/base/globalid.h>

namespace searchcorespi { namespace index { struct IThreadService; } }

namespace proton {

/*
 * Dummy class for registering listeners that get notification when
 * gid to lid mapping changes.
 */
class DummyGidToLidChangeHandler : public IGidToLidChangeHandler
{
public:
    DummyGidToLidChangeHandler();
    ~DummyGidToLidChangeHandler() override;

    void notifyPut(IDestructorCallbackSP context, GlobalId gid, uint32_t lid, SerialNum serial_num) override;
    void notifyRemoves(IDestructorCallbackSP context, const std::vector<GlobalId> & gid, SerialNum serialNum) override;
    void addListener(std::unique_ptr<IGidToLidChangeListener> listener) override;
    void removeListeners(const vespalib::string &docTypeName, const std::set<vespalib::string> &keepNames) override;
    std::unique_ptr<IPendingGidToLidChanges> grab_pending_changes() override;
};

} // namespace proton