Skip to content

Commit

Permalink
[CELEBORN-986] Use formatted log instead of string concat
Browse files Browse the repository at this point in the history
### 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]>
  • Loading branch information
cxzl25 authored and waitinfuture committed Sep 28, 2023
1 parent ef4fc51 commit a9ed7f6
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ public void close() throws Exception {
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public void testRegisterPartitionWithProducer()
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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ private <T> T sendMessageInner(Object message, Class<T> clz) throws Throwable {
.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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,9 @@ static int executeShutdown() {
} 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;
Expand All @@ -144,13 +134,13 @@ private static void shutdownExecutor(final CelebornConf conf) {
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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public ResourceResponse handleReadRequest(ResourceProtos.ResourceRequest request
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) {
Expand Down Expand Up @@ -241,7 +241,7 @@ public ResourceResponse handleWriteRequest(ResourceProtos.ResourceRequest reques
}
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) {
Expand Down

0 comments on commit a9ed7f6

Please sign in to comment.