Package com.basho.riak.client.core.operations

Examples of com.basho.riak.client.core.operations.MapReduceOperation$Builder


    } catch (RiakException e)
    {
      throw new RuntimeException(e);
    }

    MapReduceOperation operation = new MapReduceOperation.Builder(jobSpec).build();

    final RiakFuture<MapReduceOperation.Response, BinaryValue> coreFuture = cluster.execute(operation);

    CoreFutureAdapter<Response, BinaryValue, MapReduceOperation.Response, BinaryValue> future =
        new CoreFutureAdapter<Response, BinaryValue, MapReduceOperation.Response, BinaryValue>(coreFuture)
View Full Code Here


            "for(var i in m) {if(m[i] != '') {var o = {};o[m[i]] = 1;r.push(o);}}return r;}" +
            "\"}},{\"reduce\":{\"language\":\"javascript\",\"source\":\"" +
            "function(v) {var r = {};for(var i in v) {for(var w in v[i]) {if(w in r) r[w] += v[i][w];" +
            "else r[w] = v[i][w];}}return [r];}\"}}]}";
       
        MapReduceOperation mrOp =
            new MapReduceOperation.Builder(BinaryValue.unsafeCreate(query.getBytes()))
                .build();
       
        cluster.execute(mrOp);
        mrOp.await();
        assertTrue(mrOp.isSuccess());
        ArrayNode resultList = mrOp.get().getResults().get(1);
       
        // The query should return one result which is a JSON array containing a
        // single JSON object that is a asSet of word counts.
        assertEquals(resultList.size(), 1);
       
View Full Code Here

    } catch (RiakException e)
    {
      throw new RuntimeException(e);
    }

    MapReduceOperation operation = new MapReduceOperation.Builder(jobSpec).build();

    final RiakFuture<MapReduceOperation.Response, BinaryValue> coreFuture = cluster.execute(operation);

    CoreFutureAdapter<Response, BinaryValue, MapReduceOperation.Response, BinaryValue> future =
        new CoreFutureAdapter<Response, BinaryValue, MapReduceOperation.Response, BinaryValue>(coreFuture)
View Full Code Here

TOP

Related Classes of com.basho.riak.client.core.operations.MapReduceOperation$Builder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.