Java MR

Christopher Meiklejohn cmeiklejohn at basho.com
Wed Dec 3 08:10:43 EST 2014


> On Dec 3, 2014, at 1:04 PM, niedomnie <niedomnie at gmail.com> wrote:
> 
> no results (prints 0) on below code (using 2.0 java client from maven, and
> connecting to riak 2.0),
> I've changed map/reduce functions JS or Erlang, used different MapReduce
> classes (for Bucket, BucketKey, or Index one) but without any luck.
> It is written in groovy - but I do not think that it differs from java code
> in this example
> 
> def client = RiakClient.newClient(RiakNode.Builder.DEFAULT_REMOTE_PORT,
> "127.0.0.1")
> 
> Namespace ns = new Namespace("current", "bucket");
>    for (int i = 0; i < 200; i++) {
>        Location loc = new Location(ns, "key" + i);
>        RiakObject ro = new RiakObject().setContentType("text/plain")
>                .setValue(BinaryValue.create("" + i));
>        StoreValue sv = new
> StoreValue.Builder(ro).withLocation(loc).build();
>        RiakFuture<StoreValue.Response, Location> future =
> G.client.executeAsync(sv);
>        future.await();
>    }

Before we try to debug the MapReduce job, can we make sure the values are being written to the database successfully?

It looks like you’re not inspecting RiakFuture when the future is completed — can you try inspecting the future using isSuccess() to be sure the values have been written successfully?

http://basho.github.io/riak-java-client/2.0.0/com/basho/riak/client/core/RiakFuture.html <http://basho.github.io/riak-java-client/2.0.0/com/basho/riak/client/core/RiakFuture.html>

Thanks,
- Chris

Christopher Meiklejohn
Senior Software Engineer
Basho Technologies, Inc.
cmeiklejohn at basho.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20141203/ed801c39/attachment.html>


More information about the riak-users mailing list