You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by yu...@apache.org on 2017/02/10 12:09:53 UTC

[1/5] incubator-rocketmq git commit: [ROCKETMQ-85] Remove the 3rd party links in README. [Forced Update!]

Repository: incubator-rocketmq
Updated Branches:
  refs/heads/release-4.0.0-incubating 0ca3792b2 -> 767775838 (forced update)


[ROCKETMQ-85] Remove the 3rd party links in README.


Project: http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/commit/cb4f19e5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/tree/cb4f19e5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/diff/cb4f19e5

Branch: refs/heads/release-4.0.0-incubating
Commit: cb4f19e5b015efbb42702830990756ea41178784
Parents: e6aaedc
Author: yukon <yu...@apache.org>
Authored: Fri Feb 10 16:10:48 2017 +0800
Committer: yukon <yu...@apache.org>
Committed: Fri Feb 10 16:10:48 2017 +0800

----------------------------------------------------------------------
 README.md | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/blob/cb4f19e5/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 86859dd..61ee050 100644
--- a/README.md
+++ b/README.md
@@ -14,10 +14,7 @@ It offers a variety of features as follows:
 * Over a variety of messaging protocols.such as JMS,MQTT etc.
 * Distributed high available deploy architecture, meets at least once message delivery semantics
 * Docker images for isolated testing and cloud Isolated clusters
