[jvm-packages] fix numAliveCores in SparkParallelismTracker when WebUI is disabled (#2990)
* add back train method but mark as deprecated * add back train method but mark as deprecated * fix scalastyle error * fix scalastyle error * update resource files * Update SparkParallelismTracker.scala * remove xgboost-tracker.properties
This commit is contained in:
parent
9004ca03ca
commit
005a4a5e47
@ -49,7 +49,11 @@ class SparkParallelismTracker(
|
|||||||
|
|
||||||
private[this] def numAliveCores: Int = {
|
private[this] def numAliveCores: Int = {
|
||||||
try {
|
try {
|
||||||
|
if (url != null) {
|
||||||
mapper.readTree(url).findValues("totalCores").asScala.map(_.asInt).sum
|
mapper.readTree(url).findValues("totalCores").asScala.map(_.asInt).sum
|
||||||
|
} else {
|
||||||
|
Int.MaxValue
|
||||||
|
}
|
||||||
} catch {
|
} catch {
|
||||||
case ex: Throwable =>
|
case ex: Throwable =>
|
||||||
logger.warn(s"Unable to read total number of alive cores from REST API." +
|
logger.warn(s"Unable to read total number of alive cores from REST API." +
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user