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
|
@ -69,7 +69,7 @@ func (c *Context) getSelection(p *PlacementPolicy, s *Selector) ([]Nodes, error)
|
|||
}
|
||||
}
|
||||
|
||||
maxNodesInBucket := nodesInBucket * int(p.ContainerBackupFactor())
|
||||
maxNodesInBucket := nodesInBucket * int(c.cbf)
|
||||
nodes := make([]Nodes, 0, len(buckets))
|
||||
fallback := make([]Nodes, 0, len(buckets))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue