From 5620e71fe3cd4c2963139e86dda3dc669c55d667 Mon Sep 17 00:00:00 2001 From: Evgenii Baidakov Date: Mon, 26 Jun 2023 11:43:34 +0400 Subject: [PATCH] pool: Remove unused statisticUpdater Signed-off-by: Evgenii Baidakov --- pool/accounting.go | 2 +- pool/container.go | 12 ++++++------ pool/netmap.go | 4 ++-- pool/object.go | 14 +++++++------- pool/pool.go | 8 ++++---- pool/pool_aio_test.go | 8 ++++---- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pool/accounting.go b/pool/accounting.go index 9ff246ce..f6346d92 100644 --- a/pool/accounting.go +++ b/pool/accounting.go @@ -11,7 +11,7 @@ import ( // // See details in [client.Client.BalanceGet]. func (p *Pool) BalanceGet(ctx context.Context, prm client.PrmBalanceGet) (accounting.Decimal, error) { - c, _, err := p.sdkClient() + c, err := p.sdkClient() if err != nil { return accounting.Decimal{}, err } diff --git a/pool/container.go b/pool/container.go index d858a290..956d98de 100644 --- a/pool/container.go +++ b/pool/container.go @@ -14,7 +14,7 @@ import ( // // See details in [client.Client.ContainerPut]. func (p *Pool) ContainerPut(ctx context.Context, cont container.Container, prm client.PrmContainerPut) (cid.ID, error) { - c, _, err := p.sdkClient() + c, err := p.sdkClient() if err != nil { return cid.ID{}, err } @@ -26,7 +26,7 @@ func (p *Pool) ContainerPut(ctx context.Context, cont container.Container, prm c // // See details in [client.Client.ContainerGet]. func (p *Pool) ContainerGet(ctx context.Context, id cid.ID, prm client.PrmContainerGet) (container.Container, error) { - c, _, err := p.sdkClient() + c, err := p.sdkClient() if err != nil { return container.Container{}, err } @@ -38,7 +38,7 @@ func (p *Pool) ContainerGet(ctx context.Context, id cid.ID, prm client.PrmContai // // See details in [client.Client.ContainerList]. func (p *Pool) ContainerList(ctx context.Context, ownerID user.ID, prm client.PrmContainerList) ([]cid.ID, error) { - c, _, err := p.sdkClient() + c, err := p.sdkClient() if err != nil { return []cid.ID{}, err } @@ -50,7 +50,7 @@ func (p *Pool) ContainerList(ctx context.Context, ownerID user.ID, prm client.Pr // // See details in [client.Client.ContainerDelete]. func (p *Pool) ContainerDelete(ctx context.Context, id cid.ID, prm client.PrmContainerDelete) error { - c, _, err := p.sdkClient() + c, err := p.sdkClient() if err != nil { return err } @@ -62,7 +62,7 @@ func (p *Pool) ContainerDelete(ctx context.Context, id cid.ID, prm client.PrmCon // // See details in [client.Client.ContainerEACL]. func (p *Pool) ContainerEACL(ctx context.Context, id cid.ID, prm client.PrmContainerEACL) (eacl.Table, error) { - c, _, err := p.sdkClient() + c, err := p.sdkClient() if err != nil { return eacl.Table{}, err } @@ -74,7 +74,7 @@ func (p *Pool) ContainerEACL(ctx context.Context, id cid.ID, prm client.PrmConta // // See details in [client.Client.ContainerSetEACL]. func (p *Pool) ContainerSetEACL(ctx context.Context, table eacl.Table, prm client.PrmContainerSetEACL) error { - c, _, err := p.sdkClient() + c, err := p.sdkClient() if err != nil { return err } diff --git a/pool/netmap.go b/pool/netmap.go index fe773a36..6c2699c5 100644 --- a/pool/netmap.go +++ b/pool/netmap.go @@ -11,7 +11,7 @@ import ( // // See details in [client.Client.NetworkInfo]. func (p *Pool) NetworkInfo(ctx context.Context, prm client.PrmNetworkInfo) (netmap.NetworkInfo, error) { - c, _, err := p.sdkClient() + c, err := p.sdkClient() if err != nil { return netmap.NetworkInfo{}, err } @@ -23,7 +23,7 @@ func (p *Pool) NetworkInfo(ctx context.Context, prm client.PrmNetworkInfo) (netm // // See details in [client.Client.NetMapSnapshot]. func (p *Pool) NetMapSnapshot(ctx context.Context, prm client.PrmNetMapSnapshot) (netmap.NetMap, error) { - c, _, err := p.sdkClient() + c, err := p.sdkClient() if err != nil { return netmap.NetMap{}, err } diff --git a/pool/object.go b/pool/object.go index 6a9d7fdf..bed31bec 100644 --- a/pool/object.go +++ b/pool/object.go @@ -29,7 +29,7 @@ func (p *Pool) actualSigner(signer neofscrypto.Signer) neofscrypto.Signer { // // See details in [client.Client.ObjectPutInit]. func (p *Pool) ObjectPutInit(ctx context.Context, hdr object.Object, prm client.PrmObjectPutInit) (*client.ObjectWriter, error) { - c, _, err := p.sdkClient() + c, err := p.sdkClient() if err != nil { return nil, err } @@ -58,7 +58,7 @@ func (p *Pool) ObjectPutInit(ctx context.Context, hdr object.Object, prm client. // See details in [client.Client.ObjectGetInit]. func (p *Pool) ObjectGetInit(ctx context.Context, containerID cid.ID, objectID oid.ID, prm client.PrmObjectGet) (object.Object, *client.ObjectReader, error) { var hdr object.Object - c, _, err := p.sdkClient() + c, err := p.sdkClient() if err != nil { return hdr, nil, err } @@ -80,7 +80,7 @@ func (p *Pool) ObjectGetInit(ctx context.Context, containerID cid.ID, objectID o // // See details in [client.Client.ObjectHead]. func (p *Pool) ObjectHead(ctx context.Context, containerID cid.ID, objectID oid.ID, prm client.PrmObjectHead) (*client.ResObjectHead, error) { - c, _, err := p.sdkClient() + c, err := p.sdkClient() if err != nil { return nil, err } @@ -102,7 +102,7 @@ func (p *Pool) ObjectHead(ctx context.Context, containerID cid.ID, objectID oid. // // See details in [client.Client.ObjectRangeInit]. func (p *Pool) ObjectRangeInit(ctx context.Context, containerID cid.ID, objectID oid.ID, offset, length uint64, prm client.PrmObjectRange) (*client.ObjectRangeReader, error) { - c, _, err := p.sdkClient() + c, err := p.sdkClient() if err != nil { return nil, err } @@ -124,7 +124,7 @@ func (p *Pool) ObjectRangeInit(ctx context.Context, containerID cid.ID, objectID // // See details in [client.Client.ObjectDelete]. func (p *Pool) ObjectDelete(ctx context.Context, containerID cid.ID, objectID oid.ID, prm client.PrmObjectDelete) (oid.ID, error) { - c, _, err := p.sdkClient() + c, err := p.sdkClient() if err != nil { return oid.ID{}, err } @@ -146,7 +146,7 @@ func (p *Pool) ObjectDelete(ctx context.Context, containerID cid.ID, objectID oi // // See details in [client.Client.ObjectHash]. func (p *Pool) ObjectHash(ctx context.Context, containerID cid.ID, objectID oid.ID, prm client.PrmObjectHash) ([][]byte, error) { - c, _, err := p.sdkClient() + c, err := p.sdkClient() if err != nil { return [][]byte{}, err } @@ -168,7 +168,7 @@ func (p *Pool) ObjectHash(ctx context.Context, containerID cid.ID, objectID oid. // // See details in [client.Client.ObjectSearchInit]. func (p *Pool) ObjectSearchInit(ctx context.Context, containerID cid.ID, prm client.PrmObjectSearch) (*client.ObjectListReader, error) { - c, _, err := p.sdkClient() + c, err := p.sdkClient() if err != nil { return nil, err } diff --git a/pool/pool.go b/pool/pool.go index f23f1d70..f3ba6588 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -2518,18 +2518,18 @@ func (p *Pool) FindSiblingByParentID(ctx context.Context, cnrID cid.ID, objID oi return res, nil } -func (p *Pool) sdkClient() (*sdkClient.Client, statisticUpdater, error) { +func (p *Pool) sdkClient() (*sdkClient.Client, error) { conn, err := p.connection() if err != nil { - return nil, nil, fmt.Errorf("connection: %w", err) + return nil, fmt.Errorf("connection: %w", err) } cl, err := conn.getClient() if err != nil { - return nil, nil, fmt.Errorf("get client: %w", err) + return nil, fmt.Errorf("get client: %w", err) } - return cl, conn, nil + return cl, nil } func (p *Pool) statisticMiddleware(nodeKey []byte, endpoint string, method stat.Method, duration time.Duration, err error) { diff --git a/pool/pool_aio_test.go b/pool/pool_aio_test.go index c9b87dfe..6e579582 100644 --- a/pool/pool_aio_test.go +++ b/pool/pool_aio_test.go @@ -170,7 +170,7 @@ func TestPoolInterfaceWithAIO(t *testing.T) { defer cancel() containerID = testCreateContainer(t, ctxTimeout, signer, cont, pool) - cl, _, err := pool.sdkClient() + cl, err := pool.sdkClient() require.NoError(t, err) require.NoError(t, isBucketCreated(ctxTimeout, cl, containerID)) @@ -183,7 +183,7 @@ func TestPoolInterfaceWithAIO(t *testing.T) { defer cancel() table := testSetEacl(t, ctxTimeout, signer, eaclTable, pool) - cl, _, err := pool.sdkClient() + cl, err := pool.sdkClient() require.NoError(t, err) require.NoError(t, isEACLCreated(ctxTimeout, cl, containerID, table)) @@ -226,7 +226,7 @@ func TestPoolInterfaceWithAIO(t *testing.T) { defer cancel() testDeleteObject(t, ctxTimeout, signer, containerID, objectID, pool) - cl, _, err := pool.sdkClient() + cl, err := pool.sdkClient() require.NoError(t, err) require.NoError(t, isObjectDeleted(ctxTimeout, cl, containerID, objectID)) @@ -237,7 +237,7 @@ func TestPoolInterfaceWithAIO(t *testing.T) { defer cancel() testDeleteContainer(t, ctxTimeout, signer, containerID, pool) - cl, _, err := pool.sdkClient() + cl, err := pool.sdkClient() require.NoError(t, err) require.NoError(t, isBucketDeleted(ctxTimeout, cl, containerID))