master

package
v0.0.0-...-3cc9250 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2017 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package master collects data from agents, and manage named network channels.

Package master collects data from agents, and manage named network channels.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunMaster

func RunMaster(listenOn string)

Types

type AgentInformation

type AgentInformation struct {
	Location      pb.Location
	LastHeartBeat time.Time
	Resource      pb.ComputeResource
	Allocated     pb.ComputeResource
}

type DataCenter

type DataCenter struct {
	sync.RWMutex
	Name      string
	Racks     map[string]*Rack
	Resource  pb.ComputeResource
	Allocated pb.ComputeResource
}

func NewDataCenter

func NewDataCenter(name string) *DataCenter

func (*DataCenter) AddRack

func (dc *DataCenter) AddRack(rack *Rack)

func (*DataCenter) GetRack

func (dc *DataCenter) GetRack(name string) (*Rack, bool)

func (*DataCenter) GetRacks

func (dc *DataCenter) GetRacks() map[string]*Rack

type MasterServer

type MasterServer struct {
	Topology *Topology
}

func (*MasterServer) GetResources

func (s *MasterServer) GetResources(ctx context.Context, in *pb.ComputeRequest) (*pb.AllocationResult, error)

func (*MasterServer) SendFlowExecutionStatus

func (s *MasterServer) SendFlowExecutionStatus(stream pb.GleamMaster_SendFlowExecutionStatusServer) error

func (*MasterServer) SendHeartbeat

func (s *MasterServer) SendHeartbeat(stream pb.GleamMaster_SendHeartbeatServer) error

type Rack

type Rack struct {
	sync.RWMutex
	Name      string
	Agents    map[string]*AgentInformation
	Resource  pb.ComputeResource
	Allocated pb.ComputeResource
}

func NewRack

func NewRack(name string) *Rack

func (*Rack) AddAgent

func (rack *Rack) AddAgent(a *AgentInformation)

func (*Rack) DropAgent

func (rack *Rack) DropAgent(location *pb.Location)

func (*Rack) GetAgent

func (rack *Rack) GetAgent(name string) (*AgentInformation, bool)

func (*Rack) GetAgents

func (rack *Rack) GetAgents() map[string]*AgentInformation

type Topology

type Topology struct {
	Resource  pb.ComputeResource
	Allocated pb.ComputeResource
	sync.RWMutex
	DataCenters map[string]*DataCenter
}

func NewTopology

func NewTopology() *Topology

func (*Topology) AddDataCenter

func (tp *Topology) AddDataCenter(dc *DataCenter)

func (*Topology) GetDataCenter

func (tp *Topology) GetDataCenter(name string) (*DataCenter, bool)

func (*Topology) GetDataCenters

func (tp *Topology) GetDataCenters() map[string]*DataCenter

func (*Topology) UpdateAgentInformation

func (l *Topology) UpdateAgentInformation(ai *pb.Heartbeat)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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