[GitHub] incubator-rocketmq pull request #34: [ROCKETMQ-39] avoid duplicated codes.

2017-01-20 Thread WillemJiang
Github user WillemJiang commented on a diff in the pull request:

https://github.com/apache/incubator-rocketmq/pull/34#discussion_r97189548
  
--- Diff: 
filtersrv/src/main/java/org/apache/rocketmq/filtersrv/FiltersrvStartup.java ---
@@ -139,7 +139,7 @@ public static FiltersrvController 
createController(String[] args) {
 
 Runtime.getRuntime().addShutdownHook(new 
ShutdownHookThread(log, new Callable() {
 @Override
-public Object call() throws Exception {
+public Void call() throws Exception {
 controller.shutdown();
 return null;
--- End diff --

When use the Void as the return signature, you don't need to use return in 
the function.  
Please remove the line of 144.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-rocketmq pull request #47: [ROCKETMQ-69]Add link to README.md for ...

2017-01-20 Thread WillemJiang
Github user WillemJiang commented on a diff in the pull request:

https://github.com/apache/incubator-rocketmq/pull/47#discussion_r97189480
  
--- Diff: README.md ---
@@ -22,6 +22,7 @@ It offers a variety of features as follows:
 --
 
 ## Learn it & Contact us
+* Home: [https://rocketmq.apache.org](https://rocketmq.apache.org)
--- End diff --

It could be better to use <> instead of []() , as we don't need to change 
the display discription here.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-rocketmq pull request #34: fix/ROCKETMQ-39: avoid duplicated codes...

2017-01-11 Thread WillemJiang
Github user WillemJiang commented on a diff in the pull request:

https://github.com/apache/incubator-rocketmq/pull/34#discussion_r95544500
  
--- Diff: 
filtersrv/src/main/java/org/apache/rocketmq/filtersrv/FiltersrvStartup.java ---
@@ -135,27 +137,17 @@ public static FiltersrvController 
createController(String[] args) {
 System.exit(-3);
 }
 
-Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() 
{
-private volatile boolean hasShutdown = false;
-private AtomicInteger shutdownTimes = new AtomicInteger(0);
-
+Runtime.getRuntime().addShutdownHook(new 
ShutdownHookThread(log, new Callable() {
 @Override
-public void run() {
-synchronized (this) {
-log.info("shutdown hook was invoked, " + 
this.shutdownTimes.incrementAndGet());
-if (!this.hasShutdown) {
-this.hasShutdown = true;
-long begineTime = System.currentTimeMillis();
-controller.shutdown();
-long consumingTimeTotal = 
System.currentTimeMillis() - begineTime;
-log.info("shutdown hook over, consuming time 
total(ms): " + consumingTimeTotal);
-}
-}
+public Object call() throws Exception {
--- End diff --

If you don't want to return any thing here , you could define the method 
just like this.
public Void call() throws Exception {
}


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---