[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:
Nan Zhu 2017-12-29 19:22:58 -08:00 committed by GitHub
parent 9004ca03ca
commit 005a4a5e47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -49,7 +49,11 @@ class SparkParallelismTracker(
private[this] def numAliveCores: Int = {
try {
if (url != null) {
mapper.readTree(url).findValues("totalCores").asScala.map(_.asInt).sum
} else {
Int.MaxValue
}
} catch {
case ex: Throwable =>
logger.warn(s"Unable to read total number of alive cores from REST API." +