Examples of MapReduceResult


Examples of com.basho.riak.client.query.MapReduceResult

     */
    public Collection<BucketKey> getKeys(IRiakClient client) throws RiakException {
        if (query == null) {
            throw new IllegalStateException("No index query");
        }
        MapReduceResult r = client.mapReduce(query).addReducePhase(NamedErlangFunction.REDUCE_IDENTITY,
                                                                   Args.REDUCE_PHASE_ONLY_1).execute();

        return r.getResult(BucketKey.class);
    }
View Full Code Here

Examples of com.basho.riak.client.query.MapReduceResult

                throw new MapReduceTimeoutException();
            } else {
                throw new IOException(resp.getBodyAsString());
            }
        }
        final MapReduceResult result = new MapReduceResult() {

            public String getResultRaw() {
                return resp.getBodyAsString();
            }
View Full Code Here

Examples of com.basho.riak.client.query.MapReduceResult

     *
     * @param linkWalkSpec
     *            the {@link LinkWalkSpec} to execute.
     */
    public WalkResult linkWalk(final LinkWalkSpec linkWalkSpec) throws IOException {
        MapReduceResult firstPhaseResult = linkWalkFirstPhase(linkWalkSpec);
        MapReduceResult secondPhaseResult = linkWalkSecondPhase(firstPhaseResult);
        WalkResult result = convert(secondPhaseResult);
        return result;
    }
View Full Code Here

Examples of com.basho.riak.client.query.MapReduceResult

        });
        // only return the key, to match the http rest api
        mr.addReducePhase(new JSSourceFunction("function(v) { return v.map(function(e) { return e[1]; }); }"));

        try {
            MapReduceResult result = mr.execute();
            return new ArrayList<String>(result.getResult(String.class));
        } catch (RiakException e) {
            throw new IOException(e);
        }
    }
View Full Code Here

Examples of com.basho.riak.client.query.MapReduceResult

                throw new MapReduceTimeoutException();
            } else {
                throw new IOException(resp.getBodyAsString());
            }
        }
        final MapReduceResult result = new MapReduceResult() {

            public String getResultRaw() {
                return resp.getBodyAsString();
            }
View Full Code Here

Examples of com.basho.riak.client.query.MapReduceResult

     *
     * @param linkWalkSpec
     *            the {@link LinkWalkSpec} to execute.
     */
    public WalkResult linkWalk(final LinkWalkSpec linkWalkSpec) throws IOException {
        MapReduceResult firstPhaseResult = linkWalkFirstPhase(linkWalkSpec);
        MapReduceResult secondPhaseResult = linkWalkSecondPhase(firstPhaseResult);
        WalkResult result = convert(secondPhaseResult);
        return result;
    }
View Full Code Here

Examples of com.basho.riak.client.query.MapReduceResult

        mr.addReducePhase(NamedErlangFunction.REDUCE_IDENTITY, Args.REDUCE_PHASE_ONLY_1);
        // only return the key, to match the http rest api
        mr.addReducePhase(new JSSourceFunction("function(v) { return v.map(function(e) { return e[1]; }); }"), Args.REDUCE_PHASE_ONLY_1);

        try {
            MapReduceResult result = mr.execute();
            return new ArrayList<String>(result.getResult(String.class));
        } catch (RiakException e) {
            throw new IOException(e);
        }
    }
View Full Code Here

Examples of com.basho.riak.client.query.MapReduceResult

                throw new MapReduceTimeoutException();
            } else {
                throw new IOException(resp.getBodyAsString());
            }
        }
        final MapReduceResult result = new MapReduceResult() {

            public String getResultRaw() {
                return resp.getBodyAsString();
            }
View Full Code Here

Examples of com.browseengine.bobo.mapred.MapReduceResult

    return builder.build();
  }

  private MapReduceResult convertMapReduceResult(SenseiProtos.MapReduceResult protoMapReduceResult) {
    MapReduceResult mapReduceResult = new MapReduceResult();

    if (protoMapReduceResult.hasReduceResult()) {
      Object reduceResult = javaDeserialize(protoMapReduceResult.getReduceResult());

      if (reduceResult != null)
        mapReduceResult.setReduceResult((Serializable) reduceResult);
    }

    if (protoMapReduceResult.getMapResultCount() > 0) {
      List mapResults = new ArrayList();
      for (ByteString protoMapResult : protoMapReduceResult.getMapResultList()) {
        Object mapResult = javaDeserialize(protoMapResult);

        if (mapResult != null)
          mapResults.add(mapResult);
      }
      mapReduceResult.setMapResults(mapResults);
    }
    return mapReduceResult;
  }
View Full Code Here

Examples of com.browseengine.bobo.mapred.MapReduceResult

  private int docIdIndex = 0;
  public SenseiMapFunctionWrapper(SenseiMapReduce mapReduceStrategy, Set<SenseiFacetInfo> facetInfos) {
    super();
    this.mapReduceStrategy = mapReduceStrategy;  
    partialDocIds = new int[BUFFER_SIZE];
    result = new MapReduceResult();
    this.facetInfos = facetInfos;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.