forked from TrueCloudLab/frostfs-node
[#607] placement: Make traverser to return list of address groups
Make placement `Traverser.Next` method to return ``[]network.AddressGroup` in order to support multiple addresses of the storeage nodes. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
8ac3c62518
commit
b3dd9a3254
6 changed files with 15 additions and 17 deletions
|
@ -122,7 +122,7 @@ func flatNodes(ns []netmap.Nodes) []netmap.Nodes {
|
|||
// Next returns next unprocessed address of the object placement.
|
||||
//
|
||||
// Returns nil if no nodes left or traversal operation succeeded.
|
||||
func (t *Traverser) Next() []network.Address {
|
||||
func (t *Traverser) Next() []network.AddressGroup {
|
||||
t.mtx.Lock()
|
||||
defer t.mtx.Unlock()
|
||||
|
||||
|
@ -139,10 +139,10 @@ func (t *Traverser) Next() []network.Address {
|
|||
count = len(t.vectors[0])
|
||||
}
|
||||
|
||||
addrs := make([]network.Address, count)
|
||||
addrs := make([]network.AddressGroup, count)
|
||||
|
||||
for i := 0; i < count; i++ {
|
||||
err := addrs[i].FromString(t.vectors[0][i].Address())
|
||||
err := addrs[i].FromIterator(t.vectors[0][i])
|
||||
if err != nil {
|
||||
// TODO: log error
|
||||
return nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue