Interesting. Are there any benefits to maintaining the json version of the map reduce definition for the pb client? If the erlang version of the mapreduce definition offers a superset of the json functionality, couldn't it simply replace the json version?
Thoughts? I guess one downside would be not being able to share the code with the http version of the client. (But this is begs the question of why ultimately to have the http client for anything but calls the pb client doesn't support). As an aside, I ran across your alternative ideas around a cleaner riak client api and on first glance it definitely looks more usable. I have to run off but will drill into this on Monday. Thanks again for your help! Jacques On Sat, Jun 4, 2011 at 1:19 PM, Russell Brown <russell.br...@me.com> wrote: > > On 4 Jun 2011, at 18:22, Jacques wrote: > > I like the sound of option 3 also. I'll have a look at it this weekend and >> get back to you. >> > > Awesome! Thanks. If you can give me a point in the right direction > regarding the correct typing approach and what not, I'm up for giving it a > shot as well. > > > Ok, I have a half working hack. It isn't pretty 'cos the Jinterface API is > verbose. I've hacked the pbc.MapReduceBuilder to encode the job as > "application/x-erlang-binary" and submit that, but really this code should > be in a separate class, maybe using the output from > MapReduceBuilder.getJSON() as input. That way you can get the feature > without patching the client. > > What I haven't done is decode the response from Riak yet. If you want a > pointer here is a gist of the (unclean) hack. It could use a lot of work, > but it proves the concept: > > https://gist.github.com/1008293 > > The gist is just the diff so you can apply it as a patch > to src/main/java/com/basho/riak/pbc/mapreduce/MapReduceBuilder.java if you > want to play with it. > > You'll have to add Jinterface to your pom too. > > <!-- jinterface --> > <dependency> > <groupId>org.erlang.otp</groupId> > <artifactId>jinterface</artifactId> > <version>1.5.4</version> > </dependency> > > I think it is best to put the result decoding outside the library too. I'm > going to hack up a poc for that now, but I thought I'd post what I have thus > far. > > Cheers > > Russell > > > Thanks again, > Jacques > >
_______________________________________________ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com