Package com.basho.riak.client.api.commands.kv

Examples of com.basho.riak.client.api.commands.kv.StoreValue$Response$Builder


       
        client.execute(uv);
       
        // Create a sibling
        Foo f = update.apply(null);
        StoreValue sv =
            new StoreValue.Builder(f)
                .withLocation(loc)
                .build();
       
        client.execute(sv);
View Full Code Here


        RiakClient client = new RiakClient(cluster);
        Namespace ns = new Namespace(Namespace.DEFAULT_BUCKET_TYPE, bucketName.toString());
        Location loc = new Location(ns, "test_store_key");
        Pojo pojo = new Pojo();
        pojo.value = "test store value";
        StoreValue sv =
            new StoreValue.Builder(pojo).withLocation(loc)
                .withOption(Option.RETURN_BODY, true)
                .build();
       
        StoreValue.Response resp = client.execute(sv);
View Full Code Here

        pojo.bucketName = bucketName.toString();
        pojo.key = "test_store_key_3";
        pojo.contentType = null; // converter will set
        pojo.value = "my value";
       
         StoreValue sv =
            new StoreValue.Builder(pojo)
                .withOption(Option.RETURN_BODY, true)
                .build();
       
        StoreValue.Response resp = client.execute(sv);
View Full Code Here

        emailAddys.add("roach@basho.com");
       
        pojo.emailIndx = emailAddys;
        pojo.userId = 1L;
       
        StoreValue sv =
            new StoreValue.Builder(pojo)
                .withOption(Option.RETURN_BODY, true)
                .build();
       
        StoreValue.Response resp = client.execute(sv);
View Full Code Here

        pojo.bucketType = "default";
        pojo.bucketName = bucketName.toString();
        pojo.contentType = null; // converter will set
        pojo.value = "my value";
       
         StoreValue sv =
            new StoreValue.Builder(pojo)
                .withOption(Option.RETURN_BODY, true)
                .build();
       
        StoreValue.Response resp = client.execute(sv);
View Full Code Here

       
        RiakObject ro = new RiakObject()
                        .setContentType("application/json")
                        .setValue(BinaryValue.create("{\"name_s\":\"Lion-o\", \"age_i\":30, \"leader_b\":true}"));
        Location location = new Location(ns, "liono");
        StoreValue sv = new StoreValue.Builder(ro).withLocation(location).build();
        client.execute(sv);
       
        ro = new RiakObject()
                .setContentType("application/json")
                .setValue(BinaryValue.create("{\"name_s\":\"Cheetara\", \"age_i\":28, \"leader_b\":false}"));
View Full Code Here

        {
            Location loc = new Location(ns, keyPrefix + i);
            RiakObject ro = new RiakObject().setContentType("text/plain")
                .setValue(BinaryValue.create(Integer.toString(i)));
            ro.getIndexes().getIndex(LongIntIndex.named("user_id")).add((long)i);
            StoreValue sv = new StoreValue.Builder(ro).withLocation(loc).build();
            RiakFuture<StoreValue.Response, Location> future = client.executeAsync(sv);
            future.await();
            assertTrue(future.isSuccess());
        }
    }
View Full Code Here

            Location loc = new Location(ns, keyPrefix + i);
            RiakObject ro = new RiakObject().setContentType("text/plain")
                .setValue(BinaryValue.create(Integer.toString(i)));
            // Single index key used on all 200 objects
            ro.getIndexes().getIndex(LongIntIndex.named("user_id")).add(1L);
            StoreValue sv = new StoreValue.Builder(ro).withLocation(loc).build();
            RiakFuture<StoreValue.Response, Location> future = client.executeAsync(sv);
            future.await();
            assertTrue(future.isSuccess());
        }
    }
View Full Code Here

            Location loc = new Location(ns, key);
            locations.add(loc);
            values.add(BinaryValue.create(value));
            RiakObject o = new RiakObject().setValue(BinaryValue.create(value));
           
            StoreValue sv = new StoreValue.Builder(o).withLocation(loc).build();
            client.execute(sv);
        }
       
        MultiFetch mf = new MultiFetch.Builder().addLocations(locations).build();
       
View Full Code Here

    try {
      send_raw(q.build().toByteArray());
    } catch (IOException ex) {
      throw new RqlDriverException(ex.getMessage());
    }
    Response rsp = get();

    // For this version we only support success :-(
    switch(rsp.getType()) {
    case SUCCESS_ATOM:
    case SUCCESS_SEQUENCE:
    case SUCCESS_PARTIAL:
      return new RqlCursor(this,rsp);
    case CLIENT_ERROR:
    case COMPILE_ERROR:
    case RUNTIME_ERROR:
    default:
      throw new RqlDriverException(rsp.toString());             
    }             
  }
View Full Code Here

TOP

Related Classes of com.basho.riak.client.api.commands.kv.StoreValue$Response$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.