Skip to content

Commit

Permalink
v0
Browse files Browse the repository at this point in the history
  • Loading branch information
Bughue committed Dec 6, 2024
1 parent cb93a9c commit 76d233a
Showing 1 changed file with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import org.apache.seata.core.rpc.netty.v0.ProtocolEncoderV0;
import org.apache.seata.core.rpc.netty.v1.ProtocolDecoderV1;
import org.apache.seata.core.rpc.netty.v1.ProtocolEncoderV1;
import org.apache.seata.core.rpc.netty.v2.ProtocolDecoderV2;
import org.apache.seata.core.rpc.netty.v2.ProtocolEncoderV2;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -83,12 +85,16 @@ int lengthFieldLength, FullLength is int(4B). so values is 4
int initialBytesToStrip we will check magic code and version self, so do not strip any bytes. so values is 0
*/
super(maxFrameLength, 3, 4, -7, 0);
this.protocolDecoderMap =
ImmutableMap.<Byte, ProtocolDecoder>builder().put(ProtocolConstants.VERSION_0, new ProtocolDecoderV0())
.put(ProtocolConstants.VERSION_1, new ProtocolDecoderV1()).build();
this.protocolEncoderMap =
ImmutableMap.<Byte, ProtocolEncoder>builder().put(ProtocolConstants.VERSION_0, new ProtocolEncoderV0())
.put(ProtocolConstants.VERSION_1, new ProtocolEncoderV1()).build();
this.protocolDecoderMap = ImmutableMap.<Byte, ProtocolDecoder>builder()
.put(ProtocolConstants.VERSION_0, new ProtocolDecoderV0())
.put(ProtocolConstants.VERSION_1, new ProtocolDecoderV1())
.put(ProtocolConstants.VERSION_2, new ProtocolDecoderV2())
.build();
this.protocolEncoderMap =ImmutableMap.<Byte, ProtocolEncoder>builder()
.put(ProtocolConstants.VERSION_0, new ProtocolEncoderV0())
.put(ProtocolConstants.VERSION_1, new ProtocolEncoderV1())
.put(ProtocolConstants.VERSION_2, new ProtocolEncoderV2())
.build();
this.channelHandlers = channelHandlers;
}

Expand Down

0 comments on commit 76d233a

Please sign in to comment.