Documentation
¶
Index ¶
- type Options
- type Pool
- func (p *Pool) AddConnection(req *schedulerv1pb.WatchJobsRequestInitial, ...) context.Context
- func (p *Pool) HasSchedulerPlacementCapableSidecars() bool
- func (p *Pool) HasSchedulerPlacementIncapableSidecars() bool
- func (p *Pool) PlacementAddresses() []string
- func (p *Pool) Run(ctx context.Context) error
- func (p *Pool) SetSchedulerInfo(count, idx int32)
- func (p *Pool) Trigger(job *internalsv1pb.JobEvent, fn func(api.TriggerResponseResult))
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶ added in v1.16.0
type Options struct {
Cron api.Interface
// OnSchedulerPlacementCapabilityChange is called when the number of capable or
// incapable connected sidecars transitions between zero and non-zero.
// Consumers re-read the counts when handling.
OnSchedulerPlacementCapabilityChange func()
// OnPlacementAddressesChange is called when the set of placement
// addresses reported by connected sidecars gains or loses an address.
// added is true when an address not tracked before appeared, false when
// the last sidecar reporting an address went away.
OnPlacementAddressesChange func(added bool)
// PlacementEnabled gates the incapable sidecars: on a scheduler
// not serving placement every sidecar counts as incapable
PlacementEnabled bool
}
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool represents a connection pool for namespace/appID separation of sidecars to schedulers.
func (*Pool) AddConnection ¶ added in v1.16.0
func (p *Pool) AddConnection(req *schedulerv1pb.WatchJobsRequestInitial, stream schedulerv1pb.Scheduler_WatchJobsServer) context.Context
AddConnection adds a new connection to the pool. It returns a context and an error.
func (*Pool) HasSchedulerPlacementCapableSidecars ¶ added in v1.19.0
HasSchedulerPlacementCapableSidecars reports whether any connected sidecar supports scheduler placement.
func (*Pool) HasSchedulerPlacementIncapableSidecars ¶ added in v1.19.0
HasSchedulerPlacementIncapableSidecars reports whether any connected sidecar does not support scheduler placement.
func (*Pool) PlacementAddresses ¶ added in v1.19.0
PlacementAddresses returns the placement addresses reported by the connected sidecars.
func (*Pool) SetSchedulerInfo ¶ added in v1.18.0
SetSchedulerInfo publishes the scheduler cluster size and this scheduler's index into the pool. The update fans out through the namespaces loop to every connection loop so concurrency gate shares stay in sync with membership changes.
func (*Pool) Trigger ¶ added in v1.16.0
func (p *Pool) Trigger(job *internalsv1pb.JobEvent, fn func(api.TriggerResponseResult))
Trigger triggers a job event to the pool. It returns a response result.