Documentation ¶
Index ¶
- Variables
- type Timestamp
- func (m Timestamp) DebugString() string
- func (*Timestamp) Descriptor() ([]byte, []int)
- func (m Timestamp) Equal(rhs Timestamp) bool
- func (m *Timestamp) GetLogicalTime() uint32
- func (m *Timestamp) GetNodeID() uint32
- func (m *Timestamp) GetPhysicalTime() int64
- func (m Timestamp) Greater(rhs Timestamp) bool
- func (m Timestamp) GreaterEq(rhs Timestamp) bool
- func (m Timestamp) IsEmpty() bool
- func (m Timestamp) Less(rhs Timestamp) bool
- func (m Timestamp) LessEq(rhs Timestamp) bool
- func (m *Timestamp) Marshal() (dAtA []byte, err error)
- func (m *Timestamp) MarshalTo(dAtA []byte) (int, error)
- func (m *Timestamp) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (m Timestamp) Next() Timestamp
- func (m Timestamp) Prev() Timestamp
- func (*Timestamp) ProtoMessage()
- func (m Timestamp) ProtoSize() int
- func (m *Timestamp) Reset()
- func (m *Timestamp) Size() (n int)
- func (m *Timestamp) String() string
- func (m Timestamp) ToStdTime() time.Time
- func (m *Timestamp) Unmarshal(dAtA []byte) error
- func (m *Timestamp) XXX_DiscardUnknown()
- func (m *Timestamp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Timestamp) XXX_Merge(src proto.Message)
- func (m *Timestamp) XXX_Size() int
- func (m *Timestamp) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Timestamp ¶
type Timestamp struct { // PhysicalTime is the physical component of the HLC, it is read from a node's // wall clock time as Unix epoch time in nanoseconds. HLC requires this field // to be monotonically increase on each node. PhysicalTime int64 `protobuf:"varint,1,opt,name=PhysicalTime,proto3" json:"PhysicalTime,omitempty"` // LogicalTime is the logical component of the HLC, its value is maintained // according to the HLC algorithm. The HLC paper further establishes that its // value will not overflow in a real production environment. LogicalTime uint32 `protobuf:"varint,2,opt,name=LogicalTime,proto3" json:"LogicalTime,omitempty"` // NodeID just used to compatible with TAE some constraint to guaranteed unique // timestamp. uint16 is not defined, so use uint32, but only 2 bytes. The field // is not used for comparing the timestamps. NodeID uint32 `protobuf:"varint,3,opt,name=NodeID,proto3" json:"NodeID,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Timestamp is a HLC time value. All its field should never be accessed directly by its users.
func ParseTimestamp ¶ added in v0.7.0
ParseTimestamp parse timestamp from debug string
func (Timestamp) DebugString ¶ added in v0.6.0
DebugString returns debug string
func (*Timestamp) Descriptor ¶
func (Timestamp) Equal ¶
Equal returns a boolean value indicating whether the lhs timestamp equals to the rhs timestamp.
func (*Timestamp) GetLogicalTime ¶
func (*Timestamp) GetPhysicalTime ¶
func (Timestamp) Greater ¶
Greater returns a boolean value indicating whether the lhs timestamp is greater than the rhs timestamp value.
func (Timestamp) GreaterEq ¶
GreaterEq returns a boolean value indicating whether the lhs timestamp is greater than or equal to the rhs timestamp value.
func (Timestamp) IsEmpty ¶
IsEmpty returns a boolean value indicating whether the current timestamp is an empty value.
func (Timestamp) Less ¶
Less returns a boolean value indicating whether the lhs timestamp is less than the rhs timestamp value.
func (Timestamp) LessEq ¶
LessEq returns a boolean value indicating whether the lhs timestamp is less than or equal to the rhs timestamp value.
func (*Timestamp) MarshalToSizedBuffer ¶
func (Timestamp) Next ¶
Next returns the smallest timestamp that is greater than the current timestamp.
func (Timestamp) Prev ¶
Prev returns the smallest timestamp that is less than the current timestamp.
func (*Timestamp) ProtoMessage ¶
func (*Timestamp) ProtoMessage()
func (Timestamp) ToStdTime ¶
ToStdTime converts the HLC timestamp to a regular golang stdlib UTC timestamp. The logical time component of the HLC is lost after the conversion.
func (*Timestamp) XXX_DiscardUnknown ¶
func (m *Timestamp) XXX_DiscardUnknown()