2021-01-29 00:03:30 +00:00
|
|
|
package loadroute
|
|
|
|
|
|
|
|
import (
|
2023-03-07 13:38:26 +00:00
|
|
|
loadcontroller "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/container/announcement/load/controller"
|
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container"
|
2021-01-29 00:03:30 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// Builder groups methods to route values in the network.
|
|
|
|
type Builder interface {
|
|
|
|
// NextStage must return next group of route points for the value a
|
|
|
|
// based on the passed route.
|
|
|
|
//
|
|
|
|
// Empty passed list means being at the starting point of the route.
|
|
|
|
//
|
|
|
|
// Must return empty list and no error if the endpoint of the route is reached.
|
2021-12-09 19:41:41 +00:00
|
|
|
// If there are more than one point to go and the last passed point is included
|
|
|
|
// in that list (means that point is the last point in one of the route groups),
|
|
|
|
// returned route must contain nil point that should be interpreted as signal to,
|
|
|
|
// among sending to other route points, save the announcement in that point.
|
2023-04-05 11:52:13 +00:00
|
|
|
NextStage(a container.SizeEstimation, passed []loadcontroller.ServerInfo) ([]loadcontroller.ServerInfo, error)
|
2021-01-29 00:03:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// RemoteWriterProvider describes the component
|
|
|
|
// for sending values to a fixed route point.
|
|
|
|
type RemoteWriterProvider interface {
|
|
|
|
// InitRemote must return WriterProvider to the route point
|
|
|
|
// corresponding to info.
|
|
|
|
//
|
|
|
|
// Nil info matches the end of the route.
|
2023-04-05 11:52:13 +00:00
|
|
|
InitRemote(info loadcontroller.ServerInfo) (loadcontroller.WriterProvider, error)
|
2021-01-29 00:03:30 +00:00
|
|
|
}
|