Skip to content

Commit 4bc1f21

Browse files
committed
Add supplementary comments
1 parent 3965e86 commit 4bc1f21

File tree

3 files changed

+38
-3
lines changed

3 files changed

+38
-3
lines changed

common/scala/src/main/scala/org/apache/openwhisk/core/connector/Message.scala

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,23 @@ object EventMessage extends DefaultJsonProtocol {
427427
def parse(msg: String) = Try(format.read(msg.parseJson))
428428
}
429429

430+
/**
431+
* This case class is used when retrieving the snapshot of the queue status from the scheduler at a certain moment.
432+
* This is useful to figure out the internal status when any issue happens.
433+
* The following would be an example result.
434+
*
435+
* [
436+
* ...
437+
* {
438+
* "data": "RunningData",
439+
* "fqn": "whisk.system/elasticsearch/[email protected]",
440+
* "invocationNamespace": "style95",
441+
* "status": "Running",
442+
* "waitingActivation": 1
443+
* },
444+
* ...
445+
* ]
446+
*/
430447
object StatusQuery
431448
case class StatusData(invocationNamespace: String, fqn: String, waitingActivation: Int, status: String, data: String)
432449
extends Message {

core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/Scheduler.scala

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class Scheduler(schedulerId: SchedulerInstanceId, schedulerEndpoints: SchedulerE
9393
}
9494

9595
// other components don't need to shutdown gracefully
96-
override def shutdown(): Unit = {
96+
override def disable(): Unit = {
9797
logging.info(this, s"Gracefully shutting down the scheduler")
9898
// TODO: TBD, gracefully shut down the container manager and queue manager
9999
}
@@ -116,12 +116,24 @@ class Scheduler(schedulerId: SchedulerInstanceId, schedulerEndpoints: SchedulerE
116116

117117
private val etcdWorkerFactory = "" // TODO: TBD
118118

119+
/**
120+
* This component is in charge of storing data to ETCD.
121+
* Even if any error happens we can assume the data will be eventually available in the ETCD by this component.
122+
*/
119123
val dataManagementService = "" // TODO: TBD
120124

121125
val creationJobManagerFactory = "" // TODO: TBD
122126

127+
/**
128+
* This component is responsible for creating containers for a given action.
129+
* It relies on the creationJobManager to manage the container creation job.
130+
*/
123131
val containerManager = "" // TODO: TBD
124132

133+
/**
134+
* This is a factory to create memory queues.
135+
* In the new architecture, each action is given its own dedicated queue.
136+
*/
125137
val memoryQueueFactory = "" // TODO: TBD
126138

127139
val schedulerConsumer = msgProvider.getConsumer(
@@ -133,6 +145,9 @@ class Scheduler(schedulerId: SchedulerInstanceId, schedulerEndpoints: SchedulerE
133145

134146
implicit val trasnid = TransactionId.containerCreation
135147

148+
/**
149+
* This is one of the major components which take charge of managing queues and coordinating requests among the scheduler, controllers, and invokers.
150+
*/
136151
val queueManager = "" // TODO: TBD
137152

138153
//val serviceHandlers: HttpRequest => Future[HttpResponse] = ActivationServiceHandler.apply(ActivationServiceImpl()) TODO: TBD
@@ -147,13 +162,16 @@ trait SchedulerCore {
147162

148163
def getQueueStatusData: Future[List[String]] // TODO: Change to the real data class other than just string
149164

150-
def shutdown(): Unit
165+
def disable(): Unit
151166
}
152167

153168
object Scheduler {
154169

155170
protected val protocol = loadConfigOrThrow[String]("whisk.scheduler.protocol")
156171

172+
/**
173+
* The scheduler has two ports, one for akka-remote and the other for akka-grpc.
174+
*/
157175
def requiredProperties =
158176
Map(
159177
servicePort -> 8080.toString,

core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/SchedulerServer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class SchedulerServer(scheduler: SchedulerCore, systemUsername: String, systemPa
4343
case Some(BasicHttpCredentials(username, password)) if username == systemUsername && password == systemPassword =>
4444
(path("disable") & post) {
4545
logger.warn(this, "Scheduler is disabled")
46-
scheduler.shutdown()
46+
scheduler.disable()
4747
complete("scheduler disabled")
4848
}
4949
case _ =>

0 commit comments

Comments
 (0)