2023-09-21 18:18:20 +03:00
|
|
|
package common
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
2023-09-22 13:07:32 +03:00
|
|
|
oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id"
|
2023-09-21 18:18:20 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
type RebuildRes struct {
|
|
|
|
ObjectsMoved uint64
|
|
|
|
FilesRemoved uint64
|
|
|
|
}
|
|
|
|
|
|
|
|
type RebuildPrm struct {
|
2025-02-06 17:24:23 +03:00
|
|
|
MetaStorage MetaStorage
|
|
|
|
Limiter RebuildLimiter
|
|
|
|
FillPercent int
|
2023-09-21 18:18:20 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
type MetaStorage interface {
|
2023-09-22 13:07:32 +03:00
|
|
|
UpdateStorageID(ctx context.Context, addr oid.Address, storageID []byte) error
|
2023-09-21 18:18:20 +03:00
|
|
|
}
|
2023-10-03 11:58:35 +03:00
|
|
|
|
2025-02-06 17:24:23 +03:00
|
|
|
type ReleaseFunc func()
|
|
|
|
|
|
|
|
type ConcurrencyLimiter interface {
|
|
|
|
AcquireWorkSlot(ctx context.Context) (ReleaseFunc, error)
|
|
|
|
}
|
|
|
|
|
2025-02-07 17:25:47 +03:00
|
|
|
type RateLimiter interface {
|
|
|
|
ReadRequest(context.Context) (ReleaseFunc, error)
|
|
|
|
WriteRequest(context.Context) (ReleaseFunc, error)
|
|
|
|
}
|
|
|
|
|
2025-02-06 17:24:23 +03:00
|
|
|
type RebuildLimiter interface {
|
|
|
|
ConcurrencyLimiter
|
2025-02-07 17:25:47 +03:00
|
|
|
RateLimiter
|
2023-10-03 11:58:35 +03:00
|
|
|
}
|