[CELEBORN-407] Add conf setting to http request (#1337)
* [CELEBORN-407] Add conf setting to http request
This commit is contained in:
parent
cd5241d399
commit
364acbc66a
@ -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
|
||||
|
||||
@ -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 =>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user