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

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


                .build();
        cluster.execute(op);
        op.get();
       
        RiakObject obj = new RiakObject().setValue(BinaryValue.create(value));
        Location location = new Location(ns, key);
      
        StoreOperation storeOp =
            new StoreOperation.Builder(location)
                .withContent(obj)
                .withReturnBody(true)
View Full Code Here


           
        };
       
        for (BinaryValue k : keyList)
        {
            Location location = new Location(namespace, k);
            DeleteOperation.Builder delOpBuilder = new DeleteOperation.Builder(location);
            DeleteOperation delOp = delOpBuilder.build();
            delOp.addListener(listener);
            semaphore.acquire();
            cluster.execute(delOp);
View Full Code Here

    @Test
    public void simpleTest() throws ExecutionException, InterruptedException
    {
        RiakClient client = new RiakClient(cluster);
        Namespace ns = new Namespace(Namespace.DEFAULT_BUCKET_TYPE, bucketName.toString());
        Location loc = new Location(ns, "test_update_key1");
        UpdateValue uv = new UpdateValue.Builder(loc)
                            .withStoreOption(Option.RETURN_BODY, true)
                            .withUpdate(new UpdatePojo())
                            .build();
       
View Full Code Here

    @Test
    public void updateAnnotatedPojo() throws ExecutionException, InterruptedException
    {
        RiakClient client = new RiakClient(cluster);
        Namespace ns = new Namespace(Namespace.DEFAULT_BUCKET_TYPE, bucketName.toString());
        Location loc = new Location(ns, "test_update_key2");
        UpdateValue uv = new UpdateValue.Builder(loc)
                            .withStoreOption(Option.RETURN_BODY, true)
                            .withUpdate(new UpdateAnnotatedPojo())
                            .build();
       
        UpdateValue.Response resp = client.execute(uv);
        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("application/json", rap.contentType);
        assertNotNull(rap.vclock);
View Full Code Here

        // Empty buckets do not show up
        final BinaryValue key = BinaryValue.unsafeCreate("my_key".getBytes());
        final String value = "{\"value\":\"value\"}";
       
        RiakObject rObj = new RiakObject().setValue(BinaryValue.create(value));
        Location location = new Location(new Namespace(bucketType, bucketName.toString()), key);
        StoreOperation storeOp =
            new StoreOperation.Builder(location)
                .withContent(rObj)
                .build();
       
View Full Code Here

       
        for (int i = 0; i < 1000; i++)
        {
            Namespace ns = new Namespace(bucketType, bucketName.toString() + i);
            RiakObject rObj = new RiakObject().setValue(BinaryValue.create(value));
            Location location = new Location(ns, key);
            StoreOperation storeOp =
                new StoreOperation.Builder(location)
                    .withContent(rObj)
                    .build();
            storeOp.addListener(listener);
View Full Code Here

  @Test
  public void testSerializeBucketKeyInput() throws IOException
  {
        Namespace ns = new Namespace(Namespace.DEFAULT_BUCKET_TYPE, "bucket");
    ArrayList<BucketKeyInput.IndividualInput> inputs = new ArrayList<BucketKeyInput.IndividualInput>();
    inputs.add(new BucketKeyInput.IndividualInput(new Location(ns, "key")));
    inputs.add(new BucketKeyInput.IndividualInput(new Location(ns, "key"), "data"));
    BucketKeyInput input = new BucketKeyInput(inputs);

    jg.writeObject(input);

    assertEquals("[[\"bucket\",\"key\",\"\"],[\"bucket\",\"key\",\"data\"]]", out.toString());
View Full Code Here

       
        RiakObject riakObject = orm.getRiakObject();
        riakObject.setLastModified(123);
        riakObject.setVTag("vtag");
       
        Location loc = new Location(orm.getNamespace(), orm.getKey());
        EmptyPojoWithRiakFields convertedPojo = jc.toDomain(riakObject, loc);
       
        assertEquals(pojo.key, convertedPojo.key);
        assertEquals(pojo.bucketName, convertedPojo.bucketName);
        assertEquals(pojo.bucketType, convertedPojo.bucketType);
View Full Code Here

    @Test
  public void testSerializeBucketKeyInputWithType() throws IOException
  {
        Namespace ns = new Namespace("type", "bucket");
    ArrayList<BucketKeyInput.IndividualInput> inputs = new ArrayList<BucketKeyInput.IndividualInput>();
    inputs.add(new BucketKeyInput.IndividualInput(new Location(ns, "key")));
    inputs.add(new BucketKeyInput.IndividualInput(new Location(ns, "key"), "data"));
    BucketKeyInput input = new BucketKeyInput(inputs);

    jg.writeObject(input);

    assertEquals("[[\"bucket\",\"key\",\"\",\"type\"],[\"bucket\",\"key\",\"data\",\"type\"]]", out.toString());
View Full Code Here

        RiakObject ro = orm.getRiakObject();
       
        assertNotNull(ro.getValue());
       
        Namespace ns = new Namespace(Namespace.DEFAULT_BUCKET_TYPE, "bucket");
        Pojo pojo2 = converter.toDomain(ro, new Location(ns, "key"));
       
        assertEquals(pojo.foo, pojo2.foo);
        assertEquals(pojo.bar, pojo2.bar);
       
    }
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.