Package com.basho.riak.client.core.query

Examples of com.basho.riak.client.core.query.Location


   
    private void notFound(String bucketType) throws ExecutionException, InterruptedException
    {
        RiakClient client = new RiakClient(cluster);
        Namespace ns = new Namespace(bucketType, bucketName.toString());
        Location loc = new Location(ns, "test_fetch_key2");
        FetchValue fv = new FetchValue.Builder(loc).build();
        FetchValue.Response fResp = client.execute(fv);
       
        assertFalse(fResp.hasValues());
        assertTrue(fResp.isNotFound());
View Full Code Here


        cluster.execute(op);
        op.get();
       
       
        RiakClient client = new RiakClient(cluster);
        Location loc = new Location(ns, "test_fetch_key3");
       
        Pojo pojo = new Pojo();
        pojo.value = "test value";
        StoreValue sv =
            new StoreValue.Builder(pojo).withLocation(loc).build();
View Full Code Here

   
    private void resolveSiblings(String bucketType) throws ExecutionException, InterruptedException
    {
        RiakClient client = new RiakClient(cluster);
        Namespace ns = new Namespace(bucketType, bucketName.toString());
        Location loc = new Location(ns, "test_fetch_key4");
       
        Pojo pojo = new Pojo();
        pojo.value = "test value";
        StoreValue sv =
            new StoreValue.Builder(pojo).withLocation(loc).build();
View Full Code Here

   
    private void fetchAnnotatedPojo(String bucketType) throws ExecutionException, InterruptedException
    {
        RiakClient client = new RiakClient(cluster);
        Namespace ns = new Namespace(bucketType, bucketName.toString());
        Location loc = new Location(ns, "test_fetch_key5");
       
        String jsonValue = "{\"value\":\"my value\"}";
       
        RiakObject ro = new RiakObject()
                        .setValue(BinaryValue.create(jsonValue))
                        .setContentType("application/json");
       
        StoreValue sv = new StoreValue.Builder(ro).withLocation(loc).build();
        client.execute(sv);
       
        FetchValue fv = new FetchValue.Builder(loc).build();
        FetchValue.Response resp = client.execute(fv);
       
        RiakAnnotatedPojo rap = resp.getValue(RiakAnnotatedPojo.class);
       
        assertNotNull(rap.bucketName);
        assertEquals(ns.getBucketNameAsString(), rap.bucketName);
        assertNotNull(rap.key);
        assertEquals(loc.getKeyAsString(), rap.key);
        assertNotNull(rap.bucketType);
        assertEquals(ns.getBucketTypeAsString(), rap.bucketType);
        assertNotNull(rap.contentType);
        assertEquals(ro.getContentType(), rap.contentType);
        assertNotNull(rap.vclock);
View Full Code Here

    @Test
    public void fetchAnnotatedPojoWIthIndexes() throws ExecutionException, InterruptedException
    {
        RiakClient client = new RiakClient(cluster);
        Namespace ns = new Namespace(Namespace.DEFAULT_BUCKET_TYPE, bucketName.toString());
        Location loc = new Location(ns,"test_fetch_key6");
       
        String jsonValue = "{\"value\":\"my value\"}";
       
        RiakObject ro = new RiakObject()
                        .setValue(BinaryValue.create(jsonValue))
View Full Code Here

        Namespace ns = new Namespace(bucketType, mrBucketName);
       
        String keyPrefix = "mr_test_";
        for (int i = 0; i < 200; i++)
        {
            Location loc = new Location(ns, keyPrefix + i);
            RiakObject ro = new RiakObject().setContentType("text/plain")
                .setValue(BinaryValue.create(Integer.toString(i)));
            StoreValue sv = new StoreValue.Builder(ro).withLocation(loc).build();
            RiakFuture<StoreValue.Response, Location> future = client.executeAsync(sv);
            future.await();
View Full Code Here

    UpdateMap update = new UpdateMap.Builder(carts, userEntryUpdate)
      .withOption(Option.RETURN_BODY, true)
      .build();
    UpdateMap.Response updateResponse = client.execute(update);

        Location loc = new Location(carts, updateResponse.getGeneratedKey());
    FetchMap fetch = new FetchMap.Builder(loc).build();
    FetchMap.Response fetchResponse = client.execute(fetch);

    // users
    RiakMap usersMap = fetchResponse.getDatatype();
View Full Code Here

       
        RiakCluster cluster = new RiakCluster.Builder(list).build();
        cluster.start();
       
        Namespace ns = new Namespace(Namespace.DEFAULT_BUCKET_TYPE, "test_bucket");
        Location location = new Location(ns, "test_key2");
       
        FetchOperation operation =
            new FetchOperation.Builder(location).build();

        cluster.execute(operation);
View Full Code Here

        RiakCluster cluster = new RiakCluster.Builder(list).build();
       
        cluster.start();
       
        Namespace ns = new Namespace(Namespace.DEFAULT_BUCKET_TYPE, "test_bucket");
        Location location = new Location(ns, "test_key2");
       
        FetchOperation operation =
            new FetchOperation.Builder(location)
                    .build();
View Full Code Here

    private void testSimpleStore(String bucketType) throws InterruptedException, ExecutionException
    {
       
        RiakObject obj = new RiakObject().setValue(BinaryValue.create(value));
        Namespace ns = new Namespace(bucketType, bucketName.toString());
        Location location = new Location(ns, key);
        StoreOperation storeOp =
            new StoreOperation.Builder(location)
                .withContent(obj)
                .build();
       
View Full Code Here

TOP

Related Classes of com.basho.riak.client.core.query.Location

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.