You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@celeborn.apache.org by "pan3793 (via GitHub)" <gi...@apache.org> on 2023/06/19 11:54:48 UTC

[GitHub] [incubator-celeborn] pan3793 commented on a diff in pull request #1605: [CELEBORN-695] Fix UnsupportedOperationException by refactoring WorkerInfo

pan3793 commented on code in PR #1605:
URL: https://github.com/apache/incubator-celeborn/pull/1605#discussion_r1233951056


##########
common/src/main/scala/org/apache/celeborn/common/meta/WorkerInfo.scala:
##########
@@ -34,12 +34,19 @@ class WorkerInfo(
     val pushPort: Int,
     val fetchPort: Int,
     val replicatePort: Int,
-    val diskInfos: util.Map[String, DiskInfo],
-    val userResourceConsumption: util.Map[UserIdentifier, ResourceConsumption],
-    var endpoint: RpcEndpointRef) extends Serializable with Logging {
+    _diskInfos: util.Map[String, DiskInfo],
+    _userResourceConsumption: util.Map[UserIdentifier, ResourceConsumption]) extends Serializable
+  with Logging {
   var unknownDiskSlots = new java.util.HashMap[String, Integer]()
   var networkLocation = "/default-rack"
   var lastHeartbeat: Long = 0
+  val diskInfos =
+    if (_diskInfos != null) JavaUtils.newConcurrentHashMap[String, DiskInfo](_diskInfos) else null

Review Comment:
   Most of the cases are performance insensitive. For non-collection cases, we can use `Option[T]` with the default value `None`.



-- 
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: issues-unsubscribe@celeborn.apache.org

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