aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/xdelta3/proto/state_header.proto
blob: 21454b8263bfc9342471a299c83ed33090d25103 (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
syntax = "proto2";

package NXdeltaAggregateColumn;

option cc_enable_arenas = true;

// update ArenaMaxSize with reasonable constant after Header modification
// note! not using strings here to avoid heap allocations

message TStateHeader {
    enum EType {
        NONE_TYPE = 0;
        BASE = 1;
        PATCH = 2;
    };

    enum EErrorCode {
        NO_ERROR = 0;
        HEADER_PARSE_ERROR = 1;
        BASE_HASH_ERROR = 2;
        STATE_HASH_ERROR = 3;
        MERGE_PATCHES_ERROR = 4;
        APPLY_PATCH_ERROR = 5;
        YT_MERGE_ERROR = 6;
        MISSING_REQUIRED_FIELD_ERROR = 7;
        WRONG_DATA_SIZE = 8;
        STATE_SIZE_ERROR = 9;
        PROTOBUF_ERROR = 10;
    };

    optional EType type = 1;        // base or patch
    optional uint32 base_hash = 2;  // applicable for patch - hash of base to apply on
    optional uint32 state_hash = 3; // applicable for patch - hash of target state 
    optional uint32 state_size = 4; // applicable for patch - target state size - remove it?
    optional uint32 data_size = 5;  // base or patch payload size
    optional EErrorCode error_code = 6;
};