0

I've been trying to get a simple map-reduce working all day. While I'd like to make a map-reduce which does a batch roll-up of keys using a key-filter, for no all I'm trying to do is get MR to return the values in a particular bucket.

Here's my code (scala using the 2.0 riak java client):

import com.basho.riak.client.api.commands.mapreduce.BucketMapReduce
import com.basho.riak.client.core.query.functions.{Function => RiakFunction}
new BucketMapReduce.Builder().withNamespace(ns).
  withMapPhase(RiakFunction.newAnonymousJsFunction("""function(v) { return [v]; }""")).
  build()

I've also tried:

import com.basho.riak.client.api.commands.mapreduce.BucketMapReduce
import com.basho.riak.client.core.query.functions.{Function => RiakFunction}
new BucketMapReduce.Builder().withNamespace(ns).
  withMapPhase(RiakFunction.newErlangFunction("riak_kv_mapreduce", "map_identity")).
  build()

Both of these return empty-arrays when I hit my riak server. Anything I'm missing that would cause this to happen? I see no error output whatsoever in the logs (which is actually been par for the course when errors occur in the Java client).

jsuereth
  • 5,604
  • 40
  • 40
  • I'm not especially familiar with scala so perhaps I'm misreading, but I don't see where you've specified the inputs to the map reduce job. – Joe Jan 13 '15 at 18:35
  • What inputs do you mean? The only things I see in the builder are: withNamespace, withMapPhase, withReducePhase, withKeyFilter – jsuereth Jan 13 '15 at 19:59

0 Answers0