[jira] [Commented] (KAFKA-5967) Ineffective check of negative value in CompositeReadOnlyKeyValueStore#approximateNumEntries()
[ https://issues.apache.org/jira/browse/KAFKA-5967?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16191597#comment-16191597 ] ASF GitHub Bot commented on KAFKA-5967: --- Github user asfgit closed the pull request at: https://github.com/apache/kafka/pull/3988 > Ineffective check of negative value in > CompositeReadOnlyKeyValueStore#approximateNumEntries() > - > > Key: KAFKA-5967 > URL: https://issues.apache.org/jira/browse/KAFKA-5967 > Project: Kafka > Issue Type: Bug >Affects Versions: 0.11.0.1 >Reporter: Ted Yu >Assignee: siva santhalingam >Priority: Minor > Labels: beginner, newbie > Fix For: 1.0.0, 0.11.0.2 > > > {code} > long total = 0; > for (ReadOnlyKeyValueStorestore : stores) { > total += store.approximateNumEntries(); > } > return total < 0 ? Long.MAX_VALUE : total; > {code} > The check for negative value seems to account for wrapping. > However, wrapping can happen within the for loop. So the check should be > performed inside the loop. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (KAFKA-5967) Ineffective check of negative value in CompositeReadOnlyKeyValueStore#approximateNumEntries()
[ https://issues.apache.org/jira/browse/KAFKA-5967?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16185167#comment-16185167 ] Matthias J. Sax commented on KAFKA-5967: It's correct. But I did not see any email from you. You need to subscribe to the list first I think: http://kafka.apache.org/contact > Ineffective check of negative value in > CompositeReadOnlyKeyValueStore#approximateNumEntries() > - > > Key: KAFKA-5967 > URL: https://issues.apache.org/jira/browse/KAFKA-5967 > Project: Kafka > Issue Type: Bug >Reporter: Ted Yu >Priority: Minor > Labels: beginner, newbie > > {code} > long total = 0; > for (ReadOnlyKeyValueStorestore : stores) { > total += store.approximateNumEntries(); > } > return total < 0 ? Long.MAX_VALUE : total; > {code} > The check for negative value seems to account for wrapping. > However, wrapping can happen within the for loop. So the check should be > performed inside the loop. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (KAFKA-5967) Ineffective check of negative value in CompositeReadOnlyKeyValueStore#approximateNumEntries()
[ https://issues.apache.org/jira/browse/KAFKA-5967?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16185128#comment-16185128 ] siva santhalingam commented on KAFKA-5967: -- [~mjsax] I sent an email to d...@kafka.apache.org. Please let me know if thats the right email alias. Thanks! > Ineffective check of negative value in > CompositeReadOnlyKeyValueStore#approximateNumEntries() > - > > Key: KAFKA-5967 > URL: https://issues.apache.org/jira/browse/KAFKA-5967 > Project: Kafka > Issue Type: Bug >Reporter: Ted Yu >Priority: Minor > Labels: beginner, newbie > > {code} > long total = 0; > for (ReadOnlyKeyValueStorestore : stores) { > total += store.approximateNumEntries(); > } > return total < 0 ? Long.MAX_VALUE : total; > {code} > The check for negative value seems to account for wrapping. > However, wrapping can happen within the for loop. So the check should be > performed inside the loop. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (KAFKA-5967) Ineffective check of negative value in CompositeReadOnlyKeyValueStore#approximateNumEntries()
[ https://issues.apache.org/jira/browse/KAFKA-5967?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16185119#comment-16185119 ] ASF GitHub Bot commented on KAFKA-5967: --- GitHub user shivsantham opened a pull request: https://github.com/apache/kafka/pull/3988 KAFKA-5967 Ineffective check of negative value in CompositeReadOnlyKe… package name: org.apache.kafka.streams.state.internals Minor change to approximateNumEntries() method in CompositeReadOnlyKeyValueStore class. long total = 0; for (ReadOnlyKeyValueStorestore : stores) { total += store.approximateNumEntries(); } return total < 0 ? Long.MAX_VALUE : total; The check for negative value seems to account for wrapping. However, wrapping can happen within the for loop. So the check should be performed inside the loop. You can merge this pull request into a Git repository by running: $ git pull https://github.com/shivsantham/kafka trunk Alternatively you can review and apply these changes as the patch at: https://github.com/apache/kafka/pull/3988.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 #3988 commit ff377759a943c7bfb89a56ad721e7ba1b3b0b24c Author: siva santhalingam Date: 2017-09-28T23:37:47Z KAFKA-5967 Ineffective check of negative value in CompositeReadOnlyKeyValueStore#approximateNumEntries() long total = 0; for (ReadOnlyKeyValueStore store : stores) { total += store.approximateNumEntries(); } return total < 0 ? Long.MAX_VALUE : total; The check for negative value seems to account for wrapping. However, wrapping can happen within the for loop. So the check should be performed inside the loop. > Ineffective check of negative value in > CompositeReadOnlyKeyValueStore#approximateNumEntries() > - > > Key: KAFKA-5967 > URL: https://issues.apache.org/jira/browse/KAFKA-5967 > Project: Kafka > Issue Type: Bug >Reporter: Ted Yu >Priority: Minor > Labels: beginner, newbie > > {code} > long total = 0; > for (ReadOnlyKeyValueStore store : stores) { > total += store.approximateNumEntries(); > } > return total < 0 ? Long.MAX_VALUE : total; > {code} > The check for negative value seems to account for wrapping. > However, wrapping can happen within the for loop. So the check should be > performed inside the loop. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (KAFKA-5967) Ineffective check of negative value in CompositeReadOnlyKeyValueStore#approximateNumEntries()
[ https://issues.apache.org/jira/browse/KAFKA-5967?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16184797#comment-16184797 ] Matthias J. Sax commented on KAFKA-5967: [~sssanthalingam] Please send an email with you user name to Kafka dev list and ask to be added to contributors list. Than you can assign to yourself. > Ineffective check of negative value in > CompositeReadOnlyKeyValueStore#approximateNumEntries() > - > > Key: KAFKA-5967 > URL: https://issues.apache.org/jira/browse/KAFKA-5967 > Project: Kafka > Issue Type: Bug >Reporter: Ted Yu >Priority: Minor > Labels: beginner, newbie > > {code} > long total = 0; > for (ReadOnlyKeyValueStorestore : stores) { > total += store.approximateNumEntries(); > } > return total < 0 ? Long.MAX_VALUE : total; > {code} > The check for negative value seems to account for wrapping. > However, wrapping can happen within the for loop. So the check should be > performed inside the loop. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (KAFKA-5967) Ineffective check of negative value in CompositeReadOnlyKeyValueStore#approximateNumEntries()
[ https://issues.apache.org/jira/browse/KAFKA-5967?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16184644#comment-16184644 ] Ted Yu commented on KAFKA-5967: --- Once you send out pull request, a committer would assign to you. > Ineffective check of negative value in > CompositeReadOnlyKeyValueStore#approximateNumEntries() > - > > Key: KAFKA-5967 > URL: https://issues.apache.org/jira/browse/KAFKA-5967 > Project: Kafka > Issue Type: Bug >Reporter: Ted Yu >Priority: Minor > Labels: beginner, newbie > > {code} > long total = 0; > for (ReadOnlyKeyValueStorestore : stores) { > total += store.approximateNumEntries(); > } > return total < 0 ? Long.MAX_VALUE : total; > {code} > The check for negative value seems to account for wrapping. > However, wrapping can happen within the for loop. So the check should be > performed inside the loop. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (KAFKA-5967) Ineffective check of negative value in CompositeReadOnlyKeyValueStore#approximateNumEntries()
[ https://issues.apache.org/jira/browse/KAFKA-5967?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16184626#comment-16184626 ] siva santhalingam commented on KAFKA-5967: -- [~te...@apache.org] Could you please assign this to me, looks like i dont have access to assign this to myself. > Ineffective check of negative value in > CompositeReadOnlyKeyValueStore#approximateNumEntries() > - > > Key: KAFKA-5967 > URL: https://issues.apache.org/jira/browse/KAFKA-5967 > Project: Kafka > Issue Type: Bug >Reporter: Ted Yu >Priority: Minor > Labels: beginner, newbie > > {code} > long total = 0; > for (ReadOnlyKeyValueStorestore : stores) { > total += store.approximateNumEntries(); > } > return total < 0 ? Long.MAX_VALUE : total; > {code} > The check for negative value seems to account for wrapping. > However, wrapping can happen within the for loop. So the check should be > performed inside the loop. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (KAFKA-5967) Ineffective check of negative value in CompositeReadOnlyKeyValueStore#approximateNumEntries()
[ https://issues.apache.org/jira/browse/KAFKA-5967?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16184607#comment-16184607 ] siva santhalingam commented on KAFKA-5967: -- [~te...@apache.org] Can i assign this to myself? > Ineffective check of negative value in > CompositeReadOnlyKeyValueStore#approximateNumEntries() > - > > Key: KAFKA-5967 > URL: https://issues.apache.org/jira/browse/KAFKA-5967 > Project: Kafka > Issue Type: Bug >Reporter: Ted Yu >Priority: Minor > Labels: beginner, newbie > > {code} > long total = 0; > for (ReadOnlyKeyValueStorestore : stores) { > total += store.approximateNumEntries(); > } > return total < 0 ? Long.MAX_VALUE : total; > {code} > The check for negative value seems to account for wrapping. > However, wrapping can happen within the for loop. So the check should be > performed inside the loop. -- This message was sent by Atlassian JIRA (v6.4.14#64029)