diff --git a/dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/codec/NettyDecoder.java b/dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/codec/NettyDecoder.java index caa4fbdd17..09f97d6cd7 100644 --- a/dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/codec/NettyDecoder.java +++ b/dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/codec/NettyDecoder.java @@ -24,6 +24,8 @@ import io.netty.handler.codec.ReplayingDecoder; import org.apache.dolphinscheduler.remote.command.Command; import org.apache.dolphinscheduler.remote.command.CommandHeader; import org.apache.dolphinscheduler.remote.command.CommandType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.util.List; @@ -31,6 +33,7 @@ import java.util.List; * netty decoder */ public class NettyDecoder extends ReplayingDecoder { + private static final Logger logger = LoggerFactory.getLogger(NettyDecoder.class); public NettyDecoder(){ super(State.MAGIC); @@ -52,15 +55,19 @@ public class NettyDecoder extends ReplayingDecoder { case MAGIC: checkMagic(in.readByte()); checkpoint(State.COMMAND); + break; case COMMAND: commandHeader.setType(in.readByte()); checkpoint(State.OPAQUE); + break; case OPAQUE: commandHeader.setOpaque(in.readLong()); checkpoint(State.BODY_LENGTH); + break; case BODY_LENGTH: commandHeader.setBodyLength(in.readInt()); checkpoint(State.BODY); + break; case BODY: byte[] body = new byte[commandHeader.getBodyLength()]; in.readBytes(body); @@ -72,6 +79,9 @@ public class NettyDecoder extends ReplayingDecoder { out.add(packet); // checkpoint(State.MAGIC); + break; + default: + logger.warn("unknown decoder state {}", state()); } }