RexXiong commented on code in PR #3329: URL: https://github.com/apache/celeborn/pull/3329#discussion_r2141890382
########## assets/spark-patch/Celeborn-Optimize-Skew-Partitions-spark3_5_6.patch: ########## @@ -0,0 +1,408 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +diff --git a/core/src/main/scala/org/apache/spark/MapOutputTracker.scala b/core/src/main/scala/org/apache/spark/MapOutputTracker.scala +index 9a7a3b0c0e7..543423dadd9 100644 +--- a/core/src/main/scala/org/apache/spark/MapOutputTracker.scala ++++ b/core/src/main/scala/org/apache/spark/MapOutputTracker.scala +@@ -34,6 +34,7 @@ import org.apache.commons.io.output.{ByteArrayOutputStream => ApacheByteArrayOut + import org.roaringbitmap.RoaringBitmap + + import org.apache.spark.broadcast.{Broadcast, BroadcastManager} ++import org.apache.spark.celeborn.CelebornShuffleState + import org.apache.spark.internal.Logging + import org.apache.spark.internal.config._ + import org.apache.spark.io.CompressionCodec +@@ -916,6 +917,7 @@ private[spark] class MapOutputTrackerMaster( + shuffleStatus.invalidateSerializedMergeOutputStatusCache() + } + } ++ CelebornShuffleState.unregisterCelebornSkewedShuffle(shuffleId) + } + + /** +diff --git a/core/src/main/scala/org/apache/spark/SparkEnv.scala b/core/src/main/scala/org/apache/spark/SparkEnv.scala +index edad91a0c6f..76b377729a0 100644 +--- a/core/src/main/scala/org/apache/spark/SparkEnv.scala ++++ b/core/src/main/scala/org/apache/spark/SparkEnv.scala +@@ -32,6 +32,7 @@ import org.apache.hadoop.conf.Configuration + import org.apache.spark.annotation.DeveloperApi + import org.apache.spark.api.python.PythonWorkerFactory + import org.apache.spark.broadcast.BroadcastManager ++import org.apache.spark.celeborn.CelebornShuffleState + import org.apache.spark.executor.ExecutorBackend + import org.apache.spark.internal.{config, Logging} + import org.apache.spark.internal.config._ +@@ -419,6 +420,7 @@ object SparkEnv extends Logging { + if (isDriver) { + val sparkFilesDir = Utils.createTempDir(Utils.getLocalDir(conf), "userFiles").getAbsolutePath + envInstance.driverTmpDir = Some(sparkFilesDir) ++ CelebornShuffleState.init(envInstance) + } + + envInstance +diff --git a/core/src/main/scala/org/apache/spark/celeborn/CelebornShuffleState.scala b/core/src/main/scala/org/apache/spark/celeborn/CelebornShuffleState.scala +new file mode 100644 +index 00000000000..5e190c512df +--- /dev/null ++++ b/core/src/main/scala/org/apache/spark/celeborn/CelebornShuffleState.scala +@@ -0,0 +1,75 @@ ++/* ++ * Licensed to the Apache Software Foundation (ASF) under one or more ++ * contributor license agreements. See the NOTICE file distributed with ++ * this work for additional information regarding copyright ownership. ++ * The ASF licenses this file to You under the Apache License, Version 2.0 ++ * (the "License"); you may not use this file except in compliance with ++ * the License. You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++package org.apache.spark.celeborn ++ ++import java.util.concurrent.ConcurrentHashMap ++import java.util.concurrent.atomic.AtomicBoolean ++ ++import org.apache.spark.SparkEnv ++import org.apache.spark.internal.config.ConfigBuilder ++ ++object CelebornShuffleState { ++ ++ private val CELEBORN_CLIENT_ADAPTIVE_OPTIMIZE_SKEWED_PARTITION_READ = ++ ConfigBuilder("spark.celeborn.client.adaptive.optimizeSkewedPartitionRead.enabled") ++ .booleanConf ++ .createWithDefault(false) ++ ++ private val CELEBORN_STAGE_RERUN_ENABLED = Review Comment: For consistency with the configuration in `CelebornConf`, here need enable stageRerun by default. ########## assets/spark-patch/Celeborn-Optimize-Skew-Partitions-spark4_0.patch: ########## @@ -0,0 +1,408 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +diff --git a/core/src/main/scala/org/apache/spark/MapOutputTracker.scala b/core/src/main/scala/org/apache/spark/MapOutputTracker.scala +index a660bccd2e6..a231ecfe72f 100644 +--- a/core/src/main/scala/org/apache/spark/MapOutputTracker.scala ++++ b/core/src/main/scala/org/apache/spark/MapOutputTracker.scala +@@ -34,6 +34,7 @@ import org.apache.commons.io.output.{ByteArrayOutputStream => ApacheByteArrayOut + import org.roaringbitmap.RoaringBitmap + + import org.apache.spark.broadcast.{Broadcast, BroadcastManager} ++import org.apache.spark.celeborn.CelebornShuffleState + import org.apache.spark.internal.{Logging, MDC, MessageWithContext} + import org.apache.spark.internal.LogKeys._ + import org.apache.spark.internal.config._ +@@ -929,6 +930,7 @@ private[spark] class MapOutputTrackerMaster( + shuffleStatus.invalidateSerializedMapOutputStatusCache() + shuffleStatus.invalidateSerializedMergeOutputStatusCache() + } ++ CelebornShuffleState.unregisterCelebornSkewedShuffle(shuffleId) + } + + /** +diff --git a/core/src/main/scala/org/apache/spark/SparkEnv.scala b/core/src/main/scala/org/apache/spark/SparkEnv.scala +index bf6e30f5afa..15dd28475a1 100644 +--- a/core/src/main/scala/org/apache/spark/SparkEnv.scala ++++ b/core/src/main/scala/org/apache/spark/SparkEnv.scala +@@ -31,6 +31,7 @@ import org.apache.hadoop.conf.Configuration + import org.apache.spark.annotation.DeveloperApi + import org.apache.spark.api.python.{PythonWorker, PythonWorkerFactory} + import org.apache.spark.broadcast.BroadcastManager ++import org.apache.spark.celeborn.CelebornShuffleState + import org.apache.spark.executor.ExecutorBackend + import org.apache.spark.internal.{config, Logging, MDC} + import org.apache.spark.internal.LogKeys +@@ -494,6 +495,7 @@ object SparkEnv extends Logging { + if (isDriver) { + val sparkFilesDir = Utils.createTempDir(Utils.getLocalDir(conf), "userFiles").getAbsolutePath + envInstance.driverTmpDir = Some(sparkFilesDir) ++ CelebornShuffleState.init(envInstance) + } + + envInstance +diff --git a/core/src/main/scala/org/apache/spark/celeborn/CelebornShuffleState.scala b/core/src/main/scala/org/apache/spark/celeborn/CelebornShuffleState.scala +new file mode 100644 +index 00000000000..5e190c512df +--- /dev/null ++++ b/core/src/main/scala/org/apache/spark/celeborn/CelebornShuffleState.scala +@@ -0,0 +1,75 @@ ++/* ++ * Licensed to the Apache Software Foundation (ASF) under one or more ++ * contributor license agreements. See the NOTICE file distributed with ++ * this work for additional information regarding copyright ownership. ++ * The ASF licenses this file to You under the Apache License, Version 2.0 ++ * (the "License"); you may not use this file except in compliance with ++ * the License. You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++package org.apache.spark.celeborn ++ ++import java.util.concurrent.ConcurrentHashMap ++import java.util.concurrent.atomic.AtomicBoolean ++ ++import org.apache.spark.SparkEnv ++import org.apache.spark.internal.config.ConfigBuilder ++ ++object CelebornShuffleState { ++ ++ private val CELEBORN_CLIENT_ADAPTIVE_OPTIMIZE_SKEWED_PARTITION_READ = ++ ConfigBuilder("spark.celeborn.client.adaptive.optimizeSkewedPartitionRead.enabled") ++ .booleanConf ++ .createWithDefault(false) ++ ++ private val CELEBORN_STAGE_RERUN_ENABLED = 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]
