GitHub user jiafu1115 opened a pull request: https://github.com/apache/cassandra/pull/62
remove duplicated control for flush mesage control Motivation: the !doneWork's control is duplicated and confused with runsSinceFlush > 2 if on the first run:the queue size is 20 donework will be set to true and not do flush due to the size<50 and runsSinceFlush<2. if on the second run. the queue size is 0, donework will be reset to false and not set to true due to no new items in queue, but the flush will be triggered due to: if (!doneWork || runsSinceFlush > 2 || flushed.size() > 50) now the runsSinceFlush is 2. so in actual, its function is similar with runsSinceFlush>1. so it is no need to keep it so that the code is confused and duplicated. Modifications: remove it Result: after remove it, it will more clear and no confused. You can merge this pull request into a Git repository by running: $ git pull https://github.com/jiafu1115/cassandra trunk Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cassandra/pull/62.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 #62 ---- commit 5279884e6a392d36b4adc5e29f9ca5d0666cb275 Author: fu.jian <fujian1...@gmail.com> Date: 2016-01-26T01:20:05Z remove duplicated control for flush mesage control Motivation: the !doneWork's control is duplicated and confused with runsSinceFlush > 2 if on the first run:the queue size is 20 donework will be set to true and not do flush due to the size<50 and runsSinceFlush<2. if on the second run. the queue size is 0, donework will be reset to false and not set to true due to no new items in queue, but the flush will be triggered due to: if (!doneWork || runsSinceFlush > 2 || flushed.size() > 50) now the runsSinceFlush is 2. so in actual, its function is similar with runsSinceFlush>1. so it is no need to keep it so that the code is confused and duplicated. Modifications: remove it Result: after remove it, it will more clear and no confused. ---- --- 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. ---