rpc

package
v0.1.0-alpha-target-23... Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2015 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const RPC_RETRIES = 5
View Source
const RPC_TIMEOUT = time.Second * 5

Variables

This section is empty.

Functions

func ClearZKState

func ClearZKState(
	zkServers []string,
	zkChroot string,
	frameworkName string,
) error

func ConfigureInstance

func ConfigureInstance(
	running map[string]*config.Node,
	newInstance *config.Node,
) error

func FixInstancePeers

func FixInstancePeers(
	node *config.Node,
) error

func GetMasterFromZK

func GetMasterFromZK(zkURI string) (string, error)

func GetPeersFromState

func GetPeersFromState(state *MasterState, frameworkName string) ([]string, error)

func GetPreviousFrameworkID

func GetPreviousFrameworkID(
	zkServers []string,
	zkChroot string,
	frameworkName string,
) (fwid string, err error)

func GetPreviousReconciliationInfo

func GetPreviousReconciliationInfo(
	zkServers []string,
	zkChroot string,
	frameworkName string,
) (recon map[string]string, err error)

func HealthCheck

func HealthCheck(running map[string]*config.Node) error

HealthCheck performs basic sanity checks on an etcd cluster. This function explicitly forgoes backoffs. If it fails something, it is assumed to be unhealthy.

func MemberList

func MemberList(
	running map[string]*config.Node,
) (nameToIdent map[string]string, err error)

func ParseZKURI

func ParseZKURI(zkURI string) (servers []string, chroot string, err error)

func PersistFrameworkID

func PersistFrameworkID(
	fwid *mesos.FrameworkID,
	zkServers []string,
	zkChroot string,
	frameworkName string,
) error

func RankReseedCandidates

func RankReseedCandidates(running map[string]*config.Node) []nodeIndex

func RemoveInstance

func RemoveInstance(running map[string]*config.Node, task string) error

func TriggerReseed

func TriggerReseed(node *config.Node) error

func UpdateReconciliationInfo

func UpdateReconciliationInfo(
	reconciliationInfo map[string]string,
	zkServers []string,
	zkChroot string,
	frameworkName string,
) error

Types

type Framework

type Framework struct {
	ID    string `json:"id"`
	Name  string `json:"name"`
	Tasks []Task `json:"tasks"`
}

type MasterState

type MasterState struct {
	Frameworks []Framework `json:"frameworks"`
}

This is only a partial section of the returned JSON. In the future we may need to add more fields if they have a reason to be queried. Hitting state.json is an antipattern, but we only do it during framework initialization.

func GetState

func GetState(master string) (*MasterState, error)

type Task

type Task struct {
	ExecutorID  string `json:"executor_id"`
	FrameworkID string `json:"framework_id"`
	ID          string `json:"id"`
	Name        string `json:"name"`
	Resources   struct {
		Cpus  float64 `json:"cpus"`
		Disk  float64 `json:"disk"`
		Mem   float64 `json:"mem"`
		Ports string  `json:"ports"`
	} `json:"resources"`
	SlaveID  string `json:"slave_id"`
	State    string `json:"state"`
	Statuses []struct {
		State     string  `json:"state"`
		Timestamp float64 `json:"timestamp"`
	} `json:"statuses"`
}

Jump to

Keyboard shortcuts

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