-* Feature-rich administrative dashboard for configuration,metrics and monitoring [![Cloud Charge](https://img.shields.io/badge/cloud-charge-red.svg)](https://www.aliyun.com/product/ons/)
-* Message full-link tracking [![Cloud Charge] (https://img.shields.io/badge/cloud-charge-red.svg)](https://www.aliyun.com/product/ons/)
-* Producer transaction message,making producer and local database transaction in one atomic operation [![Cloud Charge](https://img.shields.io/badge/cloud-charge-red.svg)](https://www.aliyun.com/product/ons/)
-* Message Schedule delivery,similar JMS2 spec's delivery delay [![Cloud Charge] (https://img.shields.io/badge/cloud-charge-red.svg)](https://www.aliyun.com/product/ons/)
+* Feature-rich administrative dashboard for configuration,metrics and monitoring
 
 ----------
 


[4/5] incubator-rocketmq git commit: [ROCKETMQ-87] Add license notice for all the dependencies.

Posted by yu...@apache.org.
[ROCKETMQ-87] Add license notice for all the dependencies.


Project: http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/commit/44ef40ab
Tree: http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/tree/44ef40ab
Diff: http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/diff/44ef40ab

Branch: refs/heads/release-4.0.0-incubating
Commit: 44ef40ab37e330cde3e0c292e63936a5ec435d9b
Parents: bd00854
Author: yukon <yu...@apache.org>
Authored: Fri Feb 10 17:29:15 2017 +0800
Committer: yukon <yu...@apache.org>
Committed: Fri Feb 10 17:29:15 2017 +0800

----------------------------------------------------------------------
 NOTICE | 28 +++++++++++++++++++++++++++-
 1 file changed, 27 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/blob/44ef40ab/NOTICE
----------------------------------------------------------------------
diff --git a/NOTICE b/NOTICE
index 5384857..7d76e00 100644
--- a/NOTICE
+++ b/NOTICE
@@ -2,4 +2,30 @@ Apache RocketMQ (incubating)
 Copyright 2016-2017 The Apache Software Foundation
 
 This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
\ No newline at end of file
+The Apache Software Foundation (http://www.apache.org/).
+
+-------------------------------------------------------------------------------
+This distribution has a binary dependency on netty, which is available under the ASL2 License.
+The source code of netty can be found at https://github.com/netty/netty.
+
+This distribution has a binary dependency on commons-cli, which is available under the ASL2 License.
+The source code of commons-cli can be found at https://github.com/apache/commons-cli.
+
+This distribution has a binary dependency on commons-lang, which is available under the ASL2 License.
+The source code of commons-lang can be found at https://github.com/apache/commons-lang.
+
+This distribution has a binary dependency on fastjson, which is available under the ASL2 License.
+The source code of fastjson can be found at https://github.com/alibaba/fastjson.
+
+This distribution has a binary dependency on javassist, which is available under
+the Mozilla Public License Version 1.1, the GNU Lesser General Public License Version 2.1 or later, or the ASL2 License.
+The source code of javassist can be found at https://github.com/jboss-javassist/javassist.
+
+This distribution has a binary dependency on jna, which is available under the LGPL, version 2.1 or later, and (from version 4.0 onward) the ASL2 License.
+The source code of jna can be found at https://github.com/java-native-access/jna.
+
+This distribution has a binary dependency on logback, which is available under the EPL v1.0 and the LGPL 2.1 License.
+The source code of logback can be found at https://github.com/qos-ch/logback.
+
+This distribution has a binary dependency on slf4j, which is available under the MIT License.
+The source code of slf4j can be found at https://github.com/qos-ch/slf4j.
\ No newline at end of file


[3/5] incubator-rocketmq git commit: [ROCKETMQ-83] Fix quick start, annotate setNamesrvAddr, closes apache/incubator-rocketmq#54

Posted by yu...@apache.org.
[ROCKETMQ-83] Fix quick start, annotate setNamesrvAddr, closes apache/incubator-rocketmq#54


Project: http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/commit/bd008546
Tree: http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/tree/bd008546
Diff: http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/diff/bd008546

Branch: refs/heads/release-4.0.0-incubating
Commit: bd008546b88cf862879c5ce1fb48b537d4f06f53
Parents: 7d9eac4
Author: dongeforever <zh...@yeah.net>
Authored: Fri Feb 10 16:47:33 2017 +0800
Committer: yukon <yu...@apache.org>
Committed: Fri Feb 10 16:47:33 2017 +0800

----------------------------------------------------------------------
 .../java/org/apache/rocketmq/example/quickstart/Consumer.java  | 6 +++++-
 .../java/org/apache/rocketmq/example/quickstart/Producer.java  | 6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/blob/bd008546/example/src/main/java/org/apache/rocketmq/example/quickstart/Consumer.java
----------------------------------------------------------------------
diff --git a/example/src/main/java/org/apache/rocketmq/example/quickstart/Consumer.java b/example/src/main/java/org/apache/rocketmq/example/quickstart/Consumer.java
index 58910ab..871edc2 100644
--- a/example/src/main/java/org/apache/rocketmq/example/quickstart/Consumer.java
+++ b/example/src/main/java/org/apache/rocketmq/example/quickstart/Consumer.java
@@ -42,8 +42,12 @@ public class Consumer {
          * <p/>
          *
          * Alternatively, you may specify name server addresses via exporting environmental variable: NAMESRV_ADDR
+         * <pre>
+         * {@code
+         * consumer.setNamesrvAddr("name-server1-ip:9876;name-server2-ip:9876");
+         * }
+         * </pre>
          */
-        consumer.setNamesrvAddr("name-server1-ip:9876;name-server2-ip:9876");
 
         /*
          * Specify where to start in case the specified consumer group is a brand new one.

http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/blob/bd008546/example/src/main/java/org/apache/rocketmq/example/quickstart/Producer.java
----------------------------------------------------------------------
diff --git a/example/src/main/java/org/apache/rocketmq/example/quickstart/Producer.java b/example/src/main/java/org/apache/rocketmq/example/quickstart/Producer.java
index 06e1665..53a1d4d 100644
--- a/example/src/main/java/org/apache/rocketmq/example/quickstart/Producer.java
+++ b/example/src/main/java/org/apache/rocketmq/example/quickstart/Producer.java
@@ -38,8 +38,12 @@ public class Producer {
          * <p/>
          *
          * Alternatively, you may specify name server addresses via exporting environmental variable: NAMESRV_ADDR
+         * <pre>
+         * {@code
+         * producer.setNamesrvAddr("name-server1-ip:9876;name-server2-ip:9876");
+         * }
+         * </pre>
          */
-        producer.setNamesrvAddr("name-server1-ip:9876;name-server2-ip:9876");
 
         /*
          * Launch the instance.


[2/5] incubator-rocketmq git commit: [ROCKETMQ-85] Polish bin/README file.

Posted by yu...@apache.org.
[ROCKETMQ-85] Polish bin/README file.


Project: http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/commit/7d9eac45
Tree: http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/tree/7d9eac45
Diff: http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/diff/7d9eac45

Branch: refs/heads/release-4.0.0-incubating
Commit: 7d9eac456914615d61b00794007eb826d757658c
Parents: cb4f19e
Author: yukon <yu...@apache.org>
Authored: Fri Feb 10 16:26:33 2017 +0800
Committer: yukon <yu...@apache.org>
Committed: Fri Feb 10 16:26:33 2017 +0800

----------------------------------------------------------------------
 bin/README.md | 8 --------
 1 file changed, 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/blob/7d9eac45/bin/README.md
----------------------------------------------------------------------
diff --git a/bin/README.md b/bin/README.md
index 701898e..efbb67d 100644
--- a/bin/README.md
+++ b/bin/README.md
@@ -11,10 +11,6 @@ Before deploying broker servers, it's highly recommended to run **os.sh**, which
 
   `nohup sh mqbroker &`
 
-* Windows platform\uff08Only support 64 bit\uff09
-
-  `mqbroker.exe`
-
 ### Shutdown broker
   sh mqshutdown broker
 
@@ -23,10 +19,6 @@ Before deploying broker servers, it's highly recommended to run **os.sh**, which
 
   `nohup sh mqnamesrv &`
 
-* Windows platform\uff08Only support 64 bit\uff09
-
-  `mqnamesrv.exe`
-
 ### Shutdown Nameserver
     sh mqshutdown namesrv
 


[5/5] incubator-rocketmq git commit: [ROCKETMQ-74] Fix DataVersion equals defect, closes apache/incubator-rocketmq#50

Posted by yu...@apache.org.
[ROCKETMQ-74] Fix DataVersion equals defect, closes apache/incubator-rocketmq#50


Project: http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/commit/76777583
Tree: http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/tree/76777583
Diff: http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/diff/76777583

Branch: refs/heads/release-4.0.0-incubating
Commit: 767775838fbbf556e6ebc899f4ccab7f148d7aae
Parents: 44ef40a
Author: lizhanhui <li...@gmail.com>
Authored: Fri Feb 10 17:55:04 2017 +0800
Committer: yukon <yu...@apache.org>
Committed: Fri Feb 10 17:55:04 2017 +0800

----------------------------------------------------------------------
 .../org/apache/rocketmq/common/DataVersion.java | 30 ++++++---
 .../apache/rocketmq/common/DataVersionTest.java | 70 ++++++++++++++++++++
 .../processor/DefaultRequestProcessor.java      |  4 +-
 3 files changed, 91 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/blob/76777583/common/src/main/java/org/apache/rocketmq/common/DataVersion.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/rocketmq/common/DataVersion.java b/common/src/main/java/org/apache/rocketmq/common/DataVersion.java
index 0f42e3f..e47a9b3 100644
--- a/common/src/main/java/org/apache/rocketmq/common/DataVersion.java
+++ b/common/src/main/java/org/apache/rocketmq/common/DataVersion.java
@@ -20,25 +20,25 @@ import java.util.concurrent.atomic.AtomicLong;
 import org.apache.rocketmq.remoting.protocol.RemotingSerializable;
 
 public class DataVersion extends RemotingSerializable {
-    private long timestatmp = System.currentTimeMillis();
+    private long timestamp = System.currentTimeMillis();
     private AtomicLong counter = new AtomicLong(0);
 
     public void assignNewOne(final DataVersion dataVersion) {
-        this.timestatmp = dataVersion.timestatmp;
+        this.timestamp = dataVersion.timestamp;
         this.counter.set(dataVersion.counter.get());
     }
 
     public void nextVersion() {
-        this.timestatmp = System.currentTimeMillis();
+        this.timestamp = System.currentTimeMillis();
         this.counter.incrementAndGet();
     }
 
-    public long getTimestatmp() {
-        return timestatmp;
+    public long getTimestamp() {
+        return timestamp;
     }
 
-    public void setTimestatmp(long timestatmp) {
-        this.timestatmp = timestatmp;
+    public void setTimestamp(long timestamp) {
+        this.timestamp = timestamp;
     }
 
     public AtomicLong getCounter() {
@@ -58,16 +58,24 @@ public class DataVersion extends RemotingSerializable {
 
         final DataVersion that = (DataVersion) o;
 
-        if (timestatmp != that.timestatmp)
+        if (timestamp != that.timestamp) {
             return false;
-        return counter != null ? counter.equals(that.counter) : that.counter == null;
+        }
 
+        if (counter != null && that.counter != null) {
+            return counter.longValue() == that.counter.longValue();
+        }
+
+        return (null == counter) && (null == that.counter);
     }
 
     @Override
     public int hashCode() {
-        int result = (int) (timestatmp ^ (timestatmp >>> 32));
-        result = 31 * result + (counter != null ? counter.hashCode() : 0);
+        int result = (int) (timestamp ^ (timestamp >>> 32));
+        if (null != counter) {
+            long l = counter.get();
+            result = 31 * result + (int)(l ^ (l >>> 32));
+        }
         return result;
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/blob/76777583/common/src/test/java/org/apache/rocketmq/common/DataVersionTest.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/rocketmq/common/DataVersionTest.java b/common/src/test/java/org/apache/rocketmq/common/DataVersionTest.java
new file mode 100644
index 0000000..f4d14e5
--- /dev/null
+++ b/common/src/test/java/org/apache/rocketmq/common/DataVersionTest.java
@@ -0,0 +1,70 @@
+/*
+ * 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.
+ */
+
+package org.apache.rocketmq.common;
+
+import java.util.concurrent.atomic.AtomicLong;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class DataVersionTest {
+
+    @Test
+    public void testEquals() {
+        DataVersion dataVersion = new DataVersion();
+        DataVersion other = new DataVersion();
+        other.setTimestamp(dataVersion.getTimestamp());
+        Assert.assertTrue(dataVersion.equals(other));
+    }
+
+    @Test
+    public void testEquals_falseWhenCounterDifferent() {
+        DataVersion dataVersion = new DataVersion();
+        DataVersion other = new DataVersion();
+        other.setCounter(new AtomicLong(1L));
+        other.setTimestamp(dataVersion.getTimestamp());
+        Assert.assertFalse(dataVersion.equals(other));
+    }
+
+    @Test
+    public void testEquals_falseWhenCounterDifferent2() {
+        DataVersion dataVersion = new DataVersion();
+        DataVersion other = new DataVersion();
+        other.setCounter(null);
+        other.setTimestamp(dataVersion.getTimestamp());
+        Assert.assertFalse(dataVersion.equals(other));
+    }
+
+    @Test
+    public void testEquals_falseWhenCounterDifferent3() {
+        DataVersion dataVersion = new DataVersion();
+        dataVersion.setCounter(null);
+        DataVersion other = new DataVersion();
+        other.setTimestamp(dataVersion.getTimestamp());
+        Assert.assertFalse(dataVersion.equals(other));
+    }
+
+    @Test
+    public void testEquals_trueWhenCountersBothNull() {
+        DataVersion dataVersion = new DataVersion();
+        dataVersion.setCounter(null);
+        DataVersion other = new DataVersion();
+        other.setCounter(null);
+        other.setTimestamp(dataVersion.getTimestamp());
+        Assert.assertTrue(dataVersion.equals(other));
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/blob/76777583/namesrv/src/main/java/org/apache/rocketmq/namesrv/processor/DefaultRequestProcessor.java
----------------------------------------------------------------------
diff --git a/namesrv/src/main/java/org/apache/rocketmq/namesrv/processor/DefaultRequestProcessor.java b/namesrv/src/main/java/org/apache/rocketmq/namesrv/processor/DefaultRequestProcessor.java
index b6db7e0..9647684 100644
--- a/namesrv/src/main/java/org/apache/rocketmq/namesrv/processor/DefaultRequestProcessor.java
+++ b/namesrv/src/main/java/org/apache/rocketmq/namesrv/processor/DefaultRequestProcessor.java
@@ -191,7 +191,7 @@ public class DefaultRequestProcessor implements NettyRequestProcessor {
             registerBrokerBody = RegisterBrokerBody.decode(request.getBody(), RegisterBrokerBody.class);
         } else {
             registerBrokerBody.getTopicConfigSerializeWrapper().getDataVersion().setCounter(new AtomicLong(0));
-            registerBrokerBody.getTopicConfigSerializeWrapper().getDataVersion().setTimestatmp(0);
+            registerBrokerBody.getTopicConfigSerializeWrapper().getDataVersion().setTimestamp(0);
         }
 
         RegisterBrokerResult result = this.namesrvController.getRouteInfoManager().registerBroker(
@@ -227,7 +227,7 @@ public class DefaultRequestProcessor implements NettyRequestProcessor {
         } else {
             topicConfigWrapper = new TopicConfigSerializeWrapper();
             topicConfigWrapper.getDataVersion().setCounter(new AtomicLong(0));
-            topicConfigWrapper.getDataVersion().setTimestatmp(0);
+            topicConfigWrapper.getDataVersion().setTimestamp(0);
         }
 
         RegisterBrokerResult result = this.namesrvController.getRouteInfoManager().registerBroker(