提交 7e37799e 编写于 作者: Z Zhanhui Li

Aggregate packaging specific files to a new sub-module: distribution

上级 203cb30a
......@@ -8,7 +8,6 @@ devenv
*.iml
.idea/
*.versionsBackup
*bin
!NOTICE-BIN
!LICENSE-BIN
.DS_Store
.DS_Store
\ No newline at end of file
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
@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.
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.rocketmq</groupId>
<artifactId>rocketmq-all</artifactId>
<version>4.1.0-incubating-SNAPSHOT</version>
</parent>
<artifactId>rocketmq-distribution</artifactId>
<name>rocketmq-distribution ${project.version}</name>
<packaging>pom</packaging>
<profiles>
<profile>
<id>release-all</id>
<dependencies>
<dependency>
<groupId>org.apache.rocketmq</groupId>
<artifactId>rocketmq-broker</artifactId>
</dependency>
<dependency>
<groupId>org.apache.rocketmq</groupId>
<artifactId>rocketmq-client</artifactId>
</dependency>
<dependency>
<groupId>org.apache.rocketmq</groupId>
<artifactId>rocketmq-filtersrv</artifactId>
</dependency>
<dependency>
<groupId>org.apache.rocketmq</groupId>
<artifactId>rocketmq-tools</artifactId>
</dependency>
<dependency>
<groupId>org.apache.rocketmq</groupId>
<artifactId>rocketmq-example</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>release-all</id>
<goals>
<goal>single</goal>
</goals>
<phase>package</phase>
<configuration>
<descriptors>
<descriptor>release.xml</descriptor>
</descriptors>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<finalName>apache-rocketmq</finalName>
</build>
</profile>
<profile>
<id>release-client</id>
<dependencies>
<dependency>
<groupId>org.apache.rocketmq</groupId>
<artifactId>rocketmq-client</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>release-client</id>
<goals>
<goal>single</goal>
</goals>
<phase>package</phase>
<configuration>
<descriptors>
<descriptor>release-client.xml</descriptor>
</descriptors>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<finalName>apache-rocketmq</finalName>
</build>
</profile>
</profiles>
</project>
\ No newline at end of file
......@@ -15,7 +15,6 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<assembly>
<id>client</id>
<includeBaseDirectory>false</includeBaseDirectory>
......@@ -23,14 +22,14 @@
<format>dir</format>
<format>tar.gz</format>
</formats>
<fileSets>
<fileSet>
<includes>
<include>DISCLAIMER</include>
<include>README.md</include>
</includes>
</fileSet>
</fileSets>
<fileSet>
<directory>../</directory>
<includes>
<include>DISCLAIMER</include>
<include>README.md</include>
</includes>
</fileSet>
<files>
<file>
......@@ -45,6 +44,7 @@
<moduleSets>
<moduleSet>
<useAllReactorProjects>true</useAllReactorProjects>
<includes>
<include>org.apache.rocketmq:rocketmq-client</include>
</includes>
......
......@@ -15,7 +15,6 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<assembly>
<id>all</id>
<includeBaseDirectory>false</includeBaseDirectory>
......@@ -25,14 +24,26 @@
</formats>
<fileSets>
<fileSet>
<directory>../</directory>
<includes>
<include>bin/*</include>
<include>conf/**</include>
<include>benchmark/*</include>
<include>DISCLAIMER</include>
<include>README.md</include>
</includes>
</fileSet>
<fileSet>
<includes>
<include>conf/**</include>
<include>benchmark/*</include>
</includes>
</fileSet>
<fileSet>
<includes>
<include>bin/*</include>
</includes>
<fileMode>0755</fileMode>
</fileSet>
</fileSets>
<files>
......@@ -48,6 +59,7 @@
<moduleSets>
<moduleSet>
<useAllReactorProjects>true</useAllReactorProjects>
<includes>
<include>org.apache.rocketmq:rocketmq-broker</include>
<include>org.apache.rocketmq:rocketmq-tools</include>
......
......@@ -179,6 +179,7 @@
<module>filtersrv</module>
<module>srvutil</module>
<module>test</module>
<module>distribution</module>
</modules>
<build>
......@@ -380,6 +381,14 @@
<version>3.0.2</version>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.0.0</version>
</plugin>
</plugins>
</pluginManagement>
</build>
<profiles>
......@@ -438,40 +447,6 @@
</plugins>
</build>
</profile>
<profile>
<id>release-all</id>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.6</version>
<configuration>
<finalName>apache-rocketmq</finalName>
<descriptors>
<descriptor>release.xml</descriptor>
</descriptors>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>release-client</id>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.6</version>
<configuration>
<finalName>apache-rocketmq</finalName>
<descriptors>
<descriptor>release-client.xml</descriptor>
</descriptors>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>it-test</id>
<build>
......@@ -578,6 +553,11 @@
<artifactId>rocketmq-srvutil</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>rocketmq-example</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
......
......@@ -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();
}
......
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册