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

#pragma once

namespace document { class BucketId; }

namespace proton::bucketdb {

class IBucketCreateListener;
class Guard;

/**
 * Interface class used to (un)register a listener to get notifications about
 * non-empty buckets created due to split/join operations.
 */
class IBucketCreateNotifier
{
public:
    virtual ~IBucketCreateNotifier() = default;

    /**
     * Signal that the given bucket has been created due to split/join
     * operation.
     */
    virtual void notifyCreateBucket(const Guard & guard, const document::BucketId &bucket) = 0;

    /*
     * Register bucket create listener.
     */
    virtual void addListener(IBucketCreateListener *listener) = 0;

    /*
     * Unregister bucket create listener.
     */
    virtual void removeListener(IBucketCreateListener *listener) = 0;
};

}