You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "beliefer (via GitHub)" <gi...@apache.org> on 2024/01/05 12:32:42 UTC

[PR] [WIP][CORE] Remove ThreadLocal by replace SimpleDateFormat with DateTimeFormatter [spark]

beliefer opened a new pull request, #44613:
URL: https://github.com/apache/spark/pull/44613

   ### What changes were proposed in this pull request?
   This PR propose to remove `ThreadLocal` by replace `SimpleDateFormat` with `DateTimeFormatter`.
   
   
   ### Why are the changes needed?
   
   
   
   ### Does this PR introduce _any_ user-facing change?
   'No'.
   
   
   ### How was this patch tested?
   GA tests.
   
   
   ### Was this patch authored or co-authored using generative AI tooling?
   'No'.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-46611][CORE] Remove ThreadLocal by replace SimpleDateFormat with DateTimeFormatter [spark]

Posted by "llkj1 (via GitHub)" <gi...@apache.org>.
llkj1 commented on PR #44613:
URL: https://github.com/apache/spark/pull/44613#issuecomment-1879982998

   感谢您与我们联系。(Thank you for contacting us.)
   ------------------------------------------------------------
   
   我们收到了您的请求,并会在一至两个工作日内给您回复。您的案例编号是 102195443373。
   
   想了解更多与开发相关主题的信息,请访问 开发者支持网页 (https://developer.apple.com/support/)。
                     
   Apple Developer Program Support
   
   
   We’ve received your support request and will get back to you in one to two business days. Your case number is 102195443373.
   
   For additional information on development-related topics, visit:
   https://developer.apple.com/support/
   
   Best regards, 
   
   Apple Developer Program Support
              
   
   ------------------------------------------------------------
   Copyright (c) 2024 Apple Inc. All rights reserved.
   
   Contact Us
   https://developer.apple.com/contact/
   
   Developer
   https://developer.apple.com/
   
   My Apple ID
   https://appleid.apple.com
   
   Privacy Policy
   https://www.apple.com/privacy/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-46611][CORE] Remove ThreadLocal by replace SimpleDateFormat with DateTimeFormatter [spark]

Posted by "llkj1 (via GitHub)" <gi...@apache.org>.
llkj1 commented on PR #44613:
URL: https://github.com/apache/spark/pull/44613#issuecomment-1879992467

   感谢您与我们联系。(Thank you for contacting us.)
   ------------------------------------------------------------
   
   我们收到了您的请求,并会在一至两个工作日内给您回复。您的案例编号是 102195468388。
   
   想了解更多与开发相关主题的信息,请访问 开发者支持网页 (https://developer.apple.com/support/)。
                     
   Apple Developer Program Support
   
   
   We’ve received your support request and will get back to you in one to two business days. Your case number is 102195468388.
   
   For additional information on development-related topics, visit:
   https://developer.apple.com/support/
   
   Best regards, 
   
   Apple Developer Program Support
              
   
   ------------------------------------------------------------
   Copyright (c) 2024 Apple Inc. All rights reserved.
   
   Contact Us
   https://developer.apple.com/contact/
   
   Developer
   https://developer.apple.com/
   
   My Apple ID
   https://appleid.apple.com
   
   Privacy Policy
   https://www.apple.com/privacy/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-46611][CORE] Remove ThreadLocal by replace SimpleDateFormat with DateTimeFormatter [spark]

Posted by "llkj1 (via GitHub)" <gi...@apache.org>.
llkj1 commented on PR #44613:
URL: https://github.com/apache/spark/pull/44613#issuecomment-1880019490

   感谢您与我们联系。(Thank you for contacting us.)
   ------------------------------------------------------------
   
   我们收到了您的请求,并会在一至两个工作日内给您回复。您的案例编号是 102195530026。
   
   想了解更多与开发相关主题的信息,请访问 开发者支持网页 (https://developer.apple.com/support/)。
                     
   Apple Developer Program Support
   
   
   We’ve received your support request and will get back to you in one to two business days. Your case number is 102195530026.
   
   For additional information on development-related topics, visit:
   https://developer.apple.com/support/
   
   Best regards, 
   
   Apple Developer Program Support
              
   
   ------------------------------------------------------------
   Copyright (c) 2024 Apple Inc. All rights reserved.
   
   Contact Us
   https://developer.apple.com/contact/
   
   Developer
   https://developer.apple.com/
   
   My Apple ID
   https://appleid.apple.com
   
   Privacy Policy
   https://www.apple.com/privacy/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-46611][CORE] Remove ThreadLocal by replace SimpleDateFormat with DateTimeFormatter [spark]

Posted by "llkj1 (via GitHub)" <gi...@apache.org>.
llkj1 commented on PR #44613:
URL: https://github.com/apache/spark/pull/44613#issuecomment-1879986136

   感谢您与我们联系。(Thank you for contacting us.)
   ------------------------------------------------------------
   
   我们收到了您的请求,并会在一至两个工作日内给您回复。您的案例编号是 102195452405。
   
   想了解更多与开发相关主题的信息,请访问 开发者支持网页 (https://developer.apple.com/support/)。
                     
   Apple Developer Program Support
   
   
   We’ve received your support request and will get back to you in one to two business days. Your case number is 102195452405.
   
   For additional information on development-related topics, visit:
   https://developer.apple.com/support/
   
   Best regards, 
   
   Apple Developer Program Support
              
   
   ------------------------------------------------------------
   Copyright (c) 2024 Apple Inc. All rights reserved.
   
   Contact Us
   https://developer.apple.com/contact/
   
   Developer
   https://developer.apple.com/
   
   My Apple ID
   https://appleid.apple.com
   
   Privacy Policy
   https://www.apple.com/privacy/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-46611][CORE] Remove ThreadLocal by replace SimpleDateFormat with DateTimeFormatter [spark]

Posted by "llkj1 (via GitHub)" <gi...@apache.org>.
llkj1 commented on PR #44613:
URL: https://github.com/apache/spark/pull/44613#issuecomment-1879988857

   感谢您与我们联系。(Thank you for contacting us.)
   ------------------------------------------------------------
   
   我们收到了您的请求,并会在一至两个工作日内给您回复。您的案例编号是 102195458623。
   
   想了解更多与开发相关主题的信息,请访问 开发者支持网页 (https://developer.apple.com/support/)。
                     
   Apple Developer Program Support
   
   
   We’ve received your support request and will get back to you in one to two business days. Your case number is 102195458623.
   
   For additional information on development-related topics, visit:
   https://developer.apple.com/support/
   
   Best regards, 
   
   Apple Developer Program Support
              
   
   ------------------------------------------------------------
   Copyright (c) 2024 Apple Inc. All rights reserved.
   
   Contact Us
   https://developer.apple.com/contact/
   
   Developer
   https://developer.apple.com/
   
   My Apple ID
   https://appleid.apple.com
   
   Privacy Policy
   https://www.apple.com/privacy/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [WIP][CORE] Remove ThreadLocal by replace SimpleDateFormat with DateTimeFormatter [spark]

Posted by "beliefer (via GitHub)" <gi...@apache.org>.
beliefer commented on PR #44613:
URL: https://github.com/apache/spark/pull/44613#issuecomment-1879726725

   
   > There are other usages of `SimpleDateFormat` which are candidates for this pattern.
   
   I will check.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-46611][CORE] Remove ThreadLocal by replace SimpleDateFormat with DateTimeFormatter [spark]

Posted by "MaxGekk (via GitHub)" <gi...@apache.org>.
MaxGekk commented on PR #44613:
URL: https://github.com/apache/spark/pull/44613#issuecomment-1880018422

   I sent info about the spam from @llkj1 to GitHub support.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-46611][CORE] Remove ThreadLocal by replace SimpleDateFormat with DateTimeFormatter [spark]

Posted by "srowen (via GitHub)" <gi...@apache.org>.
srowen commented on PR #44613:
URL: https://github.com/apache/spark/pull/44613#issuecomment-1880020941

   I tried to block the user and have been deleting the spam


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-46611][CORE] Remove ThreadLocal by replace SimpleDateFormat with DateTimeFormatter [spark]

Posted by "llkj1 (via GitHub)" <gi...@apache.org>.
llkj1 commented on PR #44613:
URL: https://github.com/apache/spark/pull/44613#issuecomment-1879990723

   感谢您与我们联系。(Thank you for contacting us.)
   ------------------------------------------------------------
   
   我们收到了您的请求,并会在一至两个工作日内给您回复。您的案例编号是 102195463590。
   
   想了解更多与开发相关主题的信息,请访问 开发者支持网页 (https://developer.apple.com/support/)。
                     
   Apple Developer Program Support
   
   
   We’ve received your support request and will get back to you in one to two business days. Your case number is 102195463590.
   
   For additional information on development-related topics, visit:
   https://developer.apple.com/support/
   
   Best regards, 
   
   Apple Developer Program Support
              
   
   ------------------------------------------------------------
   Copyright (c) 2024 Apple Inc. All rights reserved.
   
   Contact Us
   https://developer.apple.com/contact/
   
   Developer
   https://developer.apple.com/
   
   My Apple ID
   https://appleid.apple.com
   
   Privacy Policy
   https://www.apple.com/privacy/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-46611][CORE] Remove ThreadLocal by replace SimpleDateFormat with DateTimeFormatter [spark]

Posted by "llkj1 (via GitHub)" <gi...@apache.org>.
llkj1 commented on PR #44613:
URL: https://github.com/apache/spark/pull/44613#issuecomment-1879980223

   感谢您与我们联系。(Thank you for contacting us.)
   ------------------------------------------------------------
   
   我们收到了您的请求,并会在一至两个工作日内给您回复。您的案例编号是 102195434855。
   
   想了解更多与开发相关主题的信息,请访问 开发者支持网页 (https://developer.apple.com/support/)。
                     
   Apple Developer Program Support
   
   
   We’ve received your support request and will get back to you in one to two business days. Your case number is 102195434855.
   
   For additional information on development-related topics, visit:
   https://developer.apple.com/support/
   
   Best regards, 
   
   Apple Developer Program Support
              
   
   ------------------------------------------------------------
   Copyright (c) 2024 Apple Inc. All rights reserved.
   
   Contact Us
   https://developer.apple.com/contact/
   
   Developer
   https://developer.apple.com/
   
   My Apple ID
   https://appleid.apple.com
   
   Privacy Policy
   https://www.apple.com/privacy/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-46611][CORE] Remove ThreadLocal by replace SimpleDateFormat with DateTimeFormatter [spark]

Posted by "llkj1 (via GitHub)" <gi...@apache.org>.
llkj1 commented on PR #44613:
URL: https://github.com/apache/spark/pull/44613#issuecomment-1879987119

   感谢您与我们联系。(Thank you for contacting us.)
   ------------------------------------------------------------
   
   我们收到了您的请求,并会在一至两个工作日内给您回复。您的案例编号是 102195454870。
   
   想了解更多与开发相关主题的信息,请访问 开发者支持网页 (https://developer.apple.com/support/)。
                     
   Apple Developer Program Support
   
   
   We’ve received your support request and will get back to you in one to two business days. Your case number is 102195454870.
   
   For additional information on development-related topics, visit:
   https://developer.apple.com/support/
   
   Best regards, 
   
   Apple Developer Program Support
              
   
   ------------------------------------------------------------
   Copyright (c) 2024 Apple Inc. All rights reserved.
   
   Contact Us
   https://developer.apple.com/contact/
   
   Developer
   https://developer.apple.com/
   
   My Apple ID
   https://appleid.apple.com
   
   Privacy Policy
   https://www.apple.com/privacy/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-46611][CORE] Remove ThreadLocal by replace SimpleDateFormat with DateTimeFormatter [spark]

Posted by "llkj1 (via GitHub)" <gi...@apache.org>.
llkj1 commented on PR #44613:
URL: https://github.com/apache/spark/pull/44613#issuecomment-1879991168

   感谢您与我们联系。(Thank you for contacting us.)
   ------------------------------------------------------------
   
   我们收到了您的请求,并会在一至两个工作日内给您回复。您的案例编号是 102195464943。
   
   想了解更多与开发相关主题的信息,请访问 开发者支持网页 (https://developer.apple.com/support/)。
                     
   Apple Developer Program Support
   
   
   We’ve received your support request and will get back to you in one to two business days. Your case number is 102195464943.
   
   For additional information on development-related topics, visit:
   https://developer.apple.com/support/
   
   Best regards, 
   
   Apple Developer Program Support
              
   
   ------------------------------------------------------------
   Copyright (c) 2024 Apple Inc. All rights reserved.
   
   Contact Us
   https://developer.apple.com/contact/
   
   Developer
   https://developer.apple.com/
   
   My Apple ID
   https://appleid.apple.com
   
   Privacy Policy
   https://www.apple.com/privacy/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-46611][CORE] Remove ThreadLocal by replace SimpleDateFormat with DateTimeFormatter [spark]

Posted by "llkj1 (via GitHub)" <gi...@apache.org>.
llkj1 commented on PR #44613:
URL: https://github.com/apache/spark/pull/44613#issuecomment-1879989714

   感谢您与我们联系。(Thank you for contacting us.)
   ------------------------------------------------------------
   
   我们收到了您的请求,并会在一至两个工作日内给您回复。您的案例编号是 102195460870。
   
   想了解更多与开发相关主题的信息,请访问 开发者支持网页 (https://developer.apple.com/support/)。
                     
   Apple Developer Program Support
   
   
   We’ve received your support request and will get back to you in one to two business days. Your case number is 102195460870.
   
   For additional information on development-related topics, visit:
   https://developer.apple.com/support/
   
   Best regards, 
   
   Apple Developer Program Support
              
   
   ------------------------------------------------------------
   Copyright (c) 2024 Apple Inc. All rights reserved.
   
   Contact Us
   https://developer.apple.com/contact/
   
   Developer
   https://developer.apple.com/
   
   My Apple ID
   https://appleid.apple.com
   
   Privacy Policy
   https://www.apple.com/privacy/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [WIP][CORE] Remove ThreadLocal by replace SimpleDateFormat with DateTimeFormatter [spark]

Posted by "mridulm (via GitHub)" <gi...@apache.org>.
mridulm commented on code in PR #44613:
URL: https://github.com/apache/spark/pull/44613#discussion_r1443141156


##########
core/src/main/scala/org/apache/spark/ui/UIUtils.scala:
##########
@@ -42,15 +44,18 @@ private[spark] object UIUtils extends Logging {
   val TABLE_CLASS_STRIPED = TABLE_CLASS_NOT_STRIPED + " table-striped"
   val TABLE_CLASS_STRIPED_SORTABLE = TABLE_CLASS_STRIPED + " sortable"
 
-  // SimpleDateFormat is not thread-safe. Don't expose it to avoid improper use.
-  private val dateFormat = new ThreadLocal[SimpleDateFormat]() {
-    override def initialValue(): SimpleDateFormat =
-      new SimpleDateFormat("yyyy/MM/dd HH:mm:ss", Locale.US)
-  }
+  private val dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss", Locale.US)
 
-  def formatDate(date: Date): String = dateFormat.get.format(date)
+  def formatDate(date: Date): String = {
+    val localDateTime = date.toInstant.atZone(java.time.ZoneId.systemDefault()).toLocalDateTime
+    localDateTime.format(dateTimeFormatter)
+  }
 
-  def formatDate(timestamp: Long): String = dateFormat.get.format(new Date(timestamp))
+  def formatDate(timestamp: Long): String = {
+    val localDateTime =
+      Instant.ofEpochMilli(timestamp).atZone(java.time.ZoneId.systemDefault()).toLocalDateTime
+    localDateTime.format(dateTimeFormatter)
+  }

Review Comment:
   nit: cache `java.time.ZoneId.systemDefault()` as a field.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-46611][CORE] Remove ThreadLocal by replace SimpleDateFormat with DateTimeFormatter [spark]

Posted by "llkj1 (via GitHub)" <gi...@apache.org>.
llkj1 commented on PR #44613:
URL: https://github.com/apache/spark/pull/44613#issuecomment-1879979959

   感谢您与我们联系。(Thank you for contacting us.)
   ------------------------------------------------------------
   
   我们收到了您的请求,并会在一至两个工作日内给您回复。您的案例编号是 102195434035。
   
   想了解更多与开发相关主题的信息,请访问 开发者支持网页 (https://developer.apple.com/support/)。
                     
   Apple Developer Program Support
   
   
   We’ve received your support request and will get back to you in one to two business days. Your case number is 102195434035.
   
   For additional information on development-related topics, visit:
   https://developer.apple.com/support/
   
   Best regards, 
   
   Apple Developer Program Support
              
   
   ------------------------------------------------------------
   Copyright (c) 2024 Apple Inc. All rights reserved.
   
   Contact Us
   https://developer.apple.com/contact/
   
   Developer
   https://developer.apple.com/
   
   My Apple ID
   https://appleid.apple.com
   
   Privacy Policy
   https://www.apple.com/privacy/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-46611][CORE] Remove ThreadLocal by replace SimpleDateFormat with DateTimeFormatter [spark]

Posted by "beliefer (via GitHub)" <gi...@apache.org>.
beliefer commented on PR #44613:
URL: https://github.com/apache/spark/pull/44613#issuecomment-1879979085

   ping @dongjoon-hyun @srowen 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-46611][CORE] Remove ThreadLocal by replace SimpleDateFormat with DateTimeFormatter [spark]

Posted by "llkj1 (via GitHub)" <gi...@apache.org>.
llkj1 commented on PR #44613:
URL: https://github.com/apache/spark/pull/44613#issuecomment-1879981349

   感谢您与我们联系。(Thank you for contacting us.)
   ------------------------------------------------------------
   
   我们收到了您的请求,并会在一至两个工作日内给您回复。您的案例编号是 102195438601。
   
   想了解更多与开发相关主题的信息,请访问 开发者支持网页 (https://developer.apple.com/support/)。
                     
   Apple Developer Program Support
   
   
   We’ve received your support request and will get back to you in one to two business days. Your case number is 102195438601.
   
   For additional information on development-related topics, visit:
   https://developer.apple.com/support/
   
   Best regards, 
   
   Apple Developer Program Support
              
   
   ------------------------------------------------------------
   Copyright (c) 2024 Apple Inc. All rights reserved.
   
   Contact Us
   https://developer.apple.com/contact/
   
   Developer
   https://developer.apple.com/
   
   My Apple ID
   https://appleid.apple.com
   
   Privacy Policy
   https://www.apple.com/privacy/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-46611][CORE] Remove ThreadLocal by replace SimpleDateFormat with DateTimeFormatter [spark]

Posted by "llkj1 (via GitHub)" <gi...@apache.org>.
llkj1 commented on PR #44613:
URL: https://github.com/apache/spark/pull/44613#issuecomment-1879982078

   感谢您与我们联系。(Thank you for contacting us.)
   ------------------------------------------------------------
   
   我们收到了您的请求,并会在一至两个工作日内给您回复。您的案例编号是 102195441010。
   
   想了解更多与开发相关主题的信息,请访问 开发者支持网页 (https://developer.apple.com/support/)。
                     
   Apple Developer Program Support
   
   
   We’ve received your support request and will get back to you in one to two business days. Your case number is 102195441010.
   
   For additional information on development-related topics, visit:
   https://developer.apple.com/support/
   
   Best regards, 
   
   Apple Developer Program Support
              
   
   ------------------------------------------------------------
   Copyright (c) 2024 Apple Inc. All rights reserved.
   
   Contact Us
   https://developer.apple.com/contact/
   
   Developer
   https://developer.apple.com/
   
   My Apple ID
   https://appleid.apple.com
   
   Privacy Policy
   https://www.apple.com/privacy/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-46611][CORE] Remove ThreadLocal by replace SimpleDateFormat with DateTimeFormatter [spark]

Posted by "llkj1 (via GitHub)" <gi...@apache.org>.
llkj1 commented on PR #44613:
URL: https://github.com/apache/spark/pull/44613#issuecomment-1879985694

   感谢您与我们联系。(Thank you for contacting us.)
   ------------------------------------------------------------
   
   我们收到了您的请求,并会在一至两个工作日内给您回复。您的案例编号是 102195451089。
   
   想了解更多与开发相关主题的信息,请访问 开发者支持网页 (https://developer.apple.com/support/)。
                     
   Apple Developer Program Support
   
   
   We’ve received your support request and will get back to you in one to two business days. Your case number is 102195451089.
   
   For additional information on development-related topics, visit:
   https://developer.apple.com/support/
   
   Best regards, 
   
   Apple Developer Program Support
              
   
   ------------------------------------------------------------
   Copyright (c) 2024 Apple Inc. All rights reserved.
   
   Contact Us
   https://developer.apple.com/contact/
   
   Developer
   https://developer.apple.com/
   
   My Apple ID
   https://appleid.apple.com
   
   Privacy Policy
   https://www.apple.com/privacy/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-46611][CORE] Remove ThreadLocal by replace SimpleDateFormat with DateTimeFormatter [spark]

Posted by "llkj1 (via GitHub)" <gi...@apache.org>.
llkj1 commented on PR #44613:
URL: https://github.com/apache/spark/pull/44613#issuecomment-1879985261

   感谢您与我们联系。(Thank you for contacting us.)
   ------------------------------------------------------------
   
   我们收到了您的请求,并会在一至两个工作日内给您回复。您的案例编号是 102195449442。
   
   想了解更多与开发相关主题的信息,请访问 开发者支持网页 (https://developer.apple.com/support/)。
                     
   Apple Developer Program Support
   
   
   We’ve received your support request and will get back to you in one to two business days. Your case number is 102195449442.
   
   For additional information on development-related topics, visit:
   https://developer.apple.com/support/
   
   Best regards, 
   
   Apple Developer Program Support
              
   
   ------------------------------------------------------------
   Copyright (c) 2024 Apple Inc. All rights reserved.
   
   Contact Us
   https://developer.apple.com/contact/
   
   Developer
   https://developer.apple.com/
   
   My Apple ID
   https://appleid.apple.com
   
   Privacy Policy
   https://www.apple.com/privacy/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [WIP][CORE] Remove ThreadLocal by replace SimpleDateFormat with DateTimeFormatter [spark]

Posted by "LuciferYang (via GitHub)" <gi...@apache.org>.
LuciferYang commented on code in PR #44613:
URL: https://github.com/apache/spark/pull/44613#discussion_r1443097993


##########
core/src/main/scala/org/apache/spark/ui/UIUtils.scala:
##########
@@ -42,15 +44,18 @@ private[spark] object UIUtils extends Logging {
   val TABLE_CLASS_STRIPED = TABLE_CLASS_NOT_STRIPED + " table-striped"
   val TABLE_CLASS_STRIPED_SORTABLE = TABLE_CLASS_STRIPED + " sortable"
 
-  // SimpleDateFormat is not thread-safe. Don't expose it to avoid improper use.
-  private val dateFormat = new ThreadLocal[SimpleDateFormat]() {
-    override def initialValue(): SimpleDateFormat =
-      new SimpleDateFormat("yyyy/MM/dd HH:mm:ss", Locale.US)
-  }
+  private val dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss", Locale.US)

Review Comment:
   How about 
   
   ```scala
   private val dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss", Locale.US)
       .withZone(java.time.ZoneId.systemDefault())
   
   def formatDate(date: Date): String = dateTimeFormatter.format(date.toInstant)
   def formatDate(timestamp: Long): String = dateTimeFormatter.format(Instant.ofEpochMilli(timestamp))
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-46611][CORE] Remove ThreadLocal by replace SimpleDateFormat with DateTimeFormatter [spark]

Posted by "llkj1 (via GitHub)" <gi...@apache.org>.
llkj1 commented on PR #44613:
URL: https://github.com/apache/spark/pull/44613#issuecomment-1879981757

   感谢您与我们联系。(Thank you for contacting us.)
   ------------------------------------------------------------
   
   我们收到了您的请求,并会在一至两个工作日内给您回复。您的案例编号是 102195439902。
   
   想了解更多与开发相关主题的信息,请访问 开发者支持网页 (https://developer.apple.com/support/)。
                     
   Apple Developer Program Support
   
   
   We’ve received your support request and will get back to you in one to two business days. Your case number is 102195439902.
   
   For additional information on development-related topics, visit:
   https://developer.apple.com/support/
   
   Best regards, 
   
   Apple Developer Program Support
              
   
   ------------------------------------------------------------
   Copyright (c) 2024 Apple Inc. All rights reserved.
   
   Contact Us
   https://developer.apple.com/contact/
   
   Developer
   https://developer.apple.com/
   
   My Apple ID
   https://appleid.apple.com
   
   Privacy Policy
   https://www.apple.com/privacy/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-46611][CORE] Remove ThreadLocal by replace SimpleDateFormat with DateTimeFormatter [spark]

Posted by "llkj1 (via GitHub)" <gi...@apache.org>.
llkj1 commented on PR #44613:
URL: https://github.com/apache/spark/pull/44613#issuecomment-1879979661

   感谢您与我们联系。(Thank you for contacting us.)
   ------------------------------------------------------------
   
   我们收到了您的请求,并会在一至两个工作日内给您回复。您的案例编号是 102195432886。
   
   想了解更多与开发相关主题的信息,请访问 开发者支持网页 (https://developer.apple.com/support/)。
                     
   Apple Developer Program Support
   
   
   We’ve received your support request and will get back to you in one to two business days. Your case number is 102195432886.
   
   For additional information on development-related topics, visit:
   https://developer.apple.com/support/
   
   Best regards, 
   
   Apple Developer Program Support
              
   
   ------------------------------------------------------------
   Copyright (c) 2024 Apple Inc. All rights reserved.
   
   Contact Us
   https://developer.apple.com/contact/
   
   Developer
   https://developer.apple.com/
   
   My Apple ID
   https://appleid.apple.com
   
   Privacy Policy
   https://www.apple.com/privacy/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-46611][CORE] Remove ThreadLocal by replace SimpleDateFormat with DateTimeFormatter [spark]

Posted by "llkj1 (via GitHub)" <gi...@apache.org>.
llkj1 commented on PR #44613:
URL: https://github.com/apache/spark/pull/44613#issuecomment-1879984830

   感谢您与我们联系。(Thank you for contacting us.)
   ------------------------------------------------------------
   
   我们收到了您的请求,并会在一至两个工作日内给您回复。您的案例编号是 102195448316。
   
   想了解更多与开发相关主题的信息,请访问 开发者支持网页 (https://developer.apple.com/support/)。
                     
   Apple Developer Program Support
   
   
   We’ve received your support request and will get back to you in one to two business days. Your case number is 102195448316.
   
   For additional information on development-related topics, visit:
   https://developer.apple.com/support/
   
   Best regards, 
   
   Apple Developer Program Support
              
   
   ------------------------------------------------------------
   Copyright (c) 2024 Apple Inc. All rights reserved.
   
   Contact Us
   https://developer.apple.com/contact/
   
   Developer
   https://developer.apple.com/
   
   My Apple ID
   https://appleid.apple.com
   
   Privacy Policy
   https://www.apple.com/privacy/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-46611][CORE] Remove ThreadLocal by replace SimpleDateFormat with DateTimeFormatter [spark]

Posted by "beliefer (via GitHub)" <gi...@apache.org>.
beliefer commented on PR #44613:
URL: https://github.com/apache/spark/pull/44613#issuecomment-1880584466

   @LuciferYang @srowen @mridulm Thank you!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-46611][CORE] Remove ThreadLocal by replace SimpleDateFormat with DateTimeFormatter [spark]

Posted by "llkj1 (via GitHub)" <gi...@apache.org>.
llkj1 commented on PR #44613:
URL: https://github.com/apache/spark/pull/44613#issuecomment-1879982469

   感谢您与我们联系。(Thank you for contacting us.)
   ------------------------------------------------------------
   
   我们收到了您的请求,并会在一至两个工作日内给您回复。您的案例编号是 102195442305。
   
   想了解更多与开发相关主题的信息,请访问 开发者支持网页 (https://developer.apple.com/support/)。
                     
   Apple Developer Program Support
   
   
   We’ve received your support request and will get back to you in one to two business days. Your case number is 102195442305.
   
   For additional information on development-related topics, visit:
   https://developer.apple.com/support/
   
   Best regards, 
   
   Apple Developer Program Support
              
   
   ------------------------------------------------------------
   Copyright (c) 2024 Apple Inc. All rights reserved.
   
   Contact Us
   https://developer.apple.com/contact/
   
   Developer
   https://developer.apple.com/
   
   My Apple ID
   https://appleid.apple.com
   
   Privacy Policy
   https://www.apple.com/privacy/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-46611][CORE] Remove ThreadLocal by replace SimpleDateFormat with DateTimeFormatter [spark]

Posted by "llkj1 (via GitHub)" <gi...@apache.org>.
llkj1 commented on PR #44613:
URL: https://github.com/apache/spark/pull/44613#issuecomment-1879988255

   感谢您与我们联系。(Thank you for contacting us.)
   ------------------------------------------------------------
   
   我们收到了您的请求,并会在一至两个工作日内给您回复。您的案例编号是 102195456973。
   
   想了解更多与开发相关主题的信息,请访问 开发者支持网页 (https://developer.apple.com/support/)。
                     
   Apple Developer Program Support
   
   
   We’ve received your support request and will get back to you in one to two business days. Your case number is 102195456973.
   
   For additional information on development-related topics, visit:
   https://developer.apple.com/support/
   
   Best regards, 
   
   Apple Developer Program Support
              
   
   ------------------------------------------------------------
   Copyright (c) 2024 Apple Inc. All rights reserved.
   
   Contact Us
   https://developer.apple.com/contact/
   
   Developer
   https://developer.apple.com/
   
   My Apple ID
   https://appleid.apple.com
   
   Privacy Policy
   https://www.apple.com/privacy/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-46611][CORE] Remove ThreadLocal by replace SimpleDateFormat with DateTimeFormatter [spark]

Posted by "llkj1 (via GitHub)" <gi...@apache.org>.
llkj1 commented on PR #44613:
URL: https://github.com/apache/spark/pull/44613#issuecomment-1879989280

   感谢您与我们联系。(Thank you for contacting us.)
   ------------------------------------------------------------
   
   我们收到了您的请求,并会在一至两个工作日内给您回复。您的案例编号是 102195459708。
   
   想了解更多与开发相关主题的信息,请访问 开发者支持网页 (https://developer.apple.com/support/)。
                     
   Apple Developer Program Support
   
   
   We’ve received your support request and will get back to you in one to two business days. Your case number is 102195459708.
   
   For additional information on development-related topics, visit:
   https://developer.apple.com/support/
   
   Best regards, 
   
   Apple Developer Program Support
              
   
   ------------------------------------------------------------
   Copyright (c) 2024 Apple Inc. All rights reserved.
   
   Contact Us
   https://developer.apple.com/contact/
   
   Developer
   https://developer.apple.com/
   
   My Apple ID
   https://appleid.apple.com
   
   Privacy Policy
   https://www.apple.com/privacy/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-46611][CORE] Remove ThreadLocal by replace SimpleDateFormat with DateTimeFormatter [spark]

Posted by "llkj1 (via GitHub)" <gi...@apache.org>.
llkj1 commented on PR #44613:
URL: https://github.com/apache/spark/pull/44613#issuecomment-1879990138

   感谢您与我们联系。(Thank you for contacting us.)
   ------------------------------------------------------------
   
   我们收到了您的请求,并会在一至两个工作日内给您回复。您的案例编号是 102195462227。
   
   想了解更多与开发相关主题的信息,请访问 开发者支持网页 (https://developer.apple.com/support/)。
                     
   Apple Developer Program Support
   
   
   We’ve received your support request and will get back to you in one to two business days. Your case number is 102195462227.
   
   For additional information on development-related topics, visit:
   https://developer.apple.com/support/
   
   Best regards, 
   
   Apple Developer Program Support
              
   
   ------------------------------------------------------------
   Copyright (c) 2024 Apple Inc. All rights reserved.
   
   Contact Us
   https://developer.apple.com/contact/
   
   Developer
   https://developer.apple.com/
   
   My Apple ID
   https://appleid.apple.com
   
   Privacy Policy
   https://www.apple.com/privacy/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-46611][CORE] Remove ThreadLocal by replace SimpleDateFormat with DateTimeFormatter [spark]

Posted by "LuciferYang (via GitHub)" <gi...@apache.org>.
LuciferYang closed pull request #44613: [SPARK-46611][CORE] Remove ThreadLocal by replace SimpleDateFormat with DateTimeFormatter
URL: https://github.com/apache/spark/pull/44613


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-46611][CORE] Remove ThreadLocal by replace SimpleDateFormat with DateTimeFormatter [spark]

Posted by "llkj1 (via GitHub)" <gi...@apache.org>.
llkj1 commented on PR #44613:
URL: https://github.com/apache/spark/pull/44613#issuecomment-1880018950

   感谢您与我们联系。(Thank you for contacting us.)
   ------------------------------------------------------------
   
   我们收到了您的请求,并会在一至两个工作日内给您回复。您的案例编号是 102195528798。
   
   想了解更多与开发相关主题的信息,请访问 开发者支持网页 (https://developer.apple.com/support/)。
                     
   Apple Developer Program Support
   
   
   We’ve received your support request and will get back to you in one to two business days. Your case number is 102195528798.
   
   For additional information on development-related topics, visit:
   https://developer.apple.com/support/
   
   Best regards, 
   
   Apple Developer Program Support
              
   
   ------------------------------------------------------------
   Copyright (c) 2024 Apple Inc. All rights reserved.
   
   Contact Us
   https://developer.apple.com/contact/
   
   Developer
   https://developer.apple.com/
   
   My Apple ID
   https://appleid.apple.com
   
   Privacy Policy
   https://www.apple.com/privacy/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-46611][CORE] Remove ThreadLocal by replace SimpleDateFormat with DateTimeFormatter [spark]

Posted by "llkj1 (via GitHub)" <gi...@apache.org>.
llkj1 commented on PR #44613:
URL: https://github.com/apache/spark/pull/44613#issuecomment-1879983842

   感谢您与我们联系。(Thank you for contacting us.)
   ------------------------------------------------------------
   
   我们收到了您的请求,并会在一至两个工作日内给您回复。您的案例编号是 102195445869。
   
   想了解更多与开发相关主题的信息,请访问 开发者支持网页 (https://developer.apple.com/support/)。
                     
   Apple Developer Program Support
   
   
   We’ve received your support request and will get back to you in one to two business days. Your case number is 102195445869.
   
   For additional information on development-related topics, visit:
   https://developer.apple.com/support/
   
   Best regards, 
   
   Apple Developer Program Support
              
   
   ------------------------------------------------------------
   Copyright (c) 2024 Apple Inc. All rights reserved.
   
   Contact Us
   https://developer.apple.com/contact/
   
   Developer
   https://developer.apple.com/
   
   My Apple ID
   https://appleid.apple.com
   
   Privacy Policy
   https://www.apple.com/privacy/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-46611][CORE] Remove ThreadLocal by replace SimpleDateFormat with DateTimeFormatter [spark]

Posted by "llkj1 (via GitHub)" <gi...@apache.org>.
llkj1 commented on PR #44613:
URL: https://github.com/apache/spark/pull/44613#issuecomment-1879984442

   感谢您与我们联系。(Thank you for contacting us.)
   ------------------------------------------------------------
   
   我们收到了您的请求,并会在一至两个工作日内给您回复。您的案例编号是 102195447327。
   
   想了解更多与开发相关主题的信息,请访问 开发者支持网页 (https://developer.apple.com/support/)。
                     
   Apple Developer Program Support
   
   
   We’ve received your support request and will get back to you in one to two business days. Your case number is 102195447327.
   
   For additional information on development-related topics, visit:
   https://developer.apple.com/support/
   
   Best regards, 
   
   Apple Developer Program Support
              
   
   ------------------------------------------------------------
   Copyright (c) 2024 Apple Inc. All rights reserved.
   
   Contact Us
   https://developer.apple.com/contact/
   
   Developer
   https://developer.apple.com/
   
   My Apple ID
   https://appleid.apple.com
   
   Privacy Policy
   https://www.apple.com/privacy/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-46611][CORE] Remove ThreadLocal by replace SimpleDateFormat with DateTimeFormatter [spark]

Posted by "llkj1 (via GitHub)" <gi...@apache.org>.
llkj1 commented on PR #44613:
URL: https://github.com/apache/spark/pull/44613#issuecomment-1879979401

   感谢您与我们联系。(Thank you for contacting us.)
   ------------------------------------------------------------
   
   我们收到了您的请求,并会在一至两个工作日内给您回复。您的案例编号是 102195431809。
   
   想了解更多与开发相关主题的信息,请访问 开发者支持网页 (https://developer.apple.com/support/)。
                     
   Apple Developer Program Support
   
   
   We’ve received your support request and will get back to you in one to two business days. Your case number is 102195431809.
   
   For additional information on development-related topics, visit:
   https://developer.apple.com/support/
   
   Best regards, 
   
   Apple Developer Program Support
              
   
   ------------------------------------------------------------
   Copyright (c) 2024 Apple Inc. All rights reserved.
   
   Contact Us
   https://developer.apple.com/contact/
   
   Developer
   https://developer.apple.com/
   
   My Apple ID
   https://appleid.apple.com
   
   Privacy Policy
   https://www.apple.com/privacy/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-46611][CORE] Remove ThreadLocal by replace SimpleDateFormat with DateTimeFormatter [spark]

Posted by "srowen (via GitHub)" <gi...@apache.org>.
srowen commented on code in PR #44613:
URL: https://github.com/apache/spark/pull/44613#discussion_r1444280812


##########
core/src/main/scala/org/apache/spark/ui/UIUtils.scala:
##########
@@ -150,19 +147,19 @@ private[spark] object UIUtils extends Logging {
       batchInterval: Long,
       showYYYYMMSS: Boolean = true,
       timezone: TimeZone = null): String = {
-    val oldTimezones =
-      (batchTimeFormat.get.getTimeZone, batchTimeFormatWithMilliseconds.get.getTimeZone)
+    val oldTimezones = (batchTimeFormat.getZone, batchTimeFormatWithMilliseconds.getZone)
     if (timezone != null) {
-      batchTimeFormat.get.setTimeZone(timezone)
-      batchTimeFormatWithMilliseconds.get.setTimeZone(timezone)
+      val zoneId = timezone.toZoneId
+      batchTimeFormat.withZone(zoneId)

Review Comment:
   This looks like a regression - see https://github.com/apache/spark/pull/44619



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [WIP][CORE] Remove ThreadLocal by replace SimpleDateFormat with DateTimeFormatter [spark]

Posted by "mridulm (via GitHub)" <gi...@apache.org>.
mridulm commented on code in PR #44613:
URL: https://github.com/apache/spark/pull/44613#discussion_r1443145145


##########
core/src/main/scala/org/apache/spark/ui/UIUtils.scala:
##########
@@ -42,15 +44,18 @@ private[spark] object UIUtils extends Logging {
   val TABLE_CLASS_STRIPED = TABLE_CLASS_NOT_STRIPED + " table-striped"
   val TABLE_CLASS_STRIPED_SORTABLE = TABLE_CLASS_STRIPED + " sortable"
 
-  // SimpleDateFormat is not thread-safe. Don't expose it to avoid improper use.
-  private val dateFormat = new ThreadLocal[SimpleDateFormat]() {
-    override def initialValue(): SimpleDateFormat =
-      new SimpleDateFormat("yyyy/MM/dd HH:mm:ss", Locale.US)
-  }
+  private val dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss", Locale.US)
 
-  def formatDate(date: Date): String = dateFormat.get.format(date)
+  def formatDate(date: Date): String = {
+    val localDateTime = date.toInstant.atZone(java.time.ZoneId.systemDefault()).toLocalDateTime
+    localDateTime.format(dateTimeFormatter)
+  }
 
-  def formatDate(timestamp: Long): String = dateFormat.get.format(new Date(timestamp))
+  def formatDate(timestamp: Long): String = {
+    val localDateTime =
+      Instant.ofEpochMilli(timestamp).atZone(java.time.ZoneId.systemDefault()).toLocalDateTime
+    localDateTime.format(dateTimeFormatter)
+  }

Review Comment:
   @LuciferYang's suggestion [here](https://github.com/apache/spark/pull/44613#discussion_r1443097993) is better.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-46611][CORE] Remove ThreadLocal by replace SimpleDateFormat with DateTimeFormatter [spark]

Posted by "llkj1 (via GitHub)" <gi...@apache.org>.
llkj1 commented on PR #44613:
URL: https://github.com/apache/spark/pull/44613#issuecomment-1879986625

   感谢您与我们联系。(Thank you for contacting us.)
   ------------------------------------------------------------
   
   我们收到了您的请求,并会在一至两个工作日内给您回复。您的案例编号是 102195453736。
   
   想了解更多与开发相关主题的信息,请访问 开发者支持网页 (https://developer.apple.com/support/)。
                     
   Apple Developer Program Support
   
   
   We’ve received your support request and will get back to you in one to two business days. Your case number is 102195453736.
   
   For additional information on development-related topics, visit:
   https://developer.apple.com/support/
   
   Best regards, 
   
   Apple Developer Program Support
              
   
   ------------------------------------------------------------
   Copyright (c) 2024 Apple Inc. All rights reserved.
   
   Contact Us
   https://developer.apple.com/contact/
   
   Developer
   https://developer.apple.com/
   
   My Apple ID
   https://appleid.apple.com
   
   Privacy Policy
   https://www.apple.com/privacy/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-46611][CORE] Remove ThreadLocal by replace SimpleDateFormat with DateTimeFormatter [spark]

Posted by "LuciferYang (via GitHub)" <gi...@apache.org>.
LuciferYang commented on PR #44613:
URL: https://github.com/apache/spark/pull/44613#issuecomment-1880416195

   Merged into master. Thanks @beliefer@srowen @mridulm 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-46611][CORE] Remove ThreadLocal by replace SimpleDateFormat with DateTimeFormatter [spark]

Posted by "llkj1 (via GitHub)" <gi...@apache.org>.
llkj1 commented on PR #44613:
URL: https://github.com/apache/spark/pull/44613#issuecomment-1879980634

   感谢您与我们联系。(Thank you for contacting us.)
   ------------------------------------------------------------
   
   我们收到了您的请求,并会在一至两个工作日内给您回复。您的案例编号是 102195436316。
   
   想了解更多与开发相关主题的信息,请访问 开发者支持网页 (https://developer.apple.com/support/)。
                     
   Apple Developer Program Support
   
   
   We’ve received your support request and will get back to you in one to two business days. Your case number is 102195436316.
   
   For additional information on development-related topics, visit:
   https://developer.apple.com/support/
   
   Best regards, 
   
   Apple Developer Program Support
              
   
   ------------------------------------------------------------
   Copyright (c) 2024 Apple Inc. All rights reserved.
   
   Contact Us
   https://developer.apple.com/contact/
   
   Developer
   https://developer.apple.com/
   
   My Apple ID
   https://appleid.apple.com
   
   Privacy Policy
   https://www.apple.com/privacy/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-46611][CORE] Remove ThreadLocal by replace SimpleDateFormat with DateTimeFormatter [spark]

Posted by "LuciferYang (via GitHub)" <gi...@apache.org>.
LuciferYang commented on PR #44613:
URL: https://github.com/apache/spark/pull/44613#issuecomment-1880284683

   is this one ready to go?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [WIP][CORE] Remove ThreadLocal by replace SimpleDateFormat with DateTimeFormatter [spark]

Posted by "mridulm (via GitHub)" <gi...@apache.org>.
mridulm commented on code in PR #44613:
URL: https://github.com/apache/spark/pull/44613#discussion_r1443144770


##########
core/src/main/scala/org/apache/spark/ui/UIUtils.scala:
##########
@@ -42,15 +44,18 @@ private[spark] object UIUtils extends Logging {
   val TABLE_CLASS_STRIPED = TABLE_CLASS_NOT_STRIPED + " table-striped"
   val TABLE_CLASS_STRIPED_SORTABLE = TABLE_CLASS_STRIPED + " sortable"
 
-  // SimpleDateFormat is not thread-safe. Don't expose it to avoid improper use.
-  private val dateFormat = new ThreadLocal[SimpleDateFormat]() {
-    override def initialValue(): SimpleDateFormat =
-      new SimpleDateFormat("yyyy/MM/dd HH:mm:ss", Locale.US)
-  }
+  private val dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss", Locale.US)

Review Comment:
   This is even better than my suggestion, thanks @LuciferYang !



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-46611][CORE] Remove ThreadLocal by replace SimpleDateFormat with DateTimeFormatter [spark]

Posted by "llkj1 (via GitHub)" <gi...@apache.org>.
llkj1 commented on PR #44613:
URL: https://github.com/apache/spark/pull/44613#issuecomment-1879981011

   感谢您与我们联系。(Thank you for contacting us.)
   ------------------------------------------------------------
   
   我们收到了您的请求,并会在一至两个工作日内给您回复。您的案例编号是 102195437543。
   
   想了解更多与开发相关主题的信息,请访问 开发者支持网页 (https://developer.apple.com/support/)。
                     
   Apple Developer Program Support
   
   
   We’ve received your support request and will get back to you in one to two business days. Your case number is 102195437543.
   
   For additional information on development-related topics, visit:
   https://developer.apple.com/support/
   
   Best regards, 
   
   Apple Developer Program Support
              
   
   ------------------------------------------------------------
   Copyright (c) 2024 Apple Inc. All rights reserved.
   
   Contact Us
   https://developer.apple.com/contact/
   
   Developer
   https://developer.apple.com/
   
   My Apple ID
   https://appleid.apple.com
   
   Privacy Policy
   https://www.apple.com/privacy/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-46611][CORE] Remove ThreadLocal by replace SimpleDateFormat with DateTimeFormatter [spark]

Posted by "llkj1 (via GitHub)" <gi...@apache.org>.
llkj1 commented on PR #44613:
URL: https://github.com/apache/spark/pull/44613#issuecomment-1879983487

   感谢您与我们联系。(Thank you for contacting us.)
   ------------------------------------------------------------
   
   我们收到了您的请求,并会在一至两个工作日内给您回复。您的案例编号是 102195444707。
   
   想了解更多与开发相关主题的信息,请访问 开发者支持网页 (https://developer.apple.com/support/)。
                     
   Apple Developer Program Support
   
   
   We’ve received your support request and will get back to you in one to two business days. Your case number is 102195444707.
   
   For additional information on development-related topics, visit:
   https://developer.apple.com/support/
   
   Best regards, 
   
   Apple Developer Program Support
              
   
   ------------------------------------------------------------
   Copyright (c) 2024 Apple Inc. All rights reserved.
   
   Contact Us
   https://developer.apple.com/contact/
   
   Developer
   https://developer.apple.com/
   
   My Apple ID
   https://appleid.apple.com
   
   Privacy Policy
   https://www.apple.com/privacy/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-46611][CORE] Remove ThreadLocal by replace SimpleDateFormat with DateTimeFormatter [spark]

Posted by "llkj1 (via GitHub)" <gi...@apache.org>.
llkj1 commented on PR #44613:
URL: https://github.com/apache/spark/pull/44613#issuecomment-1879991934

   感谢您与我们联系。(Thank you for contacting us.)
   ------------------------------------------------------------
   
   我们收到了您的请求,并会在一至两个工作日内给您回复。您的案例编号是 102195466919。
   
   想了解更多与开发相关主题的信息,请访问 开发者支持网页 (https://developer.apple.com/support/)。
                     
   Apple Developer Program Support
   
   
   We’ve received your support request and will get back to you in one to two business days. Your case number is 102195466919.
   
   For additional information on development-related topics, visit:
   https://developer.apple.com/support/
   
   Best regards, 
   
   Apple Developer Program Support
              
   
   ------------------------------------------------------------
   Copyright (c) 2024 Apple Inc. All rights reserved.
   
   Contact Us
   https://developer.apple.com/contact/
   
   Developer
   https://developer.apple.com/
   
   My Apple ID
   https://appleid.apple.com
   
   Privacy Policy
   https://www.apple.com/privacy/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-46611][CORE] Remove ThreadLocal by replace SimpleDateFormat with DateTimeFormatter [spark]

Posted by "llkj1 (via GitHub)" <gi...@apache.org>.
llkj1 commented on PR #44613:
URL: https://github.com/apache/spark/pull/44613#issuecomment-1879991487

   感谢您与我们联系。(Thank you for contacting us.)
   ------------------------------------------------------------
   
   我们收到了您的请求,并会在一至两个工作日内给您回复。您的案例编号是 102195465744。
   
   想了解更多与开发相关主题的信息,请访问 开发者支持网页 (https://developer.apple.com/support/)。
                     
   Apple Developer Program Support
   
   
   We’ve received your support request and will get back to you in one to two business days. Your case number is 102195465744.
   
   For additional information on development-related topics, visit:
   https://developer.apple.com/support/
   
   Best regards, 
   
   Apple Developer Program Support
              
   
   ------------------------------------------------------------
   Copyright (c) 2024 Apple Inc. All rights reserved.
   
   Contact Us
   https://developer.apple.com/contact/
   
   Developer
   https://developer.apple.com/
   
   My Apple ID
   https://appleid.apple.com
   
   Privacy Policy
   https://www.apple.com/privacy/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-46611][CORE] Remove ThreadLocal by replace SimpleDateFormat with DateTimeFormatter [spark]

Posted by "llkj1 (via GitHub)" <gi...@apache.org>.
llkj1 commented on PR #44613:
URL: https://github.com/apache/spark/pull/44613#issuecomment-1879987687

   感谢您与我们联系。(Thank you for contacting us.)
   ------------------------------------------------------------
   
   我们收到了您的请求,并会在一至两个工作日内给您回复。您的案例编号是 102195455952。
   
   想了解更多与开发相关主题的信息,请访问 开发者支持网页 (https://developer.apple.com/support/)。
                     
   Apple Developer Program Support
   
   
   We’ve received your support request and will get back to you in one to two business days. Your case number is 102195455952.
   
   For additional information on development-related topics, visit:
   https://developer.apple.com/support/
   
   Best regards, 
   
   Apple Developer Program Support
              
   
   ------------------------------------------------------------
   Copyright (c) 2024 Apple Inc. All rights reserved.
   
   Contact Us
   https://developer.apple.com/contact/
   
   Developer
   https://developer.apple.com/
   
   My Apple ID
   https://appleid.apple.com
   
   Privacy Policy
   https://www.apple.com/privacy/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org