Documentation ¶
Index ¶
- Constants
- func RunAgent(masterAddress string, address, name string)
- type Agent
- func (self *Agent) DoHeartbeat() error
- func (self *Agent) Duplicate(ctx context.Context, em *pb.Empty) (*pb.Empty, error)
- func (self *Agent) GetInfo() *pb.AgentHeartbeat
- func (self *Agent) GetOutputChannelLocation(ctx context.Context, location *pb.Location) (*pb.Location, error)
- func (self *Agent) Heartbeat()
- func (self *Agent) KillExecutor(ename string) error
- func (self *Agent) KillTask(ctx context.Context, pbtask *pb.Task) (*pb.Empty, error)
- func (self *Agent) LanchExecutor(ename string) error
- func (self *Agent) Quit(ctx context.Context, em *pb.Empty) (*pb.Empty, error)
- func (self *Agent) Restart(ctx context.Context, em *pb.Empty) (*pb.Empty, error)
- func (self *Agent) Run(ctx context.Context, pbtask *pb.Task) (*pb.Empty, error)
- func (self *Agent) SendHeartbeat(stream pb.GueryAgent_SendHeartbeatServer) error
- func (self *Agent) SendInstruction(inst *pb.Instruction) error
- func (self *Agent) SendOneHeartbeat(stream pb.GueryMaster_SendHeartbeatClient) error
- func (self *Agent) SendTask(ctx context.Context, task *pb.Task) (*pb.Empty, error)
- type ExecutorInfo
- type Task
- type TaskMap
- func (self *TaskMap) AddTask(task *Task) error
- func (self *TaskMap) DeleteTask(task *Task) error
- func (self *TaskMap) GetTask(id string) *Task
- func (self *TaskMap) GetTaskInfos() []*pb.TaskInfo
- func (self *TaskMap) GetTaskNumber() int32
- func (self *TaskMap) HasTask(id string) bool
- func (self *TaskMap) PopTask(id string) *Task
- func (self *TaskMap) UpdateTaskInfo(hb *pb.ExecutorHeartbeat)
- type Topology
- func (self *Topology) DropExecutorInfo(location *pb.Location)
- func (self *Topology) DuplicateExecutor(name string) error
- func (self *Topology) GetExecutor(name string) *ExecutorInfo
- func (self *Topology) GetExecutorNumber() (busyNumber, number int32)
- func (self *Topology) GetExecutorStatus(name string) pb.TaskStatus
- func (self *Topology) GetExecutors() []pb.Location
- func (self *Topology) HasExecutor(name string) bool
- func (self *Topology) KillAllExecutors() (err error)
- func (self *Topology) KillExecutor(name string) error
- func (self *Topology) RestartExecutor(name string) error
- func (self *Topology) UpdateExecutorInfo(hb *pb.ExecutorHeartbeat)
Constants ¶
View Source
const (
TIMEOUT = 10000 //ms
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Agent ¶
type Agent struct { MasterAddress string Address string Port int32 Name string Topology *Topology StartTime time.Time Tasks *TaskMap IsStatusChanged bool }
func (*Agent) DoHeartbeat ¶
func (*Agent) GetInfo ¶
func (self *Agent) GetInfo() *pb.AgentHeartbeat
func (*Agent) GetOutputChannelLocation ¶
func (*Agent) KillExecutor ¶
func (*Agent) LanchExecutor ¶
func (*Agent) SendHeartbeat ¶
func (self *Agent) SendHeartbeat(stream pb.GueryAgent_SendHeartbeatServer) error
executor heartbeat
func (*Agent) SendInstruction ¶
func (self *Agent) SendInstruction(inst *pb.Instruction) error
func (*Agent) SendOneHeartbeat ¶
func (self *Agent) SendOneHeartbeat(stream pb.GueryMaster_SendHeartbeatClient) error
type ExecutorInfo ¶
type ExecutorInfo struct { Name string Heartbeat pb.ExecutorHeartbeat LastHeartBeatTime time.Time }
func NewExecutorInfo ¶
func NewExecutorInfo(hb *pb.ExecutorHeartbeat) *ExecutorInfo
type Task ¶
type Task struct { TaskId string Instructions []*pb.Instruction Status pb.TaskStatus LogInfos []*pb.LogInfo ExecutorInfos map[string]*pb.ExecutorHeartbeat }
//////////////
type TaskMap ¶
func NewTaskMap ¶
func NewTaskMap() *TaskMap
func (*TaskMap) DeleteTask ¶
func (*TaskMap) GetTaskInfos ¶
func (*TaskMap) GetTaskNumber ¶
func (*TaskMap) UpdateTaskInfo ¶
func (self *TaskMap) UpdateTaskInfo(hb *pb.ExecutorHeartbeat)
type Topology ¶
type Topology struct { sync.RWMutex Executors map[string]*ExecutorInfo }
Topology/////////////////
func NewTopology ¶
func NewTopology() *Topology
func (*Topology) DropExecutorInfo ¶
func (*Topology) DuplicateExecutor ¶
func (*Topology) GetExecutor ¶
func (self *Topology) GetExecutor(name string) *ExecutorInfo
func (*Topology) GetExecutorNumber ¶
func (*Topology) GetExecutorStatus ¶
func (self *Topology) GetExecutorStatus(name string) pb.TaskStatus
func (*Topology) GetExecutors ¶
func (*Topology) HasExecutor ¶
func (*Topology) KillAllExecutors ¶
func (*Topology) KillExecutor ¶
func (*Topology) RestartExecutor ¶
func (*Topology) UpdateExecutorInfo ¶
func (self *Topology) UpdateExecutorInfo(hb *pb.ExecutorHeartbeat)
Click to show internal directories.
Click to hide internal directories.