forked from opensci/piflow
remove yarn.url configure item
This commit is contained in:
parent
c0991b3cda
commit
b245a7f6b4
|
@ -70,8 +70,21 @@ object ConfigureUtil {
|
|||
piflowBundlePath
|
||||
}
|
||||
|
||||
def getYarnResourceManagerWebAppAddress() : String = {
|
||||
var yarnResourceManagerWebAppAddress = PropertyUtil.getPropertyValue("yarn.url")
|
||||
if(yarnResourceManagerWebAppAddress == null){
|
||||
var port = "8088"
|
||||
val yarnHostName = PropertyUtil.getPropertyValue("yarn.resourcemanager.hostname")
|
||||
if(PropertyUtil.getPropertyValue("yarn.resourcemanager.webapp.address.port") != null){
|
||||
port = PropertyUtil.getPropertyValue("yarn.resourcemanager.webapp.address.port")
|
||||
}
|
||||
yarnResourceManagerWebAppAddress = "http://" + yarnHostName + ":" + port + "/ws/v1/cluster/apps/"
|
||||
}
|
||||
yarnResourceManagerWebAppAddress
|
||||
}
|
||||
|
||||
def main(args: Array[String]): Unit = {
|
||||
val piflowBundlePath = getPiFlowBundlePath()
|
||||
val temp = getYarnResourceManagerWebAppAddress()
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -71,7 +71,7 @@ object FlowLauncher {
|
|||
|
||||
println("Stop Flow !!!!!!!!!!!!!!!!!!!!!!!!!!")
|
||||
//yarn application kill appId
|
||||
val url = PropertyUtil.getPropertyValue("yarn.url") + appID + "/state"
|
||||
val url = ConfigureUtil.getYarnResourceManagerWebAppAddress() + appID + "/state"
|
||||
val client = HttpClients.createDefault()
|
||||
val put:HttpPut = new HttpPut(url)
|
||||
val body ="{\"state\":\"KILLED\"}"
|
||||
|
|
|
@ -202,7 +202,7 @@ object API {
|
|||
|
||||
def stopFlowOnYarn(appID : String) : String = {
|
||||
//yarn application kill appId
|
||||
val url = PropertyUtil.getPropertyValue("yarn.url") + appID + "/state"
|
||||
val url = ConfigureUtil.getYarnResourceManagerWebAppAddress() + appID + "/state"
|
||||
val client = HttpClients.createDefault()
|
||||
val put:HttpPut = new HttpPut(url)
|
||||
val body ="{\"state\":\"KILLED\"}"
|
||||
|
@ -224,7 +224,7 @@ object API {
|
|||
}
|
||||
def getFlowLog(appID : String) : String = {
|
||||
|
||||
val url = PropertyUtil.getPropertyValue("yarn.url") + appID
|
||||
val url = ConfigureUtil.getYarnResourceManagerWebAppAddress() + appID
|
||||
val client = HttpClients.createDefault()
|
||||
val get:HttpGet = new HttpGet(url)
|
||||
|
||||
|
|
Loading…
Reference in New Issue