forked from TrueCloudLab/frostfs-node
[#109] services/policer: Assign tasks to Replicator
Make Policer to call AddTask method of Replicator when an insufficient number of copies of an object is detected in the container. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
2d46baa4a5
commit
f66c7958e7
2 changed files with 17 additions and 1 deletions
|
@ -8,6 +8,7 @@ import (
|
|||
"github.com/nspcc-dev/neofs-api-go/pkg/object"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/network"
|
||||
headsvc "github.com/nspcc-dev/neofs-node/pkg/services/object/head"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/services/replicator"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
|
@ -98,6 +99,11 @@ func (p *Policer) processNodes(ctx context.Context, addr *object.Address, nodes
|
|||
p.log.Info("shortage of object copies detected",
|
||||
zap.Uint32("shortage", shortage),
|
||||
)
|
||||
// TODO: send task to replicator
|
||||
|
||||
p.replicator.AddTask(new(replicator.Task).
|
||||
WithObjectAddress(addr).
|
||||
WithNodes(nodes).
|
||||
WithCopiesNumber(shortage),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue