From 439796f7c4c916734a334b95b1c17de63ffe1620 Mon Sep 17 00:00:00 2001 From: huangyiming Date: Mon, 23 Jul 2018 19:58:10 +0800 Subject: [PATCH] [ISSUE #375] Replace the message_magic_code and blank_magic_code value --- .../org/apache/rocketmq/common/message/MessageDecoder.java | 2 +- store/src/main/java/org/apache/rocketmq/store/CommitLog.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common/src/main/java/org/apache/rocketmq/common/message/MessageDecoder.java b/common/src/main/java/org/apache/rocketmq/common/message/MessageDecoder.java index 2d7bcbbf..1eb9f4d9 100644 --- a/common/src/main/java/org/apache/rocketmq/common/message/MessageDecoder.java +++ b/common/src/main/java/org/apache/rocketmq/common/message/MessageDecoder.java @@ -38,7 +38,7 @@ public class MessageDecoder { public final static int MESSAGE_FLAG_POSTION = 16; public final static int MESSAGE_PHYSIC_OFFSET_POSTION = 28; public final static int MESSAGE_STORE_TIMESTAMP_POSTION = 56; - public final static int MESSAGE_MAGIC_CODE = 0xAABBCCDD ^ 1880681586 + 8; + public final static int MESSAGE_MAGIC_CODE = -626843481; public static final char NAME_VALUE_SEPARATOR = 1; public static final char PROPERTY_SEPARATOR = 2; public static final int BODY_SIZE_POSITION = 4 // 1 TOTALSIZE diff --git a/store/src/main/java/org/apache/rocketmq/store/CommitLog.java b/store/src/main/java/org/apache/rocketmq/store/CommitLog.java index 7f772b24..d3caf8d8 100644 --- a/store/src/main/java/org/apache/rocketmq/store/CommitLog.java +++ b/store/src/main/java/org/apache/rocketmq/store/CommitLog.java @@ -44,10 +44,10 @@ import org.apache.rocketmq.store.schedule.ScheduleMessageService; */ public class CommitLog { // Message's MAGIC CODE daa320a7 - public final static int MESSAGE_MAGIC_CODE = 0xAABBCCDD ^ 1880681586 + 8; + public final static int MESSAGE_MAGIC_CODE = -626843481; private static final InternalLogger log = InternalLoggerFactory.getLogger(LoggerName.STORE_LOGGER_NAME); // End of file empty MAGIC CODE cbd43194 - private final static int BLANK_MAGIC_CODE = 0xBBCCDDEE ^ 1880681586 + 8; + private final static int BLANK_MAGIC_CODE = -875286124; private final MappedFileQueue mappedFileQueue; private final DefaultMessageStore defaultMessageStore; private final FlushCommitLogService flushCommitLogService; -- GitLab