You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by kevin-better <gi...@git.apache.org> on 2017/08/23 03:30:09 UTC

[GitHub] incubator-rocketmq pull request #150: * return an expression when a function...

GitHub user kevin-better opened a pull request:

    https://github.com/apache/incubator-rocketmq/pull/150

    * return an expression when a function has no write operations.

    what about return an expression when a function has no write operations?

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/kevin-better/incubator-rocketmq develop

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-rocketmq/pull/150.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #150
    
----
commit e33b3bd59f4ca8e31d886eda114f3daf0b09b1a9
Author: wangkai <87...@qq.com>
Date:   2017-08-23T03:26:03Z

    * return an expression when a function has no write operations.

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rocketmq issue #150: [ROCKETMQ-273] return an expression when a fu...

Posted by coveralls <gi...@git.apache.org>.
Github user coveralls commented on the issue:

    https://github.com/apache/incubator-rocketmq/pull/150
  
    
    [![Coverage Status](https://coveralls.io/builds/12968394/badge)](https://coveralls.io/builds/12968394)
    
    Coverage increased (+0.01%) to 39.044% when pulling **752aeb5f56807794fa2706917c3bbb0930411c19 on kevin-better:develop** into **ca14a2d474b6c71143944ec95f7c28e23e15632d on apache:develop**.



---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rocketmq issue #150: [ROCKETMQ-273] return an expression when a fu...

Posted by kevin-better <gi...@git.apache.org>.
Github user kevin-better commented on the issue:

    https://github.com/apache/incubator-rocketmq/pull/150
  
    @dongeforever  ok


---

[GitHub] incubator-rocketmq issue #150: [ROCKETMQ-273] return an expression when a fu...

Posted by dongeforever <gi...@git.apache.org>.
Github user dongeforever commented on the issue:

    https://github.com/apache/incubator-rocketmq/pull/150
  
    @kevin-better This PR has been merged. You may close it now.


---

[GitHub] incubator-rocketmq pull request #150: [ROCKETMQ-273] return an expression wh...

Posted by kevin-better <gi...@git.apache.org>.
Github user kevin-better commented on a diff in the pull request:

    https://github.com/apache/incubator-rocketmq/pull/150#discussion_r134944925
  
    --- Diff: store/src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java ---
    @@ -1094,34 +1090,15 @@ private boolean checkInDiskByCommitOffset(long offsetPy, long maxOffsetPy) {
         }
     
         private boolean isTheBatchFull(int sizePy, int maxMsgNums, int bufferTotal, int messageTotal, boolean isInDisk) {
    -
    -        if (0 == bufferTotal || 0 == messageTotal) {
    -            return false;
    -        }
    -
    -        if (maxMsgNums <= messageTotal) {
    -            return true;
    -        }
    -
    -        if (isInDisk) {
    -            if ((bufferTotal + sizePy) > this.messageStoreConfig.getMaxTransferBytesOnMessageInDisk()) {
    -                return true;
    -            }
    -
    -            if (messageTotal > this.messageStoreConfig.getMaxTransferCountOnMessageInDisk() - 1) {
    -                return true;
    -            }
    -        } else {
    -            if ((bufferTotal + sizePy) > this.messageStoreConfig.getMaxTransferBytesOnMessageInMemory()) {
    -                return true;
    -            }
    -
    -            if (messageTotal > this.messageStoreConfig.getMaxTransferCountOnMessageInMemory() - 1) {
    -                return true;
    -            }
    -        }
    -
    -        return false;
    +        return    (0 != bufferTotal && 0 != messageTotal)
    --- End diff --
    
    ok , only alter function isOSPageCacheBusy


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rocketmq issue #150: * return an expression when a function has no...

Posted by kevin-better <gi...@git.apache.org>.
Github user kevin-better commented on the issue:

    https://github.com/apache/incubator-rocketmq/pull/150
  
    @lindzh  ok


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rocketmq pull request #150: [ROCKETMQ-273] return an expression wh...

Posted by kevin-better <gi...@git.apache.org>.
Github user kevin-better closed the pull request at:

    https://github.com/apache/incubator-rocketmq/pull/150


---

[GitHub] incubator-rocketmq pull request #150: [ROCKETMQ-273] return an expression wh...

Posted by kevin-better <gi...@git.apache.org>.
Github user kevin-better commented on a diff in the pull request:

    https://github.com/apache/incubator-rocketmq/pull/150#discussion_r139874392
  
    --- Diff: store/src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java ---
    @@ -1094,34 +1090,15 @@ private boolean checkInDiskByCommitOffset(long offsetPy, long maxOffsetPy) {
         }
     
         private boolean isTheBatchFull(int sizePy, int maxMsgNums, int bufferTotal, int messageTotal, boolean isInDisk) {
    -
    -        if (0 == bufferTotal || 0 == messageTotal) {
    -            return false;
    -        }
    -
    -        if (maxMsgNums <= messageTotal) {
    -            return true;
    -        }
    -
    -        if (isInDisk) {
    -            if ((bufferTotal + sizePy) > this.messageStoreConfig.getMaxTransferBytesOnMessageInDisk()) {
    -                return true;
    -            }
    -
    -            if (messageTotal > this.messageStoreConfig.getMaxTransferCountOnMessageInDisk() - 1) {
    -                return true;
    -            }
    -        } else {
    -            if ((bufferTotal + sizePy) > this.messageStoreConfig.getMaxTransferBytesOnMessageInMemory()) {
    -                return true;
    -            }
    -
    -            if (messageTotal > this.messageStoreConfig.getMaxTransferCountOnMessageInMemory() - 1) {
    -                return true;
    -            }
    -        }
    -
    -        return false;
    +        return   (0 != bufferTotal && 0 != messageTotal)
    +                &&(
    --- End diff --
    
    It has been restored


---

[GitHub] incubator-rocketmq pull request #150: [ROCKETMQ-273] return an expression wh...

Posted by lizhanhui <gi...@git.apache.org>.
Github user lizhanhui commented on a diff in the pull request:

    https://github.com/apache/incubator-rocketmq/pull/150#discussion_r134941070
  
    --- Diff: store/src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java ---
    @@ -1094,34 +1090,15 @@ private boolean checkInDiskByCommitOffset(long offsetPy, long maxOffsetPy) {
         }
     
         private boolean isTheBatchFull(int sizePy, int maxMsgNums, int bufferTotal, int messageTotal, boolean isInDisk) {
    -
    -        if (0 == bufferTotal || 0 == messageTotal) {
    -            return false;
    -        }
    -
    -        if (maxMsgNums <= messageTotal) {
    -            return true;
    -        }
    -
    -        if (isInDisk) {
    -            if ((bufferTotal + sizePy) > this.messageStoreConfig.getMaxTransferBytesOnMessageInDisk()) {
    -                return true;
    -            }
    -
    -            if (messageTotal > this.messageStoreConfig.getMaxTransferCountOnMessageInDisk() - 1) {
    -                return true;
    -            }
    -        } else {
    -            if ((bufferTotal + sizePy) > this.messageStoreConfig.getMaxTransferBytesOnMessageInMemory()) {
    -                return true;
    -            }
    -
    -            if (messageTotal > this.messageStoreConfig.getMaxTransferCountOnMessageInMemory() - 1) {
    -                return true;
    -            }
    -        }
    -
    -        return false;
    +        return    (0 != bufferTotal && 0 != messageTotal)
    --- End diff --
    
    This one looks too complex to understand...I suggest to keep the original look-and-feel.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rocketmq issue #150: [ROCKETMQ-273] return an expression when a fu...

Posted by kevin-better <gi...@git.apache.org>.
Github user kevin-better commented on the issue:

    https://github.com/apache/incubator-rocketmq/pull/150
  
    @vsair change style of this code .
    eg: if(true) return true; change to return true;


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rocketmq issue #150: [ROCKETMQ-273] return an expression when a fu...

Posted by kevin-better <gi...@git.apache.org>.
Github user kevin-better commented on the issue:

    https://github.com/apache/incubator-rocketmq/pull/150
  
    Travis CI build log ,is there something wrong ? : 
    
    [https://travis-ci.org/apache/incubator-rocketmq/jobs/267873150](https://travis-ci.org/apache/incubator-rocketmq/jobs/267873150)
    
    $ mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
    Error: JAVA_HOME is not defined correctly.
      We cannot execute /usr/lib/jvm/java-7-oracle/bin/java
    The command "eval mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V " failed. Retrying, 2 of 3.
    Error: JAVA_HOME is not defined correctly.
      We cannot execute /usr/lib/jvm/java-7-oracle/bin/java
    The command "eval mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V " failed. Retrying, 3 of 3.
    Error: JAVA_HOME is not defined correctly.
      We cannot execute /usr/lib/jvm/java-7-oracle/bin/java
    The command "eval mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V " failed 3 times.
    The command "mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V" failed and exited with 1 during .
    Your build has been stopped.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rocketmq issue #150: [ROCKETMQ-273] return an expression when a fu...

Posted by kevin-better <gi...@git.apache.org>.
Github user kevin-better commented on the issue:

    https://github.com/apache/incubator-rocketmq/pull/150
  
    @lindzh this is my first time to create an issue on jira,what will I do on next ?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rocketmq issue #150: [ROCKETMQ-273] return an expression when a fu...

Posted by vsair <gi...@git.apache.org>.
Github user vsair commented on the issue:

    https://github.com/apache/incubator-rocketmq/pull/150
  
    what is the purpose of this issue?  it confused me.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rocketmq pull request #150: [ROCKETMQ-273] return an expression wh...

Posted by vongosling <gi...@git.apache.org>.
Github user vongosling commented on a diff in the pull request:

    https://github.com/apache/incubator-rocketmq/pull/150#discussion_r139873296
  
    --- Diff: store/src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java ---
    @@ -1094,34 +1090,15 @@ private boolean checkInDiskByCommitOffset(long offsetPy, long maxOffsetPy) {
         }
     
         private boolean isTheBatchFull(int sizePy, int maxMsgNums, int bufferTotal, int messageTotal, boolean isInDisk) {
    -
    -        if (0 == bufferTotal || 0 == messageTotal) {
    -            return false;
    -        }
    -
    -        if (maxMsgNums <= messageTotal) {
    -            return true;
    -        }
    -
    -        if (isInDisk) {
    -            if ((bufferTotal + sizePy) > this.messageStoreConfig.getMaxTransferBytesOnMessageInDisk()) {
    -                return true;
    -            }
    -
    -            if (messageTotal > this.messageStoreConfig.getMaxTransferCountOnMessageInDisk() - 1) {
    -                return true;
    -            }
    -        } else {
    -            if ((bufferTotal + sizePy) > this.messageStoreConfig.getMaxTransferBytesOnMessageInMemory()) {
    -                return true;
    -            }
    -
    -            if (messageTotal > this.messageStoreConfig.getMaxTransferCountOnMessageInMemory() - 1) {
    -                return true;
    -            }
    -        }
    -
    -        return false;
    +        return   (0 != bufferTotal && 0 != messageTotal)
    +                &&(
    --- End diff --
    
    Human readable problem


---

[GitHub] incubator-rocketmq issue #150: * return an expression when a function has no...

Posted by lindzh <gi...@git.apache.org>.
Github user lindzh commented on the issue:

    https://github.com/apache/incubator-rocketmq/pull/150
  
    Thanks for contribution.
    Please add a jira issue and modify the pr title to make it complete 


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rocketmq issue #150: [ROCKETMQ-273] return an expression when a fu...

Posted by coveralls <gi...@git.apache.org>.
Github user coveralls commented on the issue:

    https://github.com/apache/incubator-rocketmq/pull/150
  
    
    [![Coverage Status](https://coveralls.io/builds/12949746/badge)](https://coveralls.io/builds/12949746)
    
    Coverage increased (+0.04%) to 39.068% when pulling **45f692cff6382483e2d9ef4ac481ca3523e0816c on kevin-better:develop** into **ca14a2d474b6c71143944ec95f7c28e23e15632d on apache:develop**.



---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---