You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celeborn.apache.org by re...@apache.org on 2023/03/29 02:23:51 UTC

[incubator-celeborn] 36/42: [FLINK] remove unused code

This is an automated email from the ASF dual-hosted git repository.

rexxiong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-celeborn.git

commit 8c05b4a383db23b757ab691e77077384e09aaaa3
Author: zhongqiang.czq <zh...@alibaba-inc.com>
AuthorDate: Mon Mar 20 17:06:27 2023 +0800

    [FLINK] remove unused code
---
 .../celeborn/plugin/flink/utils/FlinkUtils.java    | 55 ----------------------
 .../celeborn/plugin/flink/utils/ThreadUtils.java   | 48 -------------------
 2 files changed, 103 deletions(-)

diff --git a/client-flink/flink-1.14/src/main/java/org/apache/celeborn/plugin/flink/utils/FlinkUtils.java b/client-flink/flink-1.14/src/main/java/org/apache/celeborn/plugin/flink/utils/FlinkUtils.java
deleted file mode 100644
index 06cc38566..000000000
--- a/client-flink/flink-1.14/src/main/java/org/apache/celeborn/plugin/flink/utils/FlinkUtils.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * 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.utils;
-
-import java.util.Map;
-
-import org.apache.flink.api.common.JobID;
-import org.apache.flink.configuration.Configuration;
-import org.apache.flink.runtime.executiongraph.ExecutionAttemptID;
-import org.apache.flink.runtime.jobgraph.IntermediateDataSetID;
-
-import org.apache.celeborn.common.CelebornConf;
-
-public class FlinkUtils {
-
-  public static CelebornConf toCelebornConf(Configuration configuration) {
-    CelebornConf tmpCelebornConf = new CelebornConf();
-    Map<String, String> confMap = configuration.toMap();
-    for (Map.Entry<String, String> entry : confMap.entrySet()) {
-      String key = entry.getKey();
-      if (key.startsWith("celeborn.")) {
-        tmpCelebornConf.set(entry.getKey(), entry.getValue());
-      }
-    }
-
-    return tmpCelebornConf;
-  }
-
-  public static String toCelebornAppId(JobID jobID) {
-    return jobID.toString();
-  }
-
-  public static String toShuffleId(JobID jobID, IntermediateDataSetID dataSetID) {
-    return jobID.toString() + "-" + dataSetID.toString();
-  }
-
-  public static String toAttemptId(ExecutionAttemptID attemptID) {
-    return attemptID.toString();
-  }
-}
diff --git a/client-flink/flink-1.14/src/main/java/org/apache/celeborn/plugin/flink/utils/ThreadUtils.java b/client-flink/flink-1.14/src/main/java/org/apache/celeborn/plugin/flink/utils/ThreadUtils.java
deleted file mode 100644
index 58e23ddc0..000000000
--- a/client-flink/flink-1.14/src/main/java/org/apache/celeborn/plugin/flink/utils/ThreadUtils.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * 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.utils;
-
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.ThreadFactory;
-import java.util.concurrent.TimeUnit;
-
-import com.google.common.util.concurrent.ThreadFactoryBuilder;
-import org.apache.flink.util.ExecutorUtils;
-import org.slf4j.Logger;
-
-public class ThreadUtils {
-
-  public static ThreadFactory createFactoryWithDefaultExceptionHandler(
-      final String executorServiceName, final Logger LOG) {
-    return new ThreadFactoryBuilder()
-        .setNameFormat(executorServiceName + "-%d")
-        .setDaemon(true)
-        .setUncaughtExceptionHandler(
-            (Thread t, Throwable e) ->
-                LOG.error(
-                    "exception in serviceName: {}, thread: {}",
-                    executorServiceName,
-                    t.getName(),
-                    e))
-        .build();
-  }
-
-  public static void shutdownExecutors(int timeoutSecs, ExecutorService executorService) {
-    ExecutorUtils.gracefulShutdown(timeoutSecs, TimeUnit.SECONDS, executorService);
-  }
-}