[ 
https://issues.apache.org/jira/browse/SAMZA-94?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13839735#comment-13839735
 ] 

Jakob Homan commented on SAMZA-94:
----------------------------------

The expected annotation on the test is the standard way: 
http://junit.sourceforge.net/javadoc/org/junit/Test.html but has problems in 
that you can't be completely sure that the line you expected to generate the 
exception is the one that did, nor can you compare text in the exception 
message, which would be nice.


> State management kv-store delete() does not remove key
> ------------------------------------------------------
>
>                 Key: SAMZA-94
>                 URL: https://issues.apache.org/jira/browse/SAMZA-94
>             Project: Samza
>          Issue Type: Bug
>          Components: kv
>    Affects Versions: 0.6.0
>            Reporter: Alan Li
>            Assignee: Chris Riccomini
>             Fix For: 0.7.0
>
>         Attachments: SAMZA-94.0.patch
>
>
> Sample code snippet: 
> {noformat}
>     _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();
> {noformat}
> 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.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to