-
Notifications
You must be signed in to change notification settings - Fork 21
/
resmgr.go
61 lines (55 loc) · 1.46 KB
/
resmgr.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package core
import ()
type ClientMgr interface {
RegisterNewClient(FormFiles) (*Client, error)
ClientHeartBeat(string) (HBmsg, error)
GetClient(string) (*Client, error)
GetAllClients() []*Client
DeleteClient(string) (err error)
SuspendClient(string) (err error)
ResumeClient(string) (err error)
ResumeSuspendedClients() (count int)
SuspendAllClients() (count int)
ClientChecker()
UpdateSubClients(id string, count int)
}
type WorkMgr interface {
GetWorkById(string) (*Workunit, error)
ShowWorkunits(string) []*Workunit
CheckoutWorkunits(string, string, int) ([]*Workunit, error)
NotifyWorkStatus(Notice)
EnqueueWorkunit(*Workunit) error
FetchDataToken(string, string) (string, error)
}
type JobMgr interface {
JobRegister() (string, error)
EnqueueTasksByJobId(string, []*Task) error
GetActiveJobs() map[string]*JobPerf
IsJobRegistered(string) bool
GetSuspendJobs() map[string]bool
SuspendJob(string, string) error
ResumeSuspendedJob(string) error
ResumeSuspendedJobs() int
ResubmitJob(string) error
DeleteJob(string) error
DeleteSuspendedJobs() int
DeleteZombieJobs() int
InitMaxJid() error
RecoverJobs() error
FinalizeWorkPerf(string, string) error
SaveStdLog(string, string, string) error
GetReportMsg(string, string) (string, error)
RecomputeJob(string, string) error
UpdateGroup(string, string) error
}
type ClientWorkMgr interface {
ClientMgr
WorkMgr
}
type ResourceMgr interface {
ClientWorkMgr
JobMgr
Handle()
ShowStatus() string
Timer()
}