类 ThriftCodec
- java.lang.Object
-
- com.alibaba.dubbo.rpc.protocol.thrift.ThriftCodec
-
- 所有已实现的接口:
Codec2
public class ThriftCodec extends Object implements Codec2
Thrift framed protocol codec.|<- message header ->|<- message body ->| +----------------+----------------------+------------------+---------------------------+------------------+ | magic (2 bytes)|message size (4 bytes)|head size(2 bytes)| version (1 byte) | header | message body | +----------------+----------------------+------------------+---------------------------+------------------+ |<- message size ->|
header fields in version 1
- string - service name
- long - dubbo request id
-
-
嵌套类概要
-
从接口继承的嵌套类/接口 com.alibaba.dubbo.remoting.Codec2
Codec2.DecodeResult
-
-
字段概要
字段 修饰符和类型 字段 说明 static short
MAGIC
static int
MESSAGE_HEADER_LENGTH_INDEX
static int
MESSAGE_LENGTH_INDEX
static int
MESSAGE_SHORTEST_LENGTH
static String
NAME
static String
PARAMETER_CLASS_NAME_GENERATOR
static byte
VERSION
-
构造器概要
构造器 构造器 说明 ThriftCodec()
-
-
-
字段详细资料
-
MESSAGE_LENGTH_INDEX
public static final int MESSAGE_LENGTH_INDEX
- 另请参阅:
- 常量字段值
-
MESSAGE_HEADER_LENGTH_INDEX
public static final int MESSAGE_HEADER_LENGTH_INDEX
- 另请参阅:
- 常量字段值
-
MESSAGE_SHORTEST_LENGTH
public static final int MESSAGE_SHORTEST_LENGTH
- 另请参阅:
- 常量字段值
-
PARAMETER_CLASS_NAME_GENERATOR
public static final String PARAMETER_CLASS_NAME_GENERATOR
- 另请参阅:
- 常量字段值
-
VERSION
public static final byte VERSION
- 另请参阅:
- 常量字段值
-
MAGIC
public static final short MAGIC
- 另请参阅:
- 常量字段值
-
-
方法详细资料
-
encode
public void encode(Channel channel, ChannelBuffer buffer, Object message) throws IOException
- 指定者:
encode
在接口中Codec2
- 抛出:
IOException
-
decode
public Object decode(Channel channel, ChannelBuffer buffer) throws IOException
- 指定者:
decode
在接口中Codec2
- 抛出:
IOException
-
-