LuciferYang commented on code in PR #2748: URL: https://github.com/apache/uniffle/pull/2748#discussion_r3222954208
########## client-spark/spark4/src/main/java/org/apache/spark/shuffle/RssShuffleDataIo.java: ########## @@ -0,0 +1,43 @@ +/* + * 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.shuffle; + +import org.apache.spark.SparkConf; +import org.apache.spark.shuffle.api.ShuffleDataIO; +import org.apache.spark.shuffle.api.ShuffleDriverComponents; +import org.apache.spark.shuffle.api.ShuffleExecutorComponents; +import org.apache.spark.shuffle.sort.io.LocalDiskShuffleExecutorComponents; + +public class RssShuffleDataIo implements ShuffleDataIO { Review Comment: Thanks for the suggestion! The existing `client-spark/spark3` module already has a class with the same name `RssShuffleDataIo`, and this class name is also referenced as a string in user-facing places: - `README.md` (user config example) - `integration-test/spark-common/.../SparkIntegrationTestBase.java` - `integration-test/spark3/.../GetReaderTest.java` To avoid name inconsistency between spark3 and spark4 (and to keep the user-facing config string stable), I'd like to keep the current name in this PR. I'll track a follow-up to rename both spark3 and spark4 together, updating the README and integration tests in one shot. WDYT? ########## client-spark/spark4/src/main/java/org/apache/spark/shuffle/Spark4VersionUtils.java: ########## @@ -0,0 +1,38 @@ +/* + * 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.shuffle; + +import org.apache.spark.package$; +import org.apache.spark.util.VersionUtils; + +public class Spark4VersionUtils extends SparkVersionUtils { Review Comment: Good point — you're right that a utility class with only static members shouldn't extend another utility class (there's no polymorphism across static methods, so the inheritance is effectively just a namespace alias). I've removed `extends SparkVersionUtils` from `Spark4VersionUtils`, qualified the `MAJOR_VERSION`/`MINOR_VERSION` references directly, and added a private constructor to prevent instantiation. The test was updated to drop the inherited `isSpark2/3/4()` assertions (they're already covered by the existing `testSparkVersion()` case against `SparkVersionUtils`), keeping `testSpark4Version()` focused on the Spark4-specific `isSparkVersionAtLeast`. I kept `Spark3VersionUtils` as-is to limit the scope of this PR; the same refactor can be applied there in a follow-up. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
