forked from TrueCloudLab/frostfs-api-go
[#82] object: Introduce new fields for EC header
* Regenerate protobufs as frostfs-api introduced `parent_split_id` and `parent_split_index` fields. * Fix marshaller and converter for EC header. * Extend v2 type `ECHeader` with `ParentSplitID` and `ParentSplitIndex` fields. * Fix message_test for `Object`. Also generate EC headers and check it. Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
This commit is contained in:
parent
b171364079
commit
bc7b49eed2
7 changed files with 133 additions and 71 deletions
|
@ -31,6 +31,8 @@ const (
|
|||
ecHdrTotalField = 3
|
||||
ecHdrHeaderLengthField = 4
|
||||
ecHdrHeaderField = 5
|
||||
ecHdrParentSplitID = 6
|
||||
ecHdrParentSplitIndex = 7
|
||||
|
||||
hdrVersionField = 1
|
||||
hdrContainerIDField = 2
|
||||
|
@ -260,7 +262,9 @@ func (h *ECHeader) StableMarshal(buf []byte) []byte {
|
|||
offset += proto.UInt32Marshal(ecHdrIndexField, buf[offset:], h.Index)
|
||||
offset += proto.UInt32Marshal(ecHdrTotalField, buf[offset:], h.Total)
|
||||
offset += proto.UInt32Marshal(ecHdrHeaderLengthField, buf[offset:], h.HeaderLength)
|
||||
proto.BytesMarshal(ecHdrHeaderField, buf[offset:], h.Header)
|
||||
offset += proto.BytesMarshal(ecHdrHeaderField, buf[offset:], h.Header)
|
||||
offset += proto.BytesMarshal(ecHdrParentSplitID, buf[offset:], h.ParentSplitID)
|
||||
proto.UInt32Marshal(ecHdrParentSplitIndex, buf[offset:], h.ParentSplitIndex)
|
||||
return buf
|
||||
}
|
||||
|
||||
|
@ -274,6 +278,8 @@ func (h *ECHeader) StableSize() (size int) {
|
|||
size += proto.UInt32Size(ecHdrTotalField, h.Total)
|
||||
size += proto.UInt32Size(ecHdrHeaderLengthField, h.HeaderLength)
|
||||
size += proto.BytesSize(ecHdrHeaderField, h.Header)
|
||||
size += proto.BytesSize(ecHdrParentSplitID, h.ParentSplitID)
|
||||
size += proto.UInt32Size(ecHdrParentSplitIndex, h.ParentSplitIndex)
|
||||
|
||||
return size
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue