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

#pragma once

#include "i_bucket_create_notifier.h"
#include <vector>

namespace proton::bucketdb {

class IBucketCreateListener;

/**
 * Class used to (un)register a listener to get notifications about
 * non-empty buckets created due to split/join operations.
 */
class BucketCreateNotifier : public IBucketCreateNotifier
{
    std::vector<IBucketCreateListener *> _listeners;

public:
    BucketCreateNotifier();
    ~BucketCreateNotifier() override;

    void notifyCreateBucket(const Guard & guard, const document::BucketId &bucket) override;
    void addListener(IBucketCreateListener *listener) override;
    void removeListener(IBucketCreateListener *listener) override;
};

}