Ngone51 commented on a change in pull request #24856: [SPARK-27823] [CORE] 
Refactor resource handling code
URL: https://github.com/apache/spark/pull/24856#discussion_r293868313
 
 

 ##########
 File path: 
core/src/main/scala/org/apache/spark/resource/ResourceInformation.scala
 ##########
 @@ -35,3 +41,25 @@ class ResourceInformation(
 
   override def toString: String = s"[name: ${name}, addresses: 
${addresses.mkString(",")}]"
 }
+
+private[spark] object ResourceInformation {
+  /**
+   * Parses a JSON string into a [[ResourceInformation]] instance.
+   */
+  def parseJson(json: String): ResourceInformation = {
+    implicit val formats = DefaultFormats
+    try {
+      parse(json).extract[ResourceInformationJson].toResourceInformation
 
 Review comment:
   Shall we check duplicate addresses for user ?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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

Reply via email to