Hi Istvan,
I posted about this same problem to the list quite a while ago.
The problem is that the Erlang API allows arbitrary binary sequences,
whereas the PBC (via Java) and HTTP APIs only handle valid Unicode
strings.
So basho_bench creates keys that can't be manipulated by anything
except erlang :/
You can delete them if you write some erlang though..
-Toby

On 15 March 2014 04:00, István <lecc...@gmail.com> wrote:
> Hi,
>
> I am trying to clean up some of the test data that was inserted by
> basho_bench. The first approach to use curl and streaming the keys
> fails like this:
>
> # curl -XGET -i http://127.0.0.1:8098/buckets/test/keys?keys=stream
> HTTP/1.1 200 OK
> Vary: Accept-Encoding
> Transfer-Encoding: chunked
> Server: MochiWeb/1.1 WebMachine/1.10.0 (never breaks eye contact)
> Date: Fri, 14 Mar 2014 16:59:08 GMT
> Content-Type: application/json
>
> curl: (18) transfer closed with outstanding read data remaining
>
> When I am trying to the same thing with MapReduce it fails like this:
>
> curl -X POST "http://localhost:8098/mapred"; -H "Content-Type:
> application/json" -d '{
>     "inputs": "test",
>     "query": [
>         {
>             "map": {
>                 "language": "javascript",
>                 "source": "function(riakObject) { return [riakObject.key]; }"
>             }
>         }
>     ]
> }'
>
> Error:
>
> {"phase":0,"error":"bad_utf8_character_code","input":"{ok,{r_object,<<\"test\">>,<<0,116,71,0>>,[{r_content,{dict,3,16,16,8,80,48,{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},{{[],[],[],[],[],[],[],[],[],[],[[<<\"X-Riak-VTag\">>,71,81,80,81,87,76,105,54,113,120,97,116,114,106,51,86,72,53,67,50,82]],[[<<\"index\">>]],[],[[<<\"X-Riak-Last-Modified\">>|{1391,27501,255280}]],[],[]}}},<<75,191,51,171,193,113,206,163,24,68,247,188,84,72,5,72,179,195,99,44,202,122,136,31,250,94,166,5,160,199,182,137,40,6,253,115,100,4,34,67,64,10,25,210,58,23,104,97,228,...>>}],...},...}"}
>
> I am wondering how else could I just get a list of keys in that
> bucket. The ultimate goal is to be able to delete them all.
>
> Thank you in advance,
> Istvan
>
> --
> the sun shines for all
>
> _______________________________________________
> riak-users mailing list
> riak-users@lists.basho.com
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com



-- 
Turning and turning in the widening gyre
The falcon cannot hear the falconer
Things fall apart; the center cannot hold
Mere anarchy is loosed upon the world

_______________________________________________
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to