aboutsummaryrefslogtreecommitdiffstats
path: root/documentapi/src/vespa/documentapi/messagebus/messages/emptybucketsmessage.h
blob: 31640c58db6a687c1e9ca58f3f5cdd40c8c08354 (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
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include "visitor.h"
#include <vespa/document/bucket/bucketid.h>

namespace documentapi {

/**
 * @class EmptyBucketsMessage
 * @ingroup message
 *
 * @brief Encapsulates a set of Empty bucket ids.
 */
class EmptyBucketsMessage : public VisitorMessage {
private:
    std::vector<document::BucketId> _bucketIds;

protected:
    DocumentReply::UP doCreateReply() const override;

public:
    EmptyBucketsMessage(); // must be serialized into
    EmptyBucketsMessage(const std::vector<document::BucketId> &bucketIds);
    ~EmptyBucketsMessage();

    std::vector<document::BucketId> &getBucketIds() { return _bucketIds; }
    const std::vector<document::BucketId> &getBucketIds() const { return _bucketIds; }

    void setBucketIds(const std::vector<document::BucketId> &bucketIds);
    void resize(uint32_t size);
    uint32_t getType() const override;
    string toString() const override { return "emptybucketsmessage"; }
};

}