package common

import (
	"context"

	oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id"
)

type RebuildRes struct {
	ObjectsMoved uint64
	FilesRemoved uint64
}

type RebuildPrm struct {
	MetaStorage MetaStorage
	Limiter     RebuildLimiter
	FillPercent int
}

type MetaStorage interface {
	UpdateStorageID(ctx context.Context, addr oid.Address, storageID []byte) error
}

type ReleaseFunc func()

type ConcurrencyLimiter interface {
	AcquireWorkSlot(ctx context.Context) (ReleaseFunc, error)
}

type RateLimiter interface {
	ReadRequest(context.Context) (ReleaseFunc, error)
	WriteRequest(context.Context) (ReleaseFunc, error)
}

type RebuildLimiter interface {
	ConcurrencyLimiter
	RateLimiter
}