Documentation
¶
Index ¶
- Variables
- type EventHandler
- type Factory
- type InformerWorker
- type Store
- func (s *Store) CheckAndAdd(rjc *execution.JobConfig, oldCount int64) bool
- func (s *Store) CountActiveJobsForConfig(rjc *execution.JobConfig) int64
- func (s *Store) Delete(rjc *execution.JobConfig)
- func (s *Store) Name() string
- func (s *Store) OnDelete(rj *execution.Job)
- func (s *Store) OnUpdate(oldRj, newRj *execution.Job)
- func (s *Store) Recover(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
var (
PanicOnInvariantViolation bool
)
Functions ¶
This section is empty.
Types ¶
type EventHandler ¶
type Factory ¶
type Factory struct{}
func NewFactory ¶
func NewFactory() *Factory
func (*Factory) New ¶
func (f *Factory) New(ctrlContext controllercontext.Context) (controllermanager.Store, error)
type InformerWorker ¶
type InformerWorker struct { controllercontext.Context // contains filtered or unexported fields }
InformerWorker is used by the store internally to receive updates to the central store.
We only listen to Update and Delete events. This is because any additions are expected to be done explicitly.
It is acceptable for Update and Delete events to be delayed (but not missed).
func NewInformerWorker ¶
func NewInformerWorker(ctrlContext controllercontext.Context, handler EventHandler) *InformerWorker
func (*InformerWorker) HasSynced ¶
func (w *InformerWorker) HasSynced() bool
func (*InformerWorker) OnAdd ¶
func (w *InformerWorker) OnAdd(obj interface{})
func (*InformerWorker) OnDelete ¶
func (w *InformerWorker) OnDelete(obj interface{})
func (*InformerWorker) OnUpdate ¶
func (w *InformerWorker) OnUpdate(oldObj, newObj interface{})
func (*InformerWorker) Start ¶
func (w *InformerWorker) Start(stopCh <-chan struct{})
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is an in-memory store of active Job counts per JobConfig.
This store is expected to be recovered prior to starting the controller, and helps to guard against multiple concurrent jobs for the same JobConfig from being started in an atomic fashion.
func (*Store) CheckAndAdd ¶
CheckAndAdd atomically increments the active count for the given JobConfig.
func (*Store) CountActiveJobsForConfig ¶
CountActiveJobsForConfig returns the count of active Jobs for a JobConfig.