allocator

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: 12 Imported by: 0

Documentation

Overview

Package allocator aims to manage allocation of different cluster-wide resources on behalf of the manager. In particular, it manages a set of independent allocator processes which can mostly execute concurrently with only a minimal need for coordination.

One of the instances where it needs coordination is when to move a task to ALLOCATED state. Since a task can move to ALLOCATED state only when all task allocators have completed their service of allocation, they all have to agree on that. The way this achieved in `allocator` is by creating a `taskBallot` to which all task allocators register themselves as mandatory voters. For each task that needs allocation, each allocator indepdently votes to indicate the completion of their allocation. Once all registered voters have voted then the task is moved to ALLOCATED state.

Other than the coordination needed for task ALLOCATED state, all the allocators function fairly indepdently.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Allocator

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

Allocator controls how the allocation stage in the manager is handled.

func New

func New(store *store.MemoryStore) (*Allocator, error)

New returns a new instance of Allocator for use during allocation stage of the manager.

func (*Allocator) Run

func (a *Allocator) Run(ctx context.Context) error

Run starts all allocator go-routines and waits for Stop to be called.

func (*Allocator) Stop

func (a *Allocator) Stop()

Stop stops the allocator

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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