Documentation ¶
Overview ¶
Package scaling provides the autoscaling capability for MonoVertex objects.
A workqueue is implemented in this package to watch monovertices in the cluster, calculate the desired replica number for each of them periodically, and patch the MonoVertex spec.
Function StartWatching() and StopWatching() are also provided in the package, so that monovertices can be added into and removed from the workqueue.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func KeyOfMonoVertex ¶
func KeyOfMonoVertex(monoVtx dfv1.MonoVertex) string
KeyOfMonoVertex returns the unique key of a MonoVertex
Types ¶
type Option ¶
type Option func(*options)
func WithClientsCacheSize ¶
WithClientsCacheSize sets the size of the daemon clients cache.
func WithTaskInterval ¶
WithTaskInterval sets the interval of picking up a task from the work queue.
func WithWorkers ¶
WithWorkers sets the number of workers working on autoscaling.
type Scaler ¶
type Scaler struct {
// contains filtered or unexported fields
}
func (*Scaler) Start ¶
Start function starts the autoscaling worker group. Each worker keeps picking up scaling tasks (which contains mono vertex keys) to calculate the desired replicas, and patch the mono vertex spec with the new replica number if needed.
func (*Scaler) StartWatching ¶
StartWatching put a key (namespace/name) into the Scaler
func (*Scaler) StopWatching ¶
StopWatching stops autoscaling on the key (namespace/name)