-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-24560][CORE][MESOS] Fix some getTimeAsMs as getTimeAsSeconds #21567
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
10bf41e
3f59a05
a8dc241
a69df11
0dd57ea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,7 @@ import java.net.URI | |
| import java.nio.charset.StandardCharsets | ||
|
|
||
| import scala.collection.JavaConverters._ | ||
| import scala.concurrent.duration._ | ||
|
|
||
| import com.google.common.io.Files | ||
|
|
||
|
|
@@ -58,7 +59,7 @@ private[deploy] class DriverRunner( | |
|
|
||
| // Timeout to wait for when trying to terminate a driver. | ||
| private val DRIVER_TERMINATE_TIMEOUT_MS = | ||
| conf.getTimeAsMs("spark.worker.driverTerminateTimeout", "10s") | ||
| conf.getTimeAsSeconds("spark.worker.driverTerminateTimeout", "10s").seconds.toMillis | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto |
||
|
|
||
| // Decoupled for testing | ||
| def setClock(_clock: Clock): Unit = { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,6 +28,7 @@ import javax.annotation.concurrent.GuardedBy | |
|
|
||
| import scala.collection.JavaConverters._ | ||
| import scala.collection.mutable.{ArrayBuffer, HashMap, Map} | ||
| import scala.concurrent.duration._ | ||
| import scala.util.control.NonFatal | ||
|
|
||
| import com.google.common.util.concurrent.ThreadFactoryBuilder | ||
|
|
@@ -613,7 +614,7 @@ private[spark] class Executor( | |
| private[this] val taskId: Long = taskRunner.taskId | ||
|
|
||
| private[this] val killPollingIntervalMs: Long = | ||
| conf.getTimeAsMs("spark.task.reaper.pollingInterval", "10s") | ||
| conf.getTimeAsSeconds("spark.task.reaper.pollingInterval", "10s").seconds.toMillis | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually I believe this is change things from right to wrong. If you want to use a second value then you shall use sth like |
||
|
|
||
| private[this] val killTimeoutMs: Long = conf.getTimeAsMs("spark.task.reaper.killTimeout", "-1") | ||
|
|
||
|
|
@@ -820,7 +821,8 @@ private[spark] class Executor( | |
| * Schedules a task to report heartbeat and partial metrics for active tasks to driver. | ||
| */ | ||
| private def startDriverHeartbeater(): Unit = { | ||
| val intervalMs = conf.getTimeAsMs("spark.executor.heartbeatInterval", "10s") | ||
| val intervalMs = conf.getTimeAsSeconds("spark.executor.heartbeatInterval", | ||
| "10s").seconds.toMillis | ||
|
|
||
| // Wait a random interval so the heartbeats don't end up in sync | ||
| val initialDelay = intervalMs + (math.random * intervalMs).asInstanceOf[Int] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,7 +34,7 @@ private[spark] class ConsoleProgressBar(sc: SparkContext) extends Logging { | |
| private val CR = '\r' | ||
| // Update period of progress bar, in milliseconds | ||
| private val updatePeriodMSec = | ||
| sc.getConf.getTimeAsMs("spark.ui.consoleProgress.update.interval", "200") | ||
| sc.getConf.getTimeAsMs("spark.ui.consoleProgress.update.interval", "200ms") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We shall document this config. |
||
| // Delay to show up a progress bar, in milliseconds | ||
| private val firstDelayMSec = 500L | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The conf is not documented, but I think it's designed to accept values like 1.5s
cc @zsxwing