From 7e37799e822cda30b0607f859fc5574f468a49f3 Mon Sep 17 00:00:00 2001 From: Zhanhui Li Date: Tue, 28 Mar 2017 20:34:30 +0800 Subject: [PATCH] Aggregate packaging specific files to a new sub-module: distribution --- .gitignore | 3 +- BUILDING | 34 ++--- LICENSE-BIN => distribution/LICENSE-BIN | 0 NOTICE-BIN => distribution/NOTICE-BIN | 0 {bin => distribution/bin}/README.md | 0 {bin => distribution/bin}/cachedog.sh | 0 {bin => distribution/bin}/cleancache.sh | 0 {bin => distribution/bin}/cleancache.v1.sh | 0 {bin => distribution/bin}/mqadmin | 0 {bin => distribution/bin}/mqadmin.cmd | 0 {bin => distribution/bin}/mqadmin.xml | 0 {bin => distribution/bin}/mqbroker | 0 {bin => distribution/bin}/mqbroker.cmd | 0 {bin => distribution/bin}/mqbroker.numanode0 | 0 {bin => distribution/bin}/mqbroker.numanode1 | 0 {bin => distribution/bin}/mqbroker.numanode2 | 0 {bin => distribution/bin}/mqbroker.numanode3 | 0 {bin => distribution/bin}/mqbroker.xml | 0 {bin => distribution/bin}/mqfiltersrv | 0 {bin => distribution/bin}/mqfiltersrv.cmd | 0 {bin => distribution/bin}/mqfiltersrv.xml | 0 {bin => distribution/bin}/mqnamesrv | 0 {bin => distribution/bin}/mqnamesrv.cmd | 0 {bin => distribution/bin}/mqnamesrv.xml | 0 {bin => distribution/bin}/mqshutdown | 0 {bin => distribution/bin}/mqshutdown.cmd | 0 {bin => distribution/bin}/os.sh | 0 {bin => distribution/bin}/play.cmd | 0 {bin => distribution/bin}/play.sh | 0 distribution/bin/runbroker | 15 +++ {bin => distribution/bin}/runbroker.cmd | 0 {bin => distribution/bin}/runbroker.sh | 0 {bin => distribution/bin}/runserver.cmd | 0 {bin => distribution/bin}/runserver.sh | 0 {bin => distribution/bin}/setcache.sh | 0 {bin => distribution/bin}/startfsrv.sh | 0 {bin => distribution/bin}/tools.cmd | 0 {bin => distribution/bin}/tools.sh | 0 .../conf}/2m-2s-async/broker-a-s.properties | 0 .../conf}/2m-2s-async/broker-a.properties | 0 .../conf}/2m-2s-async/broker-b-s.properties | 0 .../conf}/2m-2s-async/broker-b.properties | 0 .../conf}/2m-2s-sync/broker-a-s.properties | 0 .../conf}/2m-2s-sync/broker-a.properties | 0 .../conf}/2m-2s-sync/broker-b-s.properties | 0 .../conf}/2m-2s-sync/broker-b.properties | 0 .../conf}/2m-noslave/broker-a.properties | 0 .../conf}/2m-noslave/broker-b.properties | 0 {conf => distribution/conf}/broker.conf | 0 .../conf}/logback_broker.xml | 0 .../conf}/logback_filtersrv.xml | 0 .../conf}/logback_namesrv.xml | 0 {conf => distribution/conf}/logback_tools.xml | 0 distribution/pom.xml | 125 ++++++++++++++++++ .../release-client.xml | 18 +-- release.xml => distribution/release.xml | 20 ++- pom.xml | 48 ++----- .../apache/rocketmq/store/ConsumeQueue.java | 11 +- .../org/apache/rocketmq/store/MappedFile.java | 2 +- 59 files changed, 202 insertions(+), 74 deletions(-) rename LICENSE-BIN => distribution/LICENSE-BIN (100%) rename NOTICE-BIN => distribution/NOTICE-BIN (100%) rename {bin => distribution/bin}/README.md (100%) rename {bin => distribution/bin}/cachedog.sh (100%) mode change 100755 => 100644 rename {bin => distribution/bin}/cleancache.sh (100%) mode change 100755 => 100644 rename {bin => distribution/bin}/cleancache.v1.sh (100%) mode change 100755 => 100644 rename {bin => distribution/bin}/mqadmin (100%) rename {bin => distribution/bin}/mqadmin.cmd (100%) rename {bin => distribution/bin}/mqadmin.xml (100%) rename {bin => distribution/bin}/mqbroker (100%) rename {bin => distribution/bin}/mqbroker.cmd (100%) rename {bin => distribution/bin}/mqbroker.numanode0 (100%) rename {bin => distribution/bin}/mqbroker.numanode1 (100%) rename {bin => distribution/bin}/mqbroker.numanode2 (100%) rename {bin => distribution/bin}/mqbroker.numanode3 (100%) rename {bin => distribution/bin}/mqbroker.xml (100%) rename {bin => distribution/bin}/mqfiltersrv (100%) rename {bin => distribution/bin}/mqfiltersrv.cmd (100%) rename {bin => distribution/bin}/mqfiltersrv.xml (100%) rename {bin => distribution/bin}/mqnamesrv (100%) rename {bin => distribution/bin}/mqnamesrv.cmd (100%) rename {bin => distribution/bin}/mqnamesrv.xml (100%) rename {bin => distribution/bin}/mqshutdown (100%) rename {bin => distribution/bin}/mqshutdown.cmd (100%) rename {bin => distribution/bin}/os.sh (100%) mode change 100755 => 100644 rename {bin => distribution/bin}/play.cmd (100%) rename {bin => distribution/bin}/play.sh (100%) mode change 100755 => 100644 create mode 100644 distribution/bin/runbroker rename {bin => distribution/bin}/runbroker.cmd (100%) rename {bin => distribution/bin}/runbroker.sh (100%) mode change 100755 => 100644 rename {bin => distribution/bin}/runserver.cmd (100%) rename {bin => distribution/bin}/runserver.sh (100%) mode change 100755 => 100644 rename {bin => distribution/bin}/setcache.sh (100%) mode change 100755 => 100644 rename {bin => distribution/bin}/startfsrv.sh (100%) mode change 100755 => 100644 rename {bin => distribution/bin}/tools.cmd (100%) rename {bin => distribution/bin}/tools.sh (100%) mode change 100755 => 100644 rename {conf => distribution/conf}/2m-2s-async/broker-a-s.properties (100%) rename {conf => distribution/conf}/2m-2s-async/broker-a.properties (100%) rename {conf => distribution/conf}/2m-2s-async/broker-b-s.properties (100%) rename {conf => distribution/conf}/2m-2s-async/broker-b.properties (100%) rename {conf => distribution/conf}/2m-2s-sync/broker-a-s.properties (100%) rename {conf => distribution/conf}/2m-2s-sync/broker-a.properties (100%) rename {conf => distribution/conf}/2m-2s-sync/broker-b-s.properties (100%) rename {conf => distribution/conf}/2m-2s-sync/broker-b.properties (100%) rename {conf => distribution/conf}/2m-noslave/broker-a.properties (100%) rename {conf => distribution/conf}/2m-noslave/broker-b.properties (100%) rename {conf => distribution/conf}/broker.conf (100%) rename {conf => distribution/conf}/logback_broker.xml (100%) rename {conf => distribution/conf}/logback_filtersrv.xml (100%) rename {conf => distribution/conf}/logback_namesrv.xml (100%) rename {conf => distribution/conf}/logback_tools.xml (100%) create mode 100644 distribution/pom.xml rename release-client.xml => distribution/release-client.xml (87%) rename release.xml => distribution/release.xml (88%) diff --git a/.gitignore b/.gitignore index 3f5f9f0f..80c6f569 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,6 @@ devenv *.iml .idea/ *.versionsBackup -*bin !NOTICE-BIN !LICENSE-BIN -.DS_Store +.DS_Store \ No newline at end of file diff --git a/BUILDING b/BUILDING index 1498b3e3..8a304952 100644 --- a/BUILDING +++ b/BUILDING @@ -1,37 +1,37 @@ -Build instructions for RocketMQ +Build Instructions for Apache RocketMQ ==================================================== -(1) Requisites +(1) Prerequisites -JDK 1.7+ is required in order to compile and run RocketMQ. + JDK 1.7+ is required in order to compile and run RocketMQ. -RocketMQ utilizes Maven as a distribution management and packaging tool. Version 3.0.3 or later is required. -Maven installation and configuration instructions can be found here: + RocketMQ utilizes Maven as a distribution management and packaging tool. Version 3.0.3 or later is required. + Maven installation and configuration instructions can be found here: -http://maven.apache.org/run-maven/index.html + http://maven.apache.org/run-maven/index.html -(2) Executing test cases +(2) Run test cases -Execute the following command in order to compile and test the components: + Execute the following command in order to compile and run test cases of each components: -$ mvn test + $ mvn test -(3) Importing projects to eclipse +(3) Import projects to Eclipse IDE -First, generate eclipse project files: + First, generate eclipse project files: -$ mvn -U eclipse:eclipse + $ mvn -U eclipse:eclipse -Then, import to eclipse by specifying the root directory of the project via: + Then, import to eclipse by specifying the root directory of the project via: -[File] > [Import] > [Existing Projects into Workspace]. + [File] > [Import] > [Existing Projects into Workspace]. -(4) Building packages +(4) Build distribution packages -Execute the following command in order to build the tar.gz packages and install JAR to the local repository: + Execute the following command in order to build the tar.gz packages and install JAR into local repository: -$ mvn clean install -Prelease-all assembly:assembly -U \ No newline at end of file + $ mvn -Prelease-all -DskipTests clean package install -U \ No newline at end of file diff --git a/LICENSE-BIN b/distribution/LICENSE-BIN similarity index 100% rename from LICENSE-BIN rename to distribution/LICENSE-BIN diff --git a/NOTICE-BIN b/distribution/NOTICE-BIN similarity index 100% rename from NOTICE-BIN rename to distribution/NOTICE-BIN diff --git a/bin/README.md b/distribution/bin/README.md similarity index 100% rename from bin/README.md rename to distribution/bin/README.md diff --git a/bin/cachedog.sh b/distribution/bin/cachedog.sh old mode 100755 new mode 100644 similarity index 100% rename from bin/cachedog.sh rename to distribution/bin/cachedog.sh diff --git a/bin/cleancache.sh b/distribution/bin/cleancache.sh old mode 100755 new mode 100644 similarity index 100% rename from bin/cleancache.sh rename to distribution/bin/cleancache.sh diff --git a/bin/cleancache.v1.sh b/distribution/bin/cleancache.v1.sh old mode 100755 new mode 100644 similarity index 100% rename from bin/cleancache.v1.sh rename to distribution/bin/cleancache.v1.sh diff --git a/bin/mqadmin b/distribution/bin/mqadmin similarity index 100% rename from bin/mqadmin rename to distribution/bin/mqadmin diff --git a/bin/mqadmin.cmd b/distribution/bin/mqadmin.cmd similarity index 100% rename from bin/mqadmin.cmd rename to distribution/bin/mqadmin.cmd diff --git a/bin/mqadmin.xml b/distribution/bin/mqadmin.xml similarity index 100% rename from bin/mqadmin.xml rename to distribution/bin/mqadmin.xml diff --git a/bin/mqbroker b/distribution/bin/mqbroker similarity index 100% rename from bin/mqbroker rename to distribution/bin/mqbroker diff --git a/bin/mqbroker.cmd b/distribution/bin/mqbroker.cmd similarity index 100% rename from bin/mqbroker.cmd rename to distribution/bin/mqbroker.cmd diff --git a/bin/mqbroker.numanode0 b/distribution/bin/mqbroker.numanode0 similarity index 100% rename from bin/mqbroker.numanode0 rename to distribution/bin/mqbroker.numanode0 diff --git a/bin/mqbroker.numanode1 b/distribution/bin/mqbroker.numanode1 similarity index 100% rename from bin/mqbroker.numanode1 rename to distribution/bin/mqbroker.numanode1 diff --git a/bin/mqbroker.numanode2 b/distribution/bin/mqbroker.numanode2 similarity index 100% rename from bin/mqbroker.numanode2 rename to distribution/bin/mqbroker.numanode2 diff --git a/bin/mqbroker.numanode3 b/distribution/bin/mqbroker.numanode3 similarity index 100% rename from bin/mqbroker.numanode3 rename to distribution/bin/mqbroker.numanode3 diff --git a/bin/mqbroker.xml b/distribution/bin/mqbroker.xml similarity index 100% rename from bin/mqbroker.xml rename to distribution/bin/mqbroker.xml diff --git a/bin/mqfiltersrv b/distribution/bin/mqfiltersrv similarity index 100% rename from bin/mqfiltersrv rename to distribution/bin/mqfiltersrv diff --git a/bin/mqfiltersrv.cmd b/distribution/bin/mqfiltersrv.cmd similarity index 100% rename from bin/mqfiltersrv.cmd rename to distribution/bin/mqfiltersrv.cmd diff --git a/bin/mqfiltersrv.xml b/distribution/bin/mqfiltersrv.xml similarity index 100% rename from bin/mqfiltersrv.xml rename to distribution/bin/mqfiltersrv.xml diff --git a/bin/mqnamesrv b/distribution/bin/mqnamesrv similarity index 100% rename from bin/mqnamesrv rename to distribution/bin/mqnamesrv diff --git a/bin/mqnamesrv.cmd b/distribution/bin/mqnamesrv.cmd similarity index 100% rename from bin/mqnamesrv.cmd rename to distribution/bin/mqnamesrv.cmd diff --git a/bin/mqnamesrv.xml b/distribution/bin/mqnamesrv.xml similarity index 100% rename from bin/mqnamesrv.xml rename to distribution/bin/mqnamesrv.xml diff --git a/bin/mqshutdown b/distribution/bin/mqshutdown similarity index 100% rename from bin/mqshutdown rename to distribution/bin/mqshutdown diff --git a/bin/mqshutdown.cmd b/distribution/bin/mqshutdown.cmd similarity index 100% rename from bin/mqshutdown.cmd rename to distribution/bin/mqshutdown.cmd diff --git a/bin/os.sh b/distribution/bin/os.sh old mode 100755 new mode 100644 similarity index 100% rename from bin/os.sh rename to distribution/bin/os.sh diff --git a/bin/play.cmd b/distribution/bin/play.cmd similarity index 100% rename from bin/play.cmd rename to distribution/bin/play.cmd diff --git a/bin/play.sh b/distribution/bin/play.sh old mode 100755 new mode 100644 similarity index 100% rename from bin/play.sh rename to distribution/bin/play.sh diff --git a/distribution/bin/runbroker b/distribution/bin/runbroker new file mode 100644 index 00000000..538f8e16 --- /dev/null +++ b/distribution/bin/runbroker @@ -0,0 +1,15 @@ +@echo off +rem Licensed to the Apache Software Foundation (ASF) under one or more +rem contributor license agreements. See the NOTICE file distributed with +rem this work for additional information regarding copyright ownership. +rem The ASF licenses this file to You under the Apache License, Version 2.0 +rem (the "License"); you may not use this file except in compliance with +rem the License. You may obtain a copy of the License at +rem +rem http://www.apache.org/licenses/LICENSE-2.0 +rem +rem Unless required by applicable law or agreed to in writing, software +rem distributed under the License is distributed on an "AS IS" BASIS, +rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +rem See the License for the specific language governing permissions and +rem limitations under the License. diff --git a/bin/runbroker.cmd b/distribution/bin/runbroker.cmd similarity index 100% rename from bin/runbroker.cmd rename to distribution/bin/runbroker.cmd diff --git a/bin/runbroker.sh b/distribution/bin/runbroker.sh old mode 100755 new mode 100644 similarity index 100% rename from bin/runbroker.sh rename to distribution/bin/runbroker.sh diff --git a/bin/runserver.cmd b/distribution/bin/runserver.cmd similarity index 100% rename from bin/runserver.cmd rename to distribution/bin/runserver.cmd diff --git a/bin/runserver.sh b/distribution/bin/runserver.sh old mode 100755 new mode 100644 similarity index 100% rename from bin/runserver.sh rename to distribution/bin/runserver.sh diff --git a/bin/setcache.sh b/distribution/bin/setcache.sh old mode 100755 new mode 100644 similarity index 100% rename from bin/setcache.sh rename to distribution/bin/setcache.sh diff --git a/bin/startfsrv.sh b/distribution/bin/startfsrv.sh old mode 100755 new mode 100644 similarity index 100% rename from bin/startfsrv.sh rename to distribution/bin/startfsrv.sh diff --git a/bin/tools.cmd b/distribution/bin/tools.cmd similarity index 100% rename from bin/tools.cmd rename to distribution/bin/tools.cmd diff --git a/bin/tools.sh b/distribution/bin/tools.sh old mode 100755 new mode 100644 similarity index 100% rename from bin/tools.sh rename to distribution/bin/tools.sh diff --git a/conf/2m-2s-async/broker-a-s.properties b/distribution/conf/2m-2s-async/broker-a-s.properties similarity index 100% rename from conf/2m-2s-async/broker-a-s.properties rename to distribution/conf/2m-2s-async/broker-a-s.properties diff --git a/conf/2m-2s-async/broker-a.properties b/distribution/conf/2m-2s-async/broker-a.properties similarity index 100% rename from conf/2m-2s-async/broker-a.properties rename to distribution/conf/2m-2s-async/broker-a.properties diff --git a/conf/2m-2s-async/broker-b-s.properties b/distribution/conf/2m-2s-async/broker-b-s.properties similarity index 100% rename from conf/2m-2s-async/broker-b-s.properties rename to distribution/conf/2m-2s-async/broker-b-s.properties diff --git a/conf/2m-2s-async/broker-b.properties b/distribution/conf/2m-2s-async/broker-b.properties similarity index 100% rename from conf/2m-2s-async/broker-b.properties rename to distribution/conf/2m-2s-async/broker-b.properties diff --git a/conf/2m-2s-sync/broker-a-s.properties b/distribution/conf/2m-2s-sync/broker-a-s.properties similarity index 100% rename from conf/2m-2s-sync/broker-a-s.properties rename to distribution/conf/2m-2s-sync/broker-a-s.properties diff --git a/conf/2m-2s-sync/broker-a.properties b/distribution/conf/2m-2s-sync/broker-a.properties similarity index 100% rename from conf/2m-2s-sync/broker-a.properties rename to distribution/conf/2m-2s-sync/broker-a.properties diff --git a/conf/2m-2s-sync/broker-b-s.properties b/distribution/conf/2m-2s-sync/broker-b-s.properties similarity index 100% rename from conf/2m-2s-sync/broker-b-s.properties rename to distribution/conf/2m-2s-sync/broker-b-s.properties diff --git a/conf/2m-2s-sync/broker-b.properties b/distribution/conf/2m-2s-sync/broker-b.properties similarity index 100% rename from conf/2m-2s-sync/broker-b.properties rename to distribution/conf/2m-2s-sync/broker-b.properties diff --git a/conf/2m-noslave/broker-a.properties b/distribution/conf/2m-noslave/broker-a.properties similarity index 100% rename from conf/2m-noslave/broker-a.properties rename to distribution/conf/2m-noslave/broker-a.properties diff --git a/conf/2m-noslave/broker-b.properties b/distribution/conf/2m-noslave/broker-b.properties similarity index 100% rename from conf/2m-noslave/broker-b.properties rename to distribution/conf/2m-noslave/broker-b.properties diff --git a/conf/broker.conf b/distribution/conf/broker.conf similarity index 100% rename from conf/broker.conf rename to distribution/conf/broker.conf diff --git a/conf/logback_broker.xml b/distribution/conf/logback_broker.xml similarity index 100% rename from conf/logback_broker.xml rename to distribution/conf/logback_broker.xml diff --git a/conf/logback_filtersrv.xml b/distribution/conf/logback_filtersrv.xml similarity index 100% rename from conf/logback_filtersrv.xml rename to distribution/conf/logback_filtersrv.xml diff --git a/conf/logback_namesrv.xml b/distribution/conf/logback_namesrv.xml similarity index 100% rename from conf/logback_namesrv.xml rename to distribution/conf/logback_namesrv.xml diff --git a/conf/logback_tools.xml b/distribution/conf/logback_tools.xml similarity index 100% rename from conf/logback_tools.xml rename to distribution/conf/logback_tools.xml diff --git a/distribution/pom.xml b/distribution/pom.xml new file mode 100644 index 00000000..41f36dc7 --- /dev/null +++ b/distribution/pom.xml @@ -0,0 +1,125 @@ + + + + 4.0.0 + + org.apache.rocketmq + rocketmq-all + 4.1.0-incubating-SNAPSHOT + + rocketmq-distribution + rocketmq-distribution ${project.version} + pom + + + + + release-all + + + + org.apache.rocketmq + rocketmq-broker + + + + org.apache.rocketmq + rocketmq-client + + + + org.apache.rocketmq + rocketmq-filtersrv + + + + org.apache.rocketmq + rocketmq-tools + + + + org.apache.rocketmq + rocketmq-example + + + + + + + maven-assembly-plugin + + + release-all + + single + + package + + + release.xml + + false + + + + + + apache-rocketmq + + + + + release-client + + + + org.apache.rocketmq + rocketmq-client + ${project.version} + + + + + + + maven-assembly-plugin + + + release-client + + single + + package + + + release-client.xml + + false + + + + + + apache-rocketmq + + + + + \ No newline at end of file diff --git a/release-client.xml b/distribution/release-client.xml similarity index 87% rename from release-client.xml rename to distribution/release-client.xml index 332f0de4..46563eb4 100644 --- a/release-client.xml +++ b/distribution/release-client.xml @@ -15,7 +15,6 @@ See the License for the specific language governing permissions and limitations under the License. --> - client false @@ -23,14 +22,14 @@ dir tar.gz - - - - DISCLAIMER - README.md - - - + + + ../ + + DISCLAIMER + README.md + + @@ -45,6 +44,7 @@ + true org.apache.rocketmq:rocketmq-client diff --git a/release.xml b/distribution/release.xml similarity index 88% rename from release.xml rename to distribution/release.xml index 1fdf8c99..2d3ec1ec 100644 --- a/release.xml +++ b/distribution/release.xml @@ -15,7 +15,6 @@ See the License for the specific language governing permissions and limitations under the License. --> - all false @@ -25,14 +24,26 @@ + ../ - bin/* - conf/** - benchmark/* DISCLAIMER README.md + + + + conf/** + benchmark/* + + + + + + bin/* + + 0755 + @@ -48,6 +59,7 @@ + true org.apache.rocketmq:rocketmq-broker org.apache.rocketmq:rocketmq-tools diff --git a/pom.xml b/pom.xml index ce6a7f17..47df84d4 100644 --- a/pom.xml +++ b/pom.xml @@ -179,6 +179,7 @@ filtersrv srvutil test + distribution @@ -380,6 +381,14 @@ 3.0.2 + + + + maven-assembly-plugin + 3.0.0 + + + @@ -438,40 +447,6 @@ - - release-all - - - - maven-assembly-plugin - 2.6 - - apache-rocketmq - - release.xml - - - - - - - - release-client - - - - maven-assembly-plugin - 2.6 - - apache-rocketmq - - release-client.xml - - - - - - it-test @@ -578,6 +553,11 @@ rocketmq-srvutil ${project.version} + + ${project.groupId} + rocketmq-example + ${project.version} + org.slf4j slf4j-api diff --git a/store/src/main/java/org/apache/rocketmq/store/ConsumeQueue.java b/store/src/main/java/org/apache/rocketmq/store/ConsumeQueue.java index eeb35980..919c6372 100644 --- a/store/src/main/java/org/apache/rocketmq/store/ConsumeQueue.java +++ b/store/src/main/java/org/apache/rocketmq/store/ConsumeQueue.java @@ -130,9 +130,7 @@ public class ConsumeQueue { MappedFile mappedFile = this.mappedFileQueue.getMappedFileByTime(timestamp); if (mappedFile != null) { long offset = 0; - int low = - minLogicOffset > mappedFile.getFileFromOffset() ? (int) (minLogicOffset - mappedFile - .getFileFromOffset()) : 0; + int low = minLogicOffset > mappedFile.getFileFromOffset() ? (int) (minLogicOffset - mappedFile.getFileFromOffset()) : 0; int high = 0; int midOffset = -1, targetOffset = -1, leftOffset = -1, rightOffset = -1; long leftIndexValue = -1L, rightIndexValue = -1L; @@ -302,7 +300,6 @@ public class ConsumeQueue { SelectMappedBufferResult result = mappedFile.selectMappedBuffer(0); if (result != null) { try { - for (int i = 0; i < result.getSize(); i += ConsumeQueue.CQ_STORE_UNIT_SIZE) { long offsetPy = result.getByteBuffer().getLong(); result.getByteBuffer().getInt(); @@ -310,13 +307,13 @@ public class ConsumeQueue { if (offsetPy >= phyMinOffset) { this.minLogicOffset = result.getMappedFile().getFileFromOffset() + i; - log.info("compute logics min offset: " + this.getMinOffsetInQueue() + ", topic: " - + this.topic + ", queueId: " + this.queueId); + log.info("Compute logical min offset: {}, topic: {}, queueId: {}", + this.getMinOffsetInQueue(), this.topic, this.queueId); break; } } } catch (Exception e) { - e.printStackTrace(); + log.error("Exception thrown when correctMinOffset", e); } finally { result.release(); } diff --git a/store/src/main/java/org/apache/rocketmq/store/MappedFile.java b/store/src/main/java/org/apache/rocketmq/store/MappedFile.java index 5cb72ce2..550e578c 100644 --- a/store/src/main/java/org/apache/rocketmq/store/MappedFile.java +++ b/store/src/main/java/org/apache/rocketmq/store/MappedFile.java @@ -402,7 +402,7 @@ public class MappedFile extends ReferenceResource { public boolean cleanup(final long currentRef) { if (this.isAvailable()) { log.error("this file[REF:" + currentRef + "] " + this.fileName - + " have not shutdown, stop unmaping."); + + " have not shutdown, stop unmapping."); return false; } -- GitLab