Examples of RiakObject


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

  @Test
  public void testSiblings() throws ExecutionException, InterruptedException
  {

    RiakObject o = RiakObject.create(bucket.unsafeGetValue()).setValue("test value");
    StoreMeta storeMeta = new StoreMeta.Builder().returnBody(true).build();

    StoreOperation<RiakObject> store1 =
      new StoreOperation<RiakObject>(bucket, o)
        .withConverter(domainObjectConverter)
        .withStoreMeta(storeMeta);

    cluster.execute(store1);

    RiakObject storeReturn1 = store1.get();

    BinaryValue key = BinaryValue.create(storeReturn1.getKeyAsBytes());
    StoreOperation<RiakObject> store2 =
      new StoreOperation<RiakObject>(bucket, key, o)
        .withConverter(domainObjectConverter)
        .withStoreMeta(storeMeta);

    cluster.execute(store2);

    RiakObject storeReturn2 = store2.get();


  }
View Full Code Here

Examples of com.basho.riak.pbc.RiakObject

        final String key = (String) parameters[0];
        final byte[] dataBytes = (byte[]) parameters[1];
        final ByteString keyBS = ByteString.copyFromUtf8 (key);
        final ByteString bucketBS = ByteString.copyFromUtf8 (RiakPBOperationFactory.this.bucket);
        final ByteString dataBS = ByteString.copyFrom (dataBytes);
        final RiakObject riakobj = new RiakObject (bucketBS, keyBS, dataBS);
        // FIXME: use the vector clock...
        RiakPBOperationFactory.this.riakcl.store (riakobj);
        return true;
      }
    });
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.