reswqa commented on code in PR #2932:
URL: https://github.com/apache/celeborn/pull/2932#discussion_r1851510694
##########
common/src/main/scala/org/apache/celeborn/common/CelebornConf.scala:
##########
@@ -1040,8 +1040,13 @@ class CelebornConf(loadDefaults: Boolean) extends
Cloneable with Logging with Se
def shuffleRangeReadFilterEnabled: Boolean =
get(SHUFFLE_RANGE_READ_FILTER_ENABLED)
def shuffleForceFallbackEnabled: Boolean =
get(SPARK_SHUFFLE_FORCE_FALLBACK_ENABLED)
def checkWorkerEnabled: Boolean = get(CHECK_WORKER_ENABLED)
- def shuffleFallbackPolicy: FallbackPolicy = {
- val fallbackPolicyGiven =
FallbackPolicy.valueOf(get(SPARK_SHUFFLE_FALLBACK_POLICY))
+ def sparkShuffleFallbackPolicy: FallbackPolicy = {
+
shuffleFallbackPolicy(FallbackPolicy.valueOf(get(SPARK_SHUFFLE_FALLBACK_POLICY)))
+ }
+ def flinkShuffleFallbackPolicy: FallbackPolicy = {
+
shuffleFallbackPolicy(FallbackPolicy.valueOf(get(Flink_SHUFFLE_FALLBACK_POLICY)))
Review Comment:
```suggestion
shuffleFallbackPolicy(FallbackPolicy.valueOf(get(FLINK_SHUFFLE_FALLBACK_POLICY)))
```
##########
client-flink/flink-1.20/src/main/java/org/apache/celeborn/plugin/flink/RemoteShuffleServiceFactory.java:
##########
@@ -17,22 +17,27 @@
package org.apache.celeborn.plugin.flink;
+import org.apache.flink.runtime.io.network.NettyShuffleServiceFactory;
import org.apache.flink.runtime.io.network.api.writer.ResultPartitionWriter;
import org.apache.flink.runtime.io.network.partition.consumer.IndexedInputGate;
+import org.apache.flink.runtime.shuffle.ShuffleDescriptor;
import org.apache.flink.runtime.shuffle.ShuffleEnvironment;
import org.apache.flink.runtime.shuffle.ShuffleEnvironmentContext;
import org.apache.flink.runtime.shuffle.ShuffleMaster;
import org.apache.flink.runtime.shuffle.ShuffleMasterContext;
import org.apache.flink.runtime.shuffle.ShuffleServiceFactory;
public class RemoteShuffleServiceFactory extends
AbstractRemoteShuffleServiceFactory
- implements ShuffleServiceFactory<
- RemoteShuffleDescriptor, ResultPartitionWriter, IndexedInputGate> {
+ implements ShuffleServiceFactory<ShuffleDescriptor, ResultPartitionWriter,
IndexedInputGate> {
Review Comment:
Could we also support fallback for flink-1.20?
##########
client-flink/common/src/main/java/org/apache/celeborn/plugin/flink/fallback/WorkersAvailableFallbackPolicy.java:
##########
@@ -0,0 +1,59 @@
+/*
+ * 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.celeborn.plugin.flink.fallback;
+
+import org.apache.flink.runtime.shuffle.JobShuffleContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.apache.celeborn.client.LifecycleManager;
+import org.apache.celeborn.common.CelebornConf;
+
+public class WorkersAvailableFallbackPolicy implements ShuffleFallbackPolicy {
+
+ private static final Logger LOG =
LoggerFactory.getLogger(WorkersAvailableFallbackPolicy.class);
+
+ public static final WorkersAvailableFallbackPolicy INSTANCE =
+ new WorkersAvailableFallbackPolicy();
+
+ /**
+ * If celeborn cluster has no available workers, fallback to flink built-in
shuffle
+ * implementation.
+ *
+ * @param shuffleContext The job shuffle context of Flink.
+ * @param celebornConf The configuration of Celeborn.
+ * @param lifecycleManager The {@link LifecycleManager} of Celeborn.
+ * @return Whether celeborn cluster has no available workers.
+ */
+ @Override
+ public boolean needFallback(
+ JobShuffleContext shuffleContext,
+ CelebornConf celebornConf,
+ LifecycleManager lifecycleManager) {
+ if (!celebornConf.checkWorkerEnabled()) {
Review Comment:
We should also update doc for `CHECK_WORKER_ENABLED`.
--
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]