master

package
v0.0.0-...-e8181bf Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: Apache-2.0 Imports: 23 Imported by: 2

Documentation

Overview

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, logDirectory 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() (ret []*Rack)

type MasterServer

type MasterServer struct {
	Topology *Topology
	// contains filtered or unexported fields
}

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) (err 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() (ret []*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 (tp *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