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

State management kv-store delete() does not remove key

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.6.0
    • Fix Version/s: 0.7.0
    • Component/s: kv
    • Labels:
      None

      Description

      Sample code snippet:

          _realtimeStateStore.put("foo", new HashMap());
          
          KeyValueIterator<String, Map<String, State>> realtimeIterator = _realtimeStateStore.all();
          while (realtimeIterator.hasNext())
          {
            Entry<String, Map<String, State>> entry = realtimeIterator.next();
            System.out.println("read from leveldb: " + entry.getKey() + "=>" + entry.getValue());
          }
          realtimeIterator.close();
          
          _realtimeStateStore.delete("foo");
          
          KeyValueIterator<String, Map<String, State>> iter = _realtimeStateStore.all();
          while (iter.hasNext())
          {
            Entry<String, Map<String, State>> entry = iter.next();
            System.out.println("read from leveldb: " + entry.getKey() + "=>" + entry.getValue());
          }
          iter.close();
      

      Output:
      read from leveldb: foo=>{}
      read from leveldb: foo=>null

      I would expect that the kv would remove both the key & value on delete so that subsequent iterators will not return keys that have been deleted.

        Attachments

        1. SAMZA-94.1.patch
          10 kB
          Chris Riccomini
        2. SAMZA-94.0.patch
          6 kB
          Chris Riccomini

          Activity

            People

            • Assignee:
              criccomini Chris Riccomini
              Reporter:
              alanwli Alan Li
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: