forked from TrueCloudLab/frostfs-api-go
[#249] pkg/netmap: Add CBF field in placement context
If CBF value is not set, then netmap package uses default CBF value. However it modifies placement policy structure in `GetContainerNodes()` because policy passed as a pointer. Instead package can store CBF value in internal context and use it without policy modification. Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
98284f0bfa
commit
c35e15a758
4 changed files with 18 additions and 6 deletions
|
@ -50,10 +50,7 @@ func (m *Netmap) GetPlacementVectors(cnt ContainerNodes, pivot []byte) ([]Nodes,
|
|||
func (m *Netmap) GetContainerNodes(p *PlacementPolicy, pivot []byte) (ContainerNodes, error) {
|
||||
c := NewContext(m)
|
||||
c.setPivot(pivot)
|
||||
|
||||
if p.ContainerBackupFactor() == 0 {
|
||||
p.SetContainerBackupFactor(defaultCBF)
|
||||
}
|
||||
c.setCBF(p.ContainerBackupFactor())
|
||||
|
||||
if err := c.processFilters(p); err != nil {
|
||||
return nil, err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue