Advertisement
sureshcnair

riak1

Nov 29th, 2011
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5 0.59 KB | None | 0 0
  1. public static boolean fetchAll(String bucket, Collection<String> keys,
  2.             StringBuilder response)
  3.     {
  4.         PBClientConfig conf = new PBClientConfig.Builder()
  5.                         .withHost("127.0.0.1")
  6.                         .withPort(8091)
  7.                         .build();
  8.         try
  9.         {
  10.  
  11.             IRiakClient iriakClient = RiakFactory.newClient(conf);
  12.        
  13.             BucketKeyMapReduce reduce = iriakClient.mapReduce();
  14.             while (valuesIter.hasNext())
  15.             {
  16.                 String value = valuesIter.next();
  17.                 reduce.addInput(bucket, value);
  18.             }
  19.             MapReduceResult result = reduce.execute();
  20.             .... // code to send the result to caller
  21.         }....
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement