feat: add rest routes to take the control of flink jobs
This commit is contained in:
@@ -20,10 +20,16 @@ type Manager struct {
|
||||
processingJobsIds []types.UID
|
||||
}
|
||||
|
||||
var mgr Manager
|
||||
|
||||
func GetManager() Manager {
|
||||
return mgr
|
||||
}
|
||||
|
||||
func NewManager(client *api.Client, crdInstance *crd.Crd) Manager {
|
||||
ticker := time.NewTicker(5 * time.Second)
|
||||
quit := make(chan struct{})
|
||||
mgr := Manager{
|
||||
mgr = Manager{
|
||||
client: client,
|
||||
managedJobs: map[types.UID]managed_job.ManagedJob{},
|
||||
processingJobsIds: []types.UID{},
|
||||
@@ -110,3 +116,11 @@ func (mgr *Manager) cycle(client *api.Client, crdInstance *crd.Crd) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func (mgr *Manager) GetJobs() map[types.UID]managed_job.ManagedJob {
|
||||
return mgr.managedJobs
|
||||
}
|
||||
|
||||
func (mgr *Manager) GetJob(id types.UID) managed_job.ManagedJob {
|
||||
return mgr.managedJobs[id]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user