forked from TrueCloudLab/frostfs-node
[#460] services/object: Reduce distibutedTarget
memory footprint
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
4d48377cec
commit
785d81a68a
2 changed files with 12 additions and 14 deletions
|
@ -25,8 +25,6 @@ type preparedObjectTarget interface {
|
|||
type distributedTarget struct {
|
||||
traversal traversal
|
||||
|
||||
remotePool, localPool util.WorkerPool
|
||||
|
||||
obj *objectSDK.Object
|
||||
objMeta object.ContentMeta
|
||||
|
||||
|
@ -34,7 +32,7 @@ type distributedTarget struct {
|
|||
|
||||
nodeTargetInitializer func(nodeDesc) preparedObjectTarget
|
||||
|
||||
isLocalKey func([]byte) bool
|
||||
getWorkerPool func([]byte) (util.WorkerPool, bool)
|
||||
|
||||
relay func(context.Context, nodeDesc) error
|
||||
|
||||
|
@ -223,13 +221,8 @@ func (t *distributedTarget) iterateAddresses(ctx context.Context, traverser *pla
|
|||
wg.Add(1)
|
||||
|
||||
addr := addrs[i]
|
||||
isLocal := t.isLocalKey(addr.PublicKey())
|
||||
|
||||
workerPool := t.remotePool
|
||||
if isLocal {
|
||||
workerPool = t.localPool
|
||||
}
|
||||
|
||||
workerPool, isLocal := t.getWorkerPool(addr.PublicKey())
|
||||
if err := workerPool.Submit(func() {
|
||||
defer wg.Done()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue