mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-01 11:29:48 +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
|
||||
}
|
||||
|
||||
// DescriptorEventDataFixPart is a memorty struct saves events' DescriptorEventData.
|
||||
type DescriptorEventDataFixPart struct {
|
||||
BinlogVersion int16
|
||||
ServerVersion int64
|
||||
@ -39,19 +40,23 @@ type DescriptorEventDataFixPart struct {
|
||||
PayloadDataType schemapb.DataType
|
||||
}
|
||||
|
||||
// SetEventTimeStamp set the timestamp value of DescriptorEventDataFixPart.
|
||||
func (data *descriptorEventData) SetEventTimeStamp(start typeutil.Timestamp, end typeutil.Timestamp) {
|
||||
data.StartTimestamp = start
|
||||
data.EndTimestamp = end
|
||||
}
|
||||
|
||||
// SetEventTimeStamp returns the memory size of DescriptorEventDataFixPart.
|
||||
func (data *descriptorEventData) GetEventDataFixPartSize() int32 {
|
||||
return int32(binary.Size(data.DescriptorEventDataFixPart))
|
||||
}
|
||||
|
||||
// SetEventTimeStamp returns the memory size of DescriptorEventDataFixPart.
|
||||
func (data *descriptorEventData) GetMemoryUsageInBytes() int32 {
|
||||
return data.GetEventDataFixPartSize() + int32(binary.Size(data.PostHeaderLengths))
|
||||
}
|
||||
|
||||
// Write transfer DescriptorEventDataFixPart to binary buffer.
|
||||
func (data *descriptorEventData) Write(buffer io.Writer) error {
|
||||
if err := binary.Write(buffer, binary.LittleEndian, data.DescriptorEventDataFixPart); err != nil {
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user