You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2021/01/22 07:36:53 UTC

[GitHub] [flink] AHeise commented on a change in pull request #14721: [FLINK-20645][network] Fix corrupted unaligned checkpoints.

AHeise commented on a change in pull request #14721:
URL: https://github.com/apache/flink/pull/14721#discussion_r562438971



##########
File path: flink-runtime/src/main/java/org/apache/flink/runtime/io/network/logger/NetworkActionsLogger.java
##########
@@ -18,51 +18,89 @@
 
 package org.apache.flink.runtime.io.network.logger;
 
+import org.apache.flink.runtime.checkpoint.channel.InputChannelInfo;
+import org.apache.flink.runtime.checkpoint.channel.ResultSubpartitionInfo;
 import org.apache.flink.runtime.io.network.buffer.Buffer;
 import org.apache.flink.runtime.io.network.buffer.BufferConsumer;
+import org.apache.flink.runtime.io.network.partition.consumer.ChannelStatePersister;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.Arrays;
-
-import static org.apache.flink.util.Preconditions.checkState;
-
 /** Utility class for logging actions that happened in the network stack for debugging purposes. */
 public class NetworkActionsLogger {
     private static final Logger LOG = LoggerFactory.getLogger(NetworkActionsLogger.class);
-
     private static final boolean ENABLED = LOG.isTraceEnabled();
     private static final boolean INCLUDE_HASH = true;
 
-    public static void log(Class<?> clazz, String action, Buffer buffer) {
+    public static void traceInput(
+            Class<?> clazz,
+            String action,
+            Buffer buffer,
+            InputChannelInfo channelInfo,
+            ChannelStatePersister channelStatePersister,
+            int sequenceNumber) {
+        if (ENABLED) {
+            LOG.trace(
+                    "{}#{} {}, seq {}, {} @ {}",
+                    clazz.getSimpleName(),

Review comment:
       Good catch, I didn't know that `getSimpleName` is implemented without a cache. I have combined your idea of a string to also merge the action in it. So action now contains "{simpleName}#{method}" (or anything else that identifies what Flink does with the buffer).




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org