[#26] netmap: Add NOT and UNIQUE keywords #35
2 changed files with 13 additions and 0 deletions
BIN
netmap/grpc/types.pb.go
generated
BIN
netmap/grpc/types.pb.go
generated
Binary file not shown.
|
@ -55,6 +55,7 @@ type Replica struct {
|
|||
type Operation uint32
|
||||
|
||||
type PlacementPolicy struct {
|
||||
unique bool
|
||||
replicas []Replica
|
||||
backupFactor uint32
|
||||
selectors []Selector
|
||||
|
@ -106,6 +107,7 @@ const (
|
|||
LE
|
||||
OR
|
||||
AND
|
||||
NOT
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -257,6 +259,17 @@ func (r *Replica) SetCount(count uint32) {
|
|||
r.count = count
|
||||
}
|
||||
|
||||
func (p *PlacementPolicy) GetUnique() bool {
|
||||
|
||||
if p != nil {
|
||||
return p.unique
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (p *PlacementPolicy) SetUnique(unique bool) {
|
||||
p.unique = unique
|
||||
}
|
||||
|
||||
func (p *PlacementPolicy) GetFilters() []Filter {
|
||||
if p != nil {
|
||||
return p.filters
|
||||
|
|
Loading…
Reference in a new issue
I suggest adding a nil check. See GetFilters as example.