diff options
author | Sean Owen <sowen@cloudera.com> | 2016-11-02 09:39:15 +0000 |
---|---|---|
committer | Sean Owen <sowen@cloudera.com> | 2016-11-02 09:39:15 +0000 |
commit | 9c8deef64efee20a0ddc9b612f90e77c80aede60 (patch) | |
tree | feb6a7eeb4e10f628ff1227787c1ee430cb6195b /mesos/src | |
parent | 70a5db7bbd192a4bc68bcfdc475ab221adf2fcdd (diff) | |
download | spark-9c8deef64efee20a0ddc9b612f90e77c80aede60.tar.gz spark-9c8deef64efee20a0ddc9b612f90e77c80aede60.tar.bz2 spark-9c8deef64efee20a0ddc9b612f90e77c80aede60.zip |
[SPARK-18076][CORE][SQL] Fix default Locale used in DateFormat, NumberFormat to Locale.US
## What changes were proposed in this pull request?
Fix `Locale.US` for all usages of `DateFormat`, `NumberFormat`
## How was this patch tested?
Existing tests.
Author: Sean Owen <sowen@cloudera.com>
Closes #15610 from srowen/SPARK-18076.
Diffstat (limited to 'mesos/src')
-rw-r--r-- | mesos/src/main/scala/org/apache/spark/deploy/rest/mesos/MesosRestServer.scala | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/mesos/src/main/scala/org/apache/spark/deploy/rest/mesos/MesosRestServer.scala b/mesos/src/main/scala/org/apache/spark/deploy/rest/mesos/MesosRestServer.scala index 3b96488a12..ff60b88c6d 100644 --- a/mesos/src/main/scala/org/apache/spark/deploy/rest/mesos/MesosRestServer.scala +++ b/mesos/src/main/scala/org/apache/spark/deploy/rest/mesos/MesosRestServer.scala @@ -19,7 +19,7 @@ package org.apache.spark.deploy.rest.mesos import java.io.File import java.text.SimpleDateFormat -import java.util.Date +import java.util.{Date, Locale} import java.util.concurrent.atomic.AtomicLong import javax.servlet.http.HttpServletResponse @@ -62,11 +62,10 @@ private[mesos] class MesosSubmitRequestServlet( private val DEFAULT_CORES = 1.0 private val nextDriverNumber = new AtomicLong(0) - private def createDateFormat = new SimpleDateFormat("yyyyMMddHHmmss") // For application IDs - private def newDriverId(submitDate: Date): String = { - "driver-%s-%04d".format( - createDateFormat.format(submitDate), nextDriverNumber.incrementAndGet()) - } + // For application IDs + private def createDateFormat = new SimpleDateFormat("yyyyMMddHHmmss", Locale.US) + private def newDriverId(submitDate: Date): String = + f"driver-${createDateFormat.format(submitDate)}-${nextDriverNumber.incrementAndGet()}%04d" /** * Build a driver description from the fields specified in the submit request. |