This is an automated email from the ASF dual-hosted git repository. chengpan pushed a commit to branch branch-0.3 in repository https://gitbox.apache.org/repos/asf/incubator-celeborn.git
commit bc08cc040db9d3b91bdf2e8cfeec9b8f3ca4f1d1 Author: sychen <[email protected]> AuthorDate: Thu Sep 28 16:29:58 2023 +0800 [CELEBORN-986] Use formatted log instead of string concat ### What changes were proposed in this pull request? ### Why are the changes needed? ### Does this PR introduce _any_ user-facing change? ### How was this patch tested? GA Closes #1941 from cxzl25/CELEBORN-986. Authored-by: sychen <[email protected]> Signed-off-by: zky.zhoukeyong <[email protected]> (cherry picked from commit a9ed7f6a3996148653eaf416900af30de8a83444) Signed-off-by: zky.zhoukeyong <[email protected]> --- .../celeborn/plugin/flink/RemoteShuffleMaster.java | 2 +- .../celeborn/plugin/flink/RemoteShuffleMasterTest.java | 2 +- .../apache/celeborn/common/client/MasterClient.java | 2 +- .../celeborn/common/util/ShutdownHookManager.java | 18 ++++-------------- .../deploy/master/clustermeta/ha/MetaHandler.java | 4 ++-- 5 files changed, 9 insertions(+), 19 deletions(-) diff --git a/client-flink/common/src/main/java/org/apache/celeborn/plugin/flink/RemoteShuffleMaster.java b/client-flink/common/src/main/java/org/apache/celeborn/plugin/flink/RemoteShuffleMaster.java index 7bf39d5a2..843c140b0 100644 --- a/client-flink/common/src/main/java/org/apache/celeborn/plugin/flink/RemoteShuffleMaster.java +++ b/client-flink/common/src/main/java/org/apache/celeborn/plugin/flink/RemoteShuffleMaster.java @@ -227,7 +227,7 @@ public class RemoteShuffleMaster implements ShuffleMaster<RemoteShuffleDescripto jobShuffleIds.clear(); lifecycleManager.stop(); } catch (Exception e) { - LOG.warn("Encounter exception when shutdown: " + e.getMessage(), e); + LOG.warn("Encounter exception when shutdown: {}", e.getMessage(), e); } ThreadUtils.shutdownExecutors(10, executor); diff --git a/client-flink/flink-1.14/src/test/java/org/apache/celeborn/plugin/flink/RemoteShuffleMasterTest.java b/client-flink/flink-1.14/src/test/java/org/apache/celeborn/plugin/flink/RemoteShuffleMasterTest.java index 6768cedb1..a8607a6d8 100644 --- a/client-flink/flink-1.14/src/test/java/org/apache/celeborn/plugin/flink/RemoteShuffleMasterTest.java +++ b/client-flink/flink-1.14/src/test/java/org/apache/celeborn/plugin/flink/RemoteShuffleMasterTest.java @@ -93,7 +93,7 @@ public class RemoteShuffleMasterTest { ShuffleResourceDescriptor mapPartitionShuffleDescriptor = shuffleResource.getMapPartitionShuffleDescriptor(); - LOG.info("remoteShuffleDescriptor:", remoteShuffleDescriptor); + LOG.info("remoteShuffleDescriptor:{}", remoteShuffleDescriptor); Assert.assertEquals(0, mapPartitionShuffleDescriptor.getShuffleId()); Assert.assertEquals(0, mapPartitionShuffleDescriptor.getPartitionId()); Assert.assertEquals(0, mapPartitionShuffleDescriptor.getAttemptId()); diff --git a/common/src/main/java/org/apache/celeborn/common/client/MasterClient.java b/common/src/main/java/org/apache/celeborn/common/client/MasterClient.java index 559e409da..92f6061a3 100644 --- a/common/src/main/java/org/apache/celeborn/common/client/MasterClient.java +++ b/common/src/main/java/org/apache/celeborn/common/client/MasterClient.java @@ -136,7 +136,7 @@ public class MasterClient { .requestId_(encodeRequestId(UUID.randomUUID().toString(), nextCallId())); } - LOG.debug("Send rpc message " + message); + LOG.debug("Send rpc message {}", message); RpcEndpointRef endpointRef = null; // Use AtomicInteger or Integer or any Object which holds an int value is ok, we just need to // transfer an object to get the change of the current index of master addresses. diff --git a/common/src/main/java/org/apache/celeborn/common/util/ShutdownHookManager.java b/common/src/main/java/org/apache/celeborn/common/util/ShutdownHookManager.java index d7b794f29..3439a6ba1 100644 --- a/common/src/main/java/org/apache/celeborn/common/util/ShutdownHookManager.java +++ b/common/src/main/java/org/apache/celeborn/common/util/ShutdownHookManager.java @@ -115,19 +115,9 @@ public final class ShutdownHookManager { } catch (TimeoutException ex) { timeouts++; future.cancel(true); - LOG.warn( - "ShutdownHook '" - + entry.getHook().getClass().getSimpleName() - + "' timeout, " - + ex.toString(), - ex); + LOG.warn("ShutdownHook '{}' timeout", entry.getHook().getClass().getSimpleName(), ex); } catch (Throwable ex) { - LOG.warn( - "ShutdownHook '" - + entry.getHook().getClass().getSimpleName() - + "' failed, " - + ex.toString(), - ex); + LOG.warn("ShutdownHook '{}' failed", entry.getHook().getClass().getSimpleName(), ex); } } return timeouts; @@ -144,13 +134,13 @@ public final class ShutdownHookManager { long shutdownTimeout = getShutdownTimeout(conf); if (!EXECUTOR.awaitTermination(shutdownTimeout, TIME_UNIT_DEFAULT)) { // timeout waiting for the - LOG.error("ShutdownHookManger shutdown forcefully after" + " {} seconds.", shutdownTimeout); + LOG.error("ShutdownHookManger shutdown forcefully after {} seconds.", shutdownTimeout); EXECUTOR.shutdownNow(); } LOG.debug("ShutdownHookManger completed shutdown."); } catch (InterruptedException ex) { // interrupted. - LOG.error("ShutdownHookManger interrupted while waiting for " + "termination.", ex); + LOG.error("ShutdownHookManger interrupted while waiting for termination.", ex); EXECUTOR.shutdownNow(); Thread.currentThread().interrupt(); } diff --git a/master/src/main/java/org/apache/celeborn/service/deploy/master/clustermeta/ha/MetaHandler.java b/master/src/main/java/org/apache/celeborn/service/deploy/master/clustermeta/ha/MetaHandler.java index ab9d39dbc..2bbc8ab44 100644 --- a/master/src/main/java/org/apache/celeborn/service/deploy/master/clustermeta/ha/MetaHandler.java +++ b/master/src/main/java/org/apache/celeborn/service/deploy/master/clustermeta/ha/MetaHandler.java @@ -74,7 +74,7 @@ public class MetaHandler { throw new IOException("Can not parse this command!" + request); } } catch (IOException e) { - LOG.warn("Handle meta read request " + cmdType + " failed!", e); + LOG.warn("Handle meta read request {} failed!", cmdType, e); responseBuilder.setSuccess(false); responseBuilder.setStatus(ResourceProtos.Status.INTERNAL_ERROR); if (e.getMessage() != null) { @@ -241,7 +241,7 @@ public class MetaHandler { } responseBuilder.setStatus(ResourceProtos.Status.OK); } catch (IOException e) { - LOG.warn("Handle meta write request " + cmdType + " failed!", e); + LOG.warn("Handle meta write request {} failed!", cmdType, e); responseBuilder.setSuccess(false); responseBuilder.setStatus(ResourceProtos.Status.INTERNAL_ERROR); if (e.getMessage() != null) {
