forked from TrueCloudLab/frostfs-api-go
[#156] netmap: Use default value for CBF if unset
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
4e65fa41b8
commit
4e0a11b71a
2 changed files with 29 additions and 0 deletions
|
@ -6,6 +6,8 @@ import (
|
|||
"github.com/nspcc-dev/hrw"
|
||||
)
|
||||
|
||||
const defaultCBF = 3
|
||||
|
||||
// Netmap represents netmap which contains preprocessed nodes.
|
||||
type Netmap struct {
|
||||
Nodes Nodes
|
||||
|
@ -49,6 +51,10 @@ func (m *Netmap) GetContainerNodes(p *PlacementPolicy, pivot []byte) (ContainerN
|
|||
c := NewContext(m)
|
||||
c.setPivot(pivot)
|
||||
|
||||
if p.ContainerBackupFactor() == 0 {
|
||||
p.SetContainerBackupFactor(defaultCBF)
|
||||
}
|
||||
|
||||
if err := c.processFilters(p); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue