public class MessageDecoder extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static Charset |
CHARSET_UTF8 |
static int |
MessageFlagPostion |
static int |
MessageMagicCode |
static int |
MessageMagicCodePostion
存储记录各个字段位置
|
static int |
MessagePhysicOffsetPostion |
static int |
MessageStoreTimestampPostion |
static int |
MSG_ID_LENGTH
消息ID定长
|
static char |
NAME_VALUE_SEPARATOR
序列化消息属性
|
static char |
PROPERTY_SEPARATOR |
| 构造器和说明 |
|---|
MessageDecoder() |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
createMessageId(ByteBuffer input,
ByteBuffer addr,
long offset) |
static String |
createMessageId(SocketAddress socketAddress,
long transactionIdhashCode) |
static MessageExt |
decode(ByteBuffer byteBuffer) |
static MessageExt |
decode(ByteBuffer byteBuffer,
boolean readBody)
客户端使用,SLAVE也会使用
|
static MessageExt |
decode(ByteBuffer byteBuffer,
boolean readBody,
boolean deCompressBody) |
static MessageId |
decodeMessageId(String msgId) |
static List<MessageExt> |
decodes(ByteBuffer byteBuffer) |
static List<MessageExt> |
decodes(ByteBuffer byteBuffer,
boolean readBody)
客户端使用
|
static byte[] |
encode(MessageExt messageExt,
boolean needCompress) |
static String |
messageProperties2String(Map<String,String> properties) |
static Map<String,String> |
string2messageProperties(String properties) |
public static final int MSG_ID_LENGTH
public static final Charset CHARSET_UTF8
public static final int MessageMagicCodePostion
public static final int MessageFlagPostion
public static final int MessagePhysicOffsetPostion
public static final int MessageStoreTimestampPostion
public static final int MessageMagicCode
public static final char NAME_VALUE_SEPARATOR
public static final char PROPERTY_SEPARATOR
public static String createMessageId(SocketAddress socketAddress, long transactionIdhashCode)
public static MessageId decodeMessageId(String msgId) throws UnknownHostException
public static MessageExt decode(ByteBuffer byteBuffer)
public static MessageExt decode(ByteBuffer byteBuffer, boolean readBody, boolean deCompressBody)
public static Map<String,String> string2messageProperties(String properties)
public static String createMessageId(ByteBuffer input, ByteBuffer addr, long offset)
public static byte[] encode(MessageExt messageExt, boolean needCompress) throws Exception
Exceptionpublic static String messageProperties2String(Map<String,String> properties)
public static List<MessageExt> decodes(ByteBuffer byteBuffer)
public static List<MessageExt> decodes(ByteBuffer byteBuffer, boolean readBody)
public static MessageExt decode(ByteBuffer byteBuffer, boolean readBody)
Copyright © 2012–2016. All rights reserved.