[#26] netmap: Add unique field marshaling for PlacementPolicy

Signed-off-by: Airat Arifullin a.arifullin@yadro.com
This commit is contained in:
Airat Arifullin 2023-06-14 14:21:58 +03:00
parent 8266b31092
commit 4388a87d15
2 changed files with 4 additions and 1 deletions

View file

@ -26,6 +26,7 @@ const (
backupPolicyField = 2
selectorsPolicyField = 3
filtersPolicyField = 4
uniquePolicyField = 5
keyAttributeField = 1
valueAttributeField = 2
@ -166,6 +167,8 @@ func (p *PlacementPolicy) StableMarshal(buf []byte) []byte {
offset += protoutil.NestedStructureMarshal(filtersPolicyField, buf[offset:], &p.filters[i])
}
offset += protoutil.BoolMarshal(uniquePolicyField, buf[offset:], p.unique)
return buf
}

View file

@ -55,11 +55,11 @@ type Replica struct {
type Operation uint32
type PlacementPolicy struct {
unique bool
replicas []Replica
backupFactor uint32
selectors []Selector
filters []Filter
unique bool
}
// Attribute of storage node.