Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-5967

Ineffective check of negative value in CompositeReadOnlyKeyValueStore#approximateNumEntries()

    XMLWordPrintableJSON

Details

    Description

              long total = 0;
              for (ReadOnlyKeyValueStore<K, V> 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.

      Attachments

        Issue Links

          Activity

            People

              sssanthalingam siva santhalingam
              yuzhihong@gmail.com Ted Yu
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: