I am having this issues with the java driver :<div><a href="https://github.com/krestenkrab/riak-java-pb-client">https://github.com/krestenkrab/riak-java-pb-client</a></div><div><br></div><div>After deleting a key the listKeys method still return it.<br>

<div>The following test case put and delete one simple key and fails when counting the listKeys item.</div><div><br></div><div>Any Suggestion?</div><div><br></div><div><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<title></title>
<meta name="Generator" content="Cocoa HTML Writer">
<meta name="CocoaVersion" content="1038.35">
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Monaco}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Monaco; min-height: 16.0px}
p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Monaco; color: #4239f5}
p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Monaco; color: #777777}
p.p5 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Monaco; color: #991664}
span.s1 {color: #991664}
span.s2 {color: #132bc3}
span.s3 {color: #000000}
span.s4 {color: #4239f5}
span.s5 {text-decoration: underline}
span.Apple-tab-span {white-space:pre}
</style>


<p class="p1"><span class="s1">public</span> <span class="s1">class</span> RiakCacheTest <span class="s1">extends</span> TestCase {</p>
<p class="p2"><span class="Apple-tab-span">     </span></p>
<p class="p1"><span class="Apple-tab-span">     </span><span class="s1">private</span> RiakClient <span class="s2">rc</span>;</p>
<p class="p3"><span class="s3"><span class="Apple-tab-span">    </span></span><span class="s1">private</span><span class="s3"> String </span><span class="s2">host</span><span class="s3"> = </span>"172.16.194.134"<span class="s3">;</span></p>


<p class="p1"><span class="Apple-tab-span">     </span><span class="s1">private</span> <span class="s1">int</span> <span class="s2">port</span> = 8087;</p>
<p class="p1"><span class="Apple-tab-span">     </span><span class="s1">private</span> String <span class="s2">bucket</span> = <span class="s4">"bucket"</span>;</p>
<p class="p2"><span class="Apple-tab-span">     </span></p>
<p class="p2"><span class="Apple-tab-span">     </span></p>
<p class="p4"><span class="s3"><span class="Apple-tab-span">    </span></span>@Override</p>
<p class="p1"><span class="Apple-tab-span">     </span><span class="s1">protected</span> <span class="s1">void</span> setUp() <span class="s1">throws</span> Exception {</p>
<p class="p1"><span class="Apple-tab-span">     </span><span class="Apple-tab-span">      </span><span class="s2">rc</span> = <span class="s1">new</span> RiakClient(<span class="s1">this</span>.<span class="s2">host</span>,<span class="s1">this</span>.<span class="s2">port</span>);</p>


<p class="p1"><span class="Apple-tab-span">     </span><span class="Apple-tab-span">      </span><span class="s2">rc</span>.setClientID(<span class="s1">this</span>.getClass().toString());</p>
<p class="p1"><span class="Apple-tab-span">     </span>}</p>
<p class="p2"><span class="Apple-tab-span">     </span></p>
<p class="p2"><span class="Apple-tab-span">     </span></p>
<p class="p1"><span class="Apple-tab-span">     </span><span class="s1">public</span> <span class="s1">void</span> testRemove(){</p>
<p class="p1"><span class="Apple-tab-span">     </span><span class="Apple-tab-span">      </span>String key = <span class="s4">"key"</span>;</p>
<p class="p1"><span class="Apple-tab-span">     </span><span class="Apple-tab-span">      </span>String value = <span class="s4">"Andrea"</span>;</p>
<p class="p2"><span class="Apple-tab-span">     </span><span class="Apple-tab-span">      </span></p>
<p class="p1"><span class="Apple-tab-span">     </span><span class="Apple-tab-span">      </span>RiakObject obj = <span class="s1">new</span> RiakObject(<span class="s1">this</span>.<span class="s2">bucket</span>, key, value);</p>


<p class="p2"><span class="Apple-tab-span">     </span><span class="Apple-tab-span">      </span></p>
<p class="p1"><span class="Apple-tab-span">     </span><span class="Apple-tab-span">      </span><span class="s1">try</span>{</p>
<p class="p1"><span class="Apple-tab-span">     </span><span class="Apple-tab-span">      </span><span class="Apple-tab-span">      </span><span class="s1">this</span>.<span class="s2">rc</span>.store(obj);<span class="Apple-tab-span">       </span><span class="Apple-tab-span">      </span><span class="Apple-tab-span">      </span></p>


<p class="p1"><span class="Apple-tab-span">     </span><span class="Apple-tab-span">      </span><span class="Apple-tab-span">      </span>assertTrue(getValue(key).equals(value));</p>
<p class="p1"><span class="Apple-tab-span">     </span><span class="Apple-tab-span">      </span><span class="Apple-tab-span">      </span>assertEquals(keys().size(),1);</p>
<p class="p2"><span class="Apple-tab-span">     </span><span class="Apple-tab-span">      </span><span class="Apple-tab-span">      </span></p>
<p class="p1"><span class="Apple-tab-span">     </span><span class="Apple-tab-span">      </span><span class="Apple-tab-span">      </span><span class="s1">this</span>.<span class="s2">rc</span>.delete(<span class="s1">this</span>.<span class="s2">bucket</span>, key);</p>


<p class="p1"><span class="Apple-tab-span">     </span><span class="Apple-tab-span">      </span><span class="Apple-tab-span">      </span>assertNull(getValue(key));</p>
<p class="p1"><span class="Apple-tab-span">     </span><span class="Apple-tab-span">      </span><span class="Apple-tab-span">      </span>assertEquals(keys().size(),0);</p>
<p class="p2"><span class="Apple-tab-span">     </span><span class="Apple-tab-span">      </span><span class="Apple-tab-span">      </span></p>
<p class="p1"><span class="Apple-tab-span">     </span><span class="Apple-tab-span">      </span>}<span class="s1">catch</span>(IOException e){</p>
<p class="p1"><span class="Apple-tab-span">     </span><span class="Apple-tab-span">      </span><span class="Apple-tab-span">      </span>e.printStackTrace();</p>
<p class="p1"><span class="Apple-tab-span">     </span><span class="Apple-tab-span">      </span>}</p>
<p class="p2"><span class="Apple-tab-span">     </span><span class="Apple-tab-span">      </span></p>
<p class="p1"><span class="Apple-tab-span">     </span>}</p>
<p class="p2"><span class="Apple-tab-span">     </span></p>
<p class="p1"><span class="Apple-tab-span">     </span><span class="s1">private</span> String getValue(String key){</p>
<p class="p1"><span class="Apple-tab-span">     </span><span class="Apple-tab-span">      </span>String <span class="s5">fetched</span> = <span class="s4">""</span>;</p>
<p class="p1"><span class="Apple-tab-span">     </span><span class="Apple-tab-span">      </span><span class="s1">try</span>{</p>
<p class="p1"><span class="Apple-tab-span">     </span><span class="Apple-tab-span">      </span><span class="Apple-tab-span">      </span>RiakObject[] ros = <span class="s1">this</span>.<span class="s2">rc</span>.fetch(<span class="s1">this</span>.<span class="s2">bucket</span>, key);</p>


<p class="p1"><span class="Apple-tab-span">     </span><span class="Apple-tab-span">      </span><span class="Apple-tab-span">      </span><span class="s1">for</span>(RiakObject ro : ros){</p>
<p class="p1"><span class="Apple-tab-span">     </span><span class="Apple-tab-span">      </span><span class="Apple-tab-span">      </span><span class="Apple-tab-span">      </span><span class="s1">return</span> ro.getValue().toStringUtf8();</p>


<p class="p1"><span class="Apple-tab-span">     </span><span class="Apple-tab-span">      </span><span class="Apple-tab-span">      </span>}</p>
<p class="p1"><span class="Apple-tab-span">     </span><span class="Apple-tab-span">      </span>}<span class="s1">catch</span>(IOException e){</p>
<p class="p1"><span class="Apple-tab-span">     </span><span class="Apple-tab-span">      </span><span class="Apple-tab-span">      </span>e.printStackTrace();</p>
<p class="p1"><span class="Apple-tab-span">     </span><span class="Apple-tab-span">      </span>}</p>
<p class="p5"><span class="s3"><span class="Apple-tab-span">    </span><span class="Apple-tab-span">      </span></span>return<span class="s3"> </span>null<span class="s3">;</span></p>
<p class="p1"><span class="Apple-tab-span">     </span>}</p>
<p class="p2"><br></p>
<p class="p1"><span class="Apple-tab-span">     </span><span class="s1">private</span> <span class="s5">List</span> keys() {</p>
<p class="p1"><span class="Apple-tab-span">     </span><span class="Apple-tab-span">      </span>ArrayList<String> result = <span class="s1">new</span> ArrayList<String>();</p>
<p class="p1"><span class="Apple-tab-span">     </span><span class="Apple-tab-span">      </span>ByteString bucket = ByteString.copyFromUtf8(<span class="s1">this</span>.<span class="s2">bucket</span>);</p>
<p class="p2"><span class="Apple-tab-span">     </span><span class="Apple-tab-span">      </span></p>
<p class="p1"><span class="Apple-tab-span">     </span><span class="Apple-tab-span">      </span><span class="s1">try</span>{</p>
<p class="p1"><span class="Apple-tab-span">     </span><span class="Apple-tab-span">      </span> <span class="Apple-tab-span">     </span>KeySource keys = <span class="s1">this</span>.<span class="s2">rc</span>.listKeys(bucket);<span class="Apple-tab-span">        </span><span class="Apple-tab-span">      </span><span class="Apple-tab-span">      </span></p>


<p class="p1"><span class="Apple-tab-span">     </span><span class="Apple-tab-span">      </span> <span class="Apple-tab-span">     </span><span class="s1">while</span>(keys.hasNext()){</p>
<p class="p1"><span class="Apple-tab-span">     </span><span class="Apple-tab-span">      </span> <span class="Apple-tab-span">     </span><span class="Apple-tab-span">      </span>String key = keys.next().toStringUtf8();</p>
<p class="p1"><span class="Apple-tab-span">     </span><span class="Apple-tab-span">      </span> <span class="Apple-tab-span">     </span><span class="Apple-tab-span">      </span>result.add(key);</p>
<p class="p1"><span class="Apple-tab-span">     </span><span class="Apple-tab-span">      </span> <span class="Apple-tab-span">     </span>}<span class="Apple-tab-span">     </span><span class="Apple-tab-span">      </span> <span class="Apple-tab-span">    </span></p>


<p class="p1"><span class="Apple-tab-span">     </span><span class="Apple-tab-span">      </span>}<span class="s1">catch</span>(IOException e){</p>
<p class="p1"><span class="Apple-tab-span">     </span><span class="Apple-tab-span">      </span><span class="Apple-tab-span">      </span>e.printStackTrace();</p>
<p class="p1"><span class="Apple-tab-span">     </span><span class="Apple-tab-span">      </span>}</p>
<p class="p1"><span class="Apple-tab-span">     </span><span class="Apple-tab-span">      </span><span class="s1">return</span> result;</p>
<p class="p1"><span class="Apple-tab-span">     </span>}</p>
<p class="p2"><br></p>
<p class="p1">}</p></div><div><br></div><div>-- <br>Andrea Campolonghi<br><br>Cell : +39 347 2298435<div><a href="mailto:acampolonghi@gmail.com" target="_blank">acampolonghi@gmail.com</a><br><a href="mailto:andrea@andreacfm.com" target="_blank">andrea@andreacfm.com</a><br>

<a href="http://www.andreacfm.com" target="_blank">http://www.andreacfm.com</a><br><br>Railo Team<br><a href="mailto:andrea@getrailo.org" target="_blank">andrea@getrailo.org</a><br><a href="http://getrailo.org" target="_blank">http://getrailo.org</a><br>

<br></div><br>
</div></div>