Uploaded image for project: 'Samza'
  1. Samza
  2. SAMZA-321

LevelDbKeyValueStore range seems to be broken

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • None
    • 0.8.0
    • kv
    • None

    Description

      The current implementation does this by returning an instance of:

      LevelDbRangeIterator.

      This custom iterator implements the range (from, to) by only guarding the hasNext function. This means that as long as the caller calls hasNext before a next, everything will work fine.

      However, if the caller invokes next() directly, then the range is not obeyed. Essentially, we can retrieve elements beyond the specified range (all the way to the end).

      I tested this by tweaking testRange function of TestKeyValueStores

      • Get an iterator over a defined range (f to u)
      • Display all the values using only iter.next (until we get an exception)

      This method printed all the values from 'f' to 'z' instead of 'f' to 'u'

      Attachments

        1. samza_321.patch
          1 kB
          Chinmay Soman

        Activity

          People

            cpsoman Chinmay Soman
            cpsoman Chinmay Soman
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: