From 2eebc3a8e97af7bd9af18b7f6b9979d7566af452 Mon Sep 17 00:00:00 2001 From: Yu-Lin Chen Date: Thu, 26 Oct 2023 09:58:39 -0500 Subject: [PATCH] [YUNIKORN-2077] Cleanup scheduler event interface in shim (#704) Closes: #704 Signed-off-by: Craig Condit --- pkg/cmd/shim/main.go | 2 +- pkg/common/events/events.go | 12 ------------ pkg/dispatcher/dispatcher.go | 3 --- 3 files changed, 1 insertion(+), 16 deletions(-) diff --git a/pkg/cmd/shim/main.go b/pkg/cmd/shim/main.go index cc6785df6..5d31e6a8f 100644 --- a/pkg/cmd/shim/main.go +++ b/pkg/cmd/shim/main.go @@ -52,7 +52,7 @@ func main() { if serviceContext.RMProxy != nil { ss := shim.NewShimScheduler(serviceContext.RMProxy, conf.GetSchedulerConf(), configMaps) if err := ss.Run(); err != nil { - log.Log(log.Shim).Fatal("Unable tto start scheduler", zap.Error(err)) + log.Log(log.Shim).Fatal("Unable to start scheduler", zap.Error(err)) } signalChan := make(chan os.Signal, 1) diff --git a/pkg/common/events/events.go b/pkg/common/events/events.go index b3f708191..395f66262 100644 --- a/pkg/common/events/events.go +++ b/pkg/common/events/events.go @@ -64,18 +64,6 @@ type TaskEvent interface { GetArgs() []interface{} } -// -------------------------------------- -// scheduler events -// -------------------------------------- -type SchedulerEvent interface { - // the type of this event - GetEvent() string - - // an event can have multiple arguments, these arguments will be passed to - // state machines' callbacks when doing state transition - GetArgs() []interface{} -} - // -------------------------------------- // scheduler node events // -------------------------------------- diff --git a/pkg/dispatcher/dispatcher.go b/pkg/dispatcher/dispatcher.go index 65d88efb3..719c5ccb5 100644 --- a/pkg/dispatcher/dispatcher.go +++ b/pkg/dispatcher/dispatcher.go @@ -40,7 +40,6 @@ const ( EventTypeApp EventType = iota EventTypeTask EventTypeNode - EventTypeScheduler ) var ( @@ -194,8 +193,6 @@ func Start() { getEventHandler(EventTypeApp)(v) case events.SchedulerNodeEvent: getEventHandler(EventTypeNode)(v) - case events.SchedulerEvent: - getEventHandler(EventTypeScheduler)(v) default: log.Log(log.ShimDispatcher).Fatal("unsupported event", zap.Any("event", v))