RexXiong commented on code in PR #2456:
URL: https://github.com/apache/celeborn/pull/2456#discussion_r1595244615
##########
client/src/main/scala/org/apache/celeborn/client/commit/ReducePartitionCommitHandler.scala:
##########
@@ -269,13 +269,16 @@ class ReducePartitionCommitHandler(
}
}
- private def replyGetReducerFileGroup(context: RpcCallContext, shuffleId:
Int): Unit = {
+ private def replyGetReducerFileGroup(
Review Comment:
ditto
##########
client/src/main/scala/org/apache/celeborn/client/commit/MapPartitionCommitHandler.scala:
##########
@@ -211,7 +211,9 @@ class MapPartitionCommitHandler(
(dataCommitSuccess, false)
}
- override def handleGetReducerFileGroup(context: RpcCallContext, shuffleId:
Int): Unit = {
+ override def handleGetReducerFileGroup(
Review Comment:
Keep the style iIf we don't need to change it.
##########
common/src/main/scala/org/apache/celeborn/common/util/PbSerDeUtils.scala:
##########
@@ -490,4 +490,170 @@ object PbSerDeUtils {
pbWorkerEventInfo.getWorkerEventType.getNumber,
pbWorkerEventInfo.getEventStartTime())
}
+
+ private def toPackedPartitionLocation(
+ pbPackedLocationsBuilder: PbPackedPartitionLocations.Builder,
+ workerIdIndex: Map[String, Int],
+ mountPointsIndex: Map[String, Int],
+ location: PartitionLocation): PbPackedPartitionLocations.Builder = {
+ pbPackedLocationsBuilder.addIds(location.getId)
+ pbPackedLocationsBuilder.addEpoches(location.getEpoch)
+
pbPackedLocationsBuilder.addWorkerIds(workerIdIndex(location.getWorker.toUniqueId()))
+ pbPackedLocationsBuilder.addMapIdBitMap(
+ Utils.roaringBitmapToByteString(location.getMapIdBitMap))
+ pbPackedLocationsBuilder.addTypes(location.getStorageInfo.getType.getValue)
+ pbPackedLocationsBuilder.addMountPoints(
+ mountPointsIndex(location.getStorageInfo.getMountPoint))
+
pbPackedLocationsBuilder.addFinalResult(location.getStorageInfo.isFinalResult)
+ if (location.getStorageInfo.getFilePath != null &&
location.getStorageInfo.getFilePath.nonEmpty) {
+ pbPackedLocationsBuilder.addFilePaths(location.getStorageInfo.getFilePath
+ .substring(location.getStorageInfo.getMountPoint.length))
+ } else {
+ pbPackedLocationsBuilder.addFilePaths("")
+ }
+
pbPackedLocationsBuilder.addAvailableStorageTypes(location.getStorageInfo.availableStorageTypes)
+ pbPackedLocationsBuilder.addModes(location.getMode.mode())
+ }
+
+ def toPbPackedPartitionLocationsPair(inputLocations: List[PartitionLocation])
+ : PbPackedPartitionLocationsPair = {
+ val packedLocationPairsBuilder =
PbPackedPartitionLocationsPair.newBuilder()
+ val packedLocationsBuilder = PbPackedPartitionLocations.newBuilder()
+
+ val implicateLocations = inputLocations.map(_.getPeer).filterNot(_ == null)
+
+ val allLocations = (inputLocations ++ implicateLocations)
+ val workerIdList = new util.ArrayList[String](
+ allLocations.map(_.getWorker.toUniqueId()).toSet.asJava)
+ val workerIdIndex = workerIdList.asScala.zipWithIndex.toMap
+ val mountPointsList = new util.ArrayList[String](
+ allLocations.map(
+ _.getStorageInfo.getMountPoint).toSet.asJava)
+ val mountPointsIndex = mountPointsList.asScala.zipWithIndex.toMap
+
+ packedLocationsBuilder.addAllWorkerIdsSet(workerIdList)
+ packedLocationsBuilder.addAllMountPointsSet(mountPointsList)
+
+ val locationIndexes = allLocations.map(_.hashCode()).zipWithIndex.toMap
Review Comment:
Don't use hashCode as the index.
##########
client/src/main/scala/org/apache/celeborn/client/LifecycleManager.scala:
##########
@@ -136,7 +136,9 @@ class LifecycleManager(val appUniqueId: String, val conf:
CelebornConf) extends
locations.asScala.foreach(location => map.put(location.getId, location))
}
- case class RegisterCallContext(context: RpcCallContext, partitionId: Int =
-1) {
+ case class RegisterCallContext(
Review Comment:
ditto
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]