mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-08 01:58:34 +08:00
[skip ci]Add event data comment (#8232)
Signed-off-by: godchen <qingxiang.chen@zilliz.com>
This commit is contained in:
parent
ac2aade0e4
commit
0cf0217ed5
@ -25,6 +25,7 @@ type descriptorEventData struct {
|
|||||||
PostHeaderLengths []uint8
|
PostHeaderLengths []uint8
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DescriptorEventDataFixPart is a memorty struct saves events' DescriptorEventData.
|
||||||
type DescriptorEventDataFixPart struct {
|
type DescriptorEventDataFixPart struct {
|
||||||
BinlogVersion int16
|
BinlogVersion int16
|
||||||
ServerVersion int64
|
ServerVersion int64
|
||||||
@ -39,19 +40,23 @@ type DescriptorEventDataFixPart struct {
|
|||||||
PayloadDataType schemapb.DataType
|
PayloadDataType schemapb.DataType
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetEventTimeStamp set the timestamp value of DescriptorEventDataFixPart.
|
||||||
func (data *descriptorEventData) SetEventTimeStamp(start typeutil.Timestamp, end typeutil.Timestamp) {
|
func (data *descriptorEventData) SetEventTimeStamp(start typeutil.Timestamp, end typeutil.Timestamp) {
|
||||||
data.StartTimestamp = start
|
data.StartTimestamp = start
|
||||||
data.EndTimestamp = end
|
data.EndTimestamp = end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetEventTimeStamp returns the memory size of DescriptorEventDataFixPart.
|
||||||
func (data *descriptorEventData) GetEventDataFixPartSize() int32 {
|
func (data *descriptorEventData) GetEventDataFixPartSize() int32 {
|
||||||
return int32(binary.Size(data.DescriptorEventDataFixPart))
|
return int32(binary.Size(data.DescriptorEventDataFixPart))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetEventTimeStamp returns the memory size of DescriptorEventDataFixPart.
|
||||||
func (data *descriptorEventData) GetMemoryUsageInBytes() int32 {
|
func (data *descriptorEventData) GetMemoryUsageInBytes() int32 {
|
||||||
return data.GetEventDataFixPartSize() + int32(binary.Size(data.PostHeaderLengths))
|
return data.GetEventDataFixPartSize() + int32(binary.Size(data.PostHeaderLengths))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Write transfer DescriptorEventDataFixPart to binary buffer.
|
||||||
func (data *descriptorEventData) Write(buffer io.Writer) error {
|
func (data *descriptorEventData) Write(buffer io.Writer) error {
|
||||||
if err := binary.Write(buffer, binary.LittleEndian, data.DescriptorEventDataFixPart); err != nil {
|
if err := binary.Write(buffer, binary.LittleEndian, data.DescriptorEventDataFixPart); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user