aboutsummaryrefslogtreecommitdiffstats
path: root/storage/src/vespa/storage/storageserver/rpc/slime_cluster_state_bundle_codec.h
blob: f0e7a5c8649e76b43602ce33fe3b0a1b9d3d04fc (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
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include "cluster_state_bundle_codec.h"
#include <memory>

namespace storage::rpc {

/**
 * Implementation of ClusterStateBundleCodec which uses structured Slime binary encoding
 * to implement (de-)serialization of ClusterStateBundle instances. Encoding format is
 * intentionally extensible so that we may add other information to it later.
 *
 * LZ4 compression is transparently applied during encoding and decompression is
 * subsequently applied during decoding.
 */
class SlimeClusterStateBundleCodec : public ClusterStateBundleCodec {
public:
    EncodedClusterStateBundle encode(const lib::ClusterStateBundle&) const override;
    std::shared_ptr<const lib::ClusterStateBundle> decode(const EncodedClusterStateBundle&) const override;
};

}