orchestrator

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2016 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GlobalOrchestrator

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

GlobalOrchestrator runs a reconciliation loop to create and destroy tasks as necessary for global services.

func NewGlobalOrchestrator

func NewGlobalOrchestrator(store *store.MemoryStore) *GlobalOrchestrator

NewGlobalOrchestrator creates a new GlobalOrchestrator

func (*GlobalOrchestrator) Run

Run contains the GlobalOrchestrator event loop

func (*GlobalOrchestrator) Stop

func (g *GlobalOrchestrator) Stop()

Stop stops the orchestrator.

type ReplicatedOrchestrator

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

A ReplicatedOrchestrator runs a reconciliation loop to create and destroy tasks as necessary for the replicated services.

func NewReplicatedOrchestrator

func NewReplicatedOrchestrator(store *store.MemoryStore) *ReplicatedOrchestrator

NewReplicatedOrchestrator creates a new ReplicatedOrchestrator.

func (*ReplicatedOrchestrator) Run

Run contains the orchestrator event loop. It runs until Stop is called.

func (*ReplicatedOrchestrator) Stop

func (r *ReplicatedOrchestrator) Stop()

Stop stops the orchestrator.

type RestartSupervisor

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

RestartSupervisor initiates and manages restarts. It's responsible for delaying restarts when applicable.

func NewRestartSupervisor

func NewRestartSupervisor(store *store.MemoryStore) *RestartSupervisor

NewRestartSupervisor creates a new RestartSupervisor.

func (*RestartSupervisor) Cancel

func (r *RestartSupervisor) Cancel(taskID string)

Cancel cancels a pending restart.

func (*RestartSupervisor) CancelAll

func (r *RestartSupervisor) CancelAll()

CancelAll aborts all pending restarts and waits for any instances of StartNow that have already triggered to complete.

func (*RestartSupervisor) ClearServiceHistory

func (r *RestartSupervisor) ClearServiceHistory(serviceID string)

ClearServiceHistory forgets restart history related to a given service ID.

func (*RestartSupervisor) DelayStart

func (r *RestartSupervisor) DelayStart(ctx context.Context, _ store.Tx, oldTask *api.Task, newTaskID string, delay time.Duration, waitStop bool) <-chan struct{}

DelayStart starts a timer that moves the task from READY to RUNNING once: - The restart delay has elapsed (if applicable) - The old task that it's replacing has stopped running (or this times out) It must be called during an Update transaction to ensure that it does not miss events. The purpose of the store.Tx argument is to avoid accidental calls outside an Update transaction.

func (*RestartSupervisor) Restart

func (r *RestartSupervisor) Restart(ctx context.Context, tx store.Tx, cluster *api.Cluster, service *api.Service, t api.Task) error

Restart initiates a new task to replace t if appropriate under the service's restart policy.

func (*RestartSupervisor) StartNow

func (r *RestartSupervisor) StartNow(tx store.Tx, taskID string) error

StartNow moves the task into the RUNNING state so it will proceed to start up.

type TaskReaper

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

A TaskReaper deletes old tasks when more than TaskHistoryRetentionLimit tasks exist for the same service/instance or service/nodeid combination.

func NewTaskReaper

func NewTaskReaper(store *store.MemoryStore) *TaskReaper

NewTaskReaper creates a new TaskReaper.

func (*TaskReaper) Run

func (tr *TaskReaper) Run()

Run is the TaskReaper's main loop.

func (*TaskReaper) Stop

func (tr *TaskReaper) Stop()

Stop stops the TaskReaper and waits for the main loop to exit.

type UpdateSupervisor

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

UpdateSupervisor supervises a set of updates. It's responsible for keeping track of updates, shutting them down and replacing them.

func NewUpdateSupervisor

func NewUpdateSupervisor(store *store.MemoryStore, restartSupervisor *RestartSupervisor) *UpdateSupervisor

NewUpdateSupervisor creates a new UpdateSupervisor.

func (*UpdateSupervisor) CancelAll

func (u *UpdateSupervisor) CancelAll()

CancelAll cancels all current updates.

func (*UpdateSupervisor) Update

func (u *UpdateSupervisor) Update(ctx context.Context, cluster *api.Cluster, service *api.Service, tasks []*api.Task)

Update starts an Update of `tasks` belonging to `service` in the background and returns immediately. If an update for that service was already in progress, it will be cancelled before the new one starts.

type Updater

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

Updater updates a set of tasks to a new version.

func NewUpdater

func NewUpdater(store *store.MemoryStore, restartSupervisor *RestartSupervisor, cluster *api.Cluster, newService *api.Service) *Updater

NewUpdater creates a new Updater.

func (*Updater) Cancel

func (u *Updater) Cancel()

Cancel cancels the current update immediately. It blocks until the cancellation is confirmed.

func (*Updater) Run

func (u *Updater) Run(ctx context.Context, tasks []*api.Task)

Run starts the update and returns only once its complete or cancelled.

Jump to

Keyboard shortcuts

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