-
Notifications
You must be signed in to change notification settings - Fork 3.8k
/
legacy_timestamp.proto
44 lines (39 loc) · 1.7 KB
/
legacy_timestamp.proto
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
38
39
40
41
42
43
44
// Copyright 2017 The Cockroach Authors.
//
// Use of this software is governed by the Business Source License
// included in the file licenses/BSL.txt.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by the Apache License, Version 2.0, included in the file
// licenses/APL.txt.
syntax = "proto2";
package cockroach.util.hlc;
option go_package = "hlc";
import "gogoproto/gogo.proto";
// LegacyTimestamp is convertible to hlc.Timestamp, but uses the
// legacy encoding as it is encoded "below raft".
message LegacyTimestamp {
option (gogoproto.equal) = true;
option (gogoproto.goproto_stringer) = false;
option (gogoproto.populate) = true;
// Holds a wall time, typically a unix epoch time expressed in
// nanoseconds.
optional int64 wall_time = 1 [(gogoproto.nullable) = false];
// The logical component captures causality for events whose wall
// times are equal. It is effectively bounded by (maximum clock
// skew)/(minimal ns between events) and nearly impossible to
// overflow.
optional int32 logical = 2 [(gogoproto.nullable) = false];
// Indicates that the Timestamp did not come from an HLC clock somewhere
// in the system and, therefore, does not have has the ability to update
// a peer's HLC clock. If set to true, the "synthetic timestamp" may be
// arbitrarily disconnected from real time.
//
// See the commentary on Timestamp.synthetic for more information.
//
// The field is nullable so that it is not serialized when set to false.
// This ensures that the timestamp encoding does not change across nodes
// that are and are not aware of this field.
optional bool synthetic = 3;
}