forked from TrueCloudLab/frostfs-node
Dmitrii Stepanov
279261ace3
Resolve containedctx for routeCtx. Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
36 lines
645 B
Go
36 lines
645 B
Go
package loadcontroller
|
|
|
|
import (
|
|
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container"
|
|
)
|
|
|
|
func usedSpaceFilterEpochEQ(epoch uint64) UsedSpaceFilter {
|
|
return func(a container.SizeEstimation) bool {
|
|
return a.Epoch() == epoch
|
|
}
|
|
}
|
|
|
|
type storageWrapper struct {
|
|
w Writer
|
|
i Iterator
|
|
}
|
|
|
|
func (s storageWrapper) InitIterator() (Iterator, error) {
|
|
return s.i, nil
|
|
}
|
|
|
|
func (s storageWrapper) InitWriter([]ServerInfo) (Writer, error) {
|
|
return s.w, nil
|
|
}
|
|
|
|
func SimpleIteratorProvider(i Iterator) IteratorProvider {
|
|
return &storageWrapper{
|
|
i: i,
|
|
}
|
|
}
|
|
|
|
func SimpleWriterProvider(w Writer) WriterProvider {
|
|
return &storageWrapper{
|
|
w: w,
|
|
}
|
|
}
|