[CELEBORN-407] Add conf setting to http request (#1337)

* [CELEBORN-407] Add conf setting to http request
This commit is contained in:
Angerszhuuuu 2023-03-14 14:47:56 +08:00 committed by GitHub
parent cd5241d399
commit 364acbc66a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View File

@ -25,6 +25,16 @@ abstract class HttpService extends Service with Logging {
private var httpServer: HttpServer = _
def getConf: String = {
val sb = new StringBuilder
val maxKeyLength = conf.getAll.toMap.keys.map(_.length).max
sb.append("==============Configurations==============\n")
conf.getAll.foreach { case (key, value) =>
sb.append(key.padTo(maxKeyLength + 10, " ") + value + "\n")
}
sb.toString()
}
def getWorkerInfo: String
def getLostWorkers: String

View File

@ -62,6 +62,8 @@ class HttpRequestHandler(
def handleRequest(uri: String): String = {
uri match {
case "/conf" =>
service.getConf
case "/workerInfo" =>
service.getWorkerInfo
case "/lostWorkers" if service.serviceName == Service.MASTER =>