replicated

package
v1.12.1-0...-676f45f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 14, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reconciler

type Reconciler struct {
	// contains filtered or unexported fields
}

Reconciler is an object that manages reconciliation of replicated jobs. It is blocking and non-asynchronous, for ease of testing. It implements two interfaces. The first is the Reconciler interface of the Orchestrator package above this one. The second is the taskinit.InitHandler interface.

func NewReconciler

func NewReconciler(store *store.MemoryStore, restart restartSupervisor) *Reconciler

newReconciler creates a new reconciler object

func (*Reconciler) FixTask

func (r *Reconciler) FixTask(_ context.Context, _ *store.Batch, _ *api.Task)

FixTask ostensibly validates that a task is compliant with the rest of the cluster state. However, in the replicated jobs case, the only action we can take with a noncompliant task is to restart it. Because the replicated jobs orchestrator reconciles the whole service at once, any tasks that need to be restarted will be done when we make the reconiliation pass over all services. Therefore, in this instance, FixTask does nothing except implement the FixTask method of the taskinit.InitHandler interface.

func (*Reconciler) IsRelatedService

func (r *Reconciler) IsRelatedService(service *api.Service) bool

IsRelatedService returns true if the task is a replicated job. This method fulfills the taskinit.InitHandler interface. Because it is just a wrapper around a well-tested function call, it has no tests of its own.

func (*Reconciler) ReconcileService

func (r *Reconciler) ReconcileService(id string) error

ReconcileService reconciles the replicated job service with the given ID by checking to see if new replicas should be created. reconcileService returns an error if there is some case prevent it from correctly reconciling the service.

func (*Reconciler) SlotTuple

func (r *Reconciler) SlotTuple(t *api.Task) orchestrator.SlotTuple

SlotTuple returns an orchestrator.SlotTuple object for this task. It implements the taskinit.InitHandler interface

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL