All checks were successful
DCO action / DCO (pull_request) Successful in 36s
Vulncheck / Vulncheck (pull_request) Successful in 1m1s
Pre-commit hooks / Pre-commit (pull_request) Successful in 1m27s
Tests and linters / Run gofumpt (pull_request) Successful in 1m19s
Build / Build Components (pull_request) Successful in 1m38s
Tests and linters / Staticcheck (pull_request) Successful in 2m16s
Tests and linters / Lint (pull_request) Successful in 3m0s
Tests and linters / Tests (pull_request) Successful in 4m40s
Tests and linters / Tests with -race (pull_request) Successful in 5m20s
Tests and linters / gopls check (pull_request) Successful in 5m23s
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
38 lines
707 B
Go
38 lines
707 B
Go
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
|
|
}
|