github.com/wallyworld/juju@v0.0.0-20161013125918-6cf1bc9d917a/instance/distribution.go (about)

     1  // Copyright 2016 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package instance
     5  
     6  // Distributor is an interface that may be used to distribute
     7  // application units across instances for high availability.
     8  type Distributor interface {
     9  	// DistributeInstance takes a set of clean, empty
    10  	// instances, and a distribution group, and returns
    11  	// the subset of candidates which the policy will
    12  	// allow entry into the distribution group.
    13  	//
    14  	// The AssignClean and AssignCleanEmpty unit
    15  	// assignment policies will attempt to assign a
    16  	// unit to each of the resulting instances until
    17  	// one is successful. If no instances can be assigned
    18  	// to (e.g. because of concurrent deployments), then
    19  	// a new machine will be allocated.
    20  	DistributeInstances(candidates, distributionGroup []Id) ([]Id, error)
    21  }