aboutsummaryrefslogtreecommitdiffstats
path: root/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/rpc/ClusterStateBundleCodec.java
blob: ee49c90f62154b9fbff1d729c42a23aaa0bfc702 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.clustercontroller.core.rpc;

import com.yahoo.vespa.clustercontroller.core.ClusterStateBundle;

/**
 * Provides opaque encoding and decoding of ClusterStateBundles for transmission over RPC.
 *
 * Implementations may choose to compress the encoded representation of the bundle.
 *
 * It is important that the input given to decode() is exactly equal to that given from
 * encode() for the results to be correct. Implementations must ensure that this information
 * is enough to losslessly reconstruct the full encoded ClusterStateBundle.
 */
public interface ClusterStateBundleCodec {

    EncodedClusterStateBundle encode(ClusterStateBundle stateBundle);

    ClusterStateBundle decode(EncodedClusterStateBundle encodedClusterStateBundle);

}