On 2 Aug 2013, at 16:56, João Machado <joao.mach...@ideais.com.br> wrote:
> Hi Sean, > > Thanks for your quick response. If I follow the steps from Sam, it works as > expected. I tried the same steps but with my own bucket (and data) and it > worked too. The difference between what I was trying and what Sam did was > because I used JavaScript and Sam Erlang. > > Is there any trick to use Javascript? Hi João, Not right now, sorry, the internal representation is a binary format stored in a regular riak_object, that requires the riak_kv_counter module to decode. Russell > > > []'s > > > > João Machado > joao.mach...@ideais.com.br > Tel.: 55 21 3553 1301 R: 215 > Cel.: 55 21 8124 3531 > Site: www.ideais.com.br > > > On Fri, Aug 2, 2013 at 5:09 PM, Sean Cribbs <s...@basho.com> wrote: > Hi João, > > You might want to try the steps shown in Sam Elliott's "cookbook": > https://github.com/basho/riak_crdt_cookbook/blob/master/counters/README.md > > > On Fri, Aug 2, 2013 at 2:56 PM, João Machado <joao.mach...@ideais.com.br> > wrote: > Hello, > > Anyone tried to use MR with counters? > > I'm trying with the following steps: > > Increment the counter: > -> curl -X POST http://localhost:8098/buckets/BUCKET/counters/MY_COUNTER -d 1 > > Confirm the actual value: > -> curl http://localhost:8098/buckets/BUCKET/counters/MY_COUNTER > 1 > > Execute mapreduce: > -> curl -X POST -H "content-type: application/json" > http://127.0.0.1:8098/mapred -d @map_red.js > {"error":"bad_utf8_character_code"} > > Where the map_red.js is: > > { > "inputs":"BUCKET", > "query":[ > {"map":{"language":"javascript","name":"Riak.mapValues"}} > ,{"reduce":{"language":"javascript","name":"Riak.reduceSum"}} > > ] > } > > > > > > []'s > > > > João Machado > joao.mach...@ideais.com.br > Tel.: 55 21 3553 1301 R: 215 > Cel.: 55 21 8124 3531 > Site: www.ideais.com.br > > _______________________________________________ > riak-users mailing list > riak-users@lists.basho.com > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com > > > > > -- > Sean Cribbs <s...@basho.com> > Software Engineer > Basho Technologies, Inc. > http://basho.com/ > > _______________________________________________ > riak-users mailing list > riak-users@lists.basho.com > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com _______________________________________________ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com