Package com.basho.riak.client.core.util

Examples of com.basho.riak.client.core.util.BinaryValue


        };
       
        for (int i = 0; i < 1000; i++)
        {
            semaphore.acquire();
            BinaryValue key = BinaryValue.unsafeCreate((baseKey + i).getBytes());
            RiakObject rObj = new RiakObject().setValue(BinaryValue.create(value));
            Location location = new Location(ns, key);
            StoreOperation storeOp =
                new StoreOperation.Builder(location)
                .withContent(rObj)
View Full Code Here


        Assume.assumeTrue(testYokozuna);
       
        // First we have to create an index and attach it to a bucket
        // and the 'default' bucket type can't be used for search
       
        BinaryValue searchBucket = BinaryValue.create("search_bucket");
        YokozunaIndex index = new YokozunaIndex("test_index");
        YzPutIndexOperation putOp = new YzPutIndexOperation.Builder(index).build();
       
        cluster.execute(putOp);
        putOp.await();
View Full Code Here

        final byte[] now = nowBinary.array();
        final String username = "username";
        final String loggedIn = "logged-in";
        final String shoppingCart = "cart";

        BinaryValue key = BinaryValue.create("user-info");

        /*

            Data structure:

View Full Code Here

        testDeleteObject(bucketType.toString());
    }
   
    private void testDeleteObject(String bucketType) throws InterruptedException, ExecutionException
    {
        final BinaryValue key = BinaryValue.unsafeCreate("my_key".getBytes());
        final String value = "{\"value\":\"value\"}";
       
        RiakObject rObj = new RiakObject().setValue(BinaryValue.unsafeCreate(value.getBytes()));
       
        Location location = new Location(new Namespace(bucketType, bucketName.toString()), key);
View Full Code Here

        testFetchOpNotFound(bucketType.toString());
    }
   
    private void testFetchOpNotFound(String bucketType) throws InterruptedException, ExecutionException
    {
        final BinaryValue key = BinaryValue.unsafeCreate("my_key_1".getBytes());
        final String value = "{\"value\":\"value\"}";
        Namespace ns = new Namespace(bucketType, bucketName.toString());
        Location location = new Location(ns, key);
        FetchOperation fetchOp =
            new FetchOperation.Builder(location).build();
View Full Code Here

        testFetchOpNoSiblings(bucketType.toString());
    }
   
    private void testFetchOpNoSiblings(String bucketType) throws InterruptedException, ExecutionException
    {
        final BinaryValue key = BinaryValue.unsafeCreate("my_key_2".getBytes());
        final String value = "{\"value\":\"value\"}";
       
        RiakObject rObj = new RiakObject().setValue(BinaryValue.create(value));
        Namespace ns = new Namespace(bucketType, bucketName.toString());
        Location location = new Location(ns, key);
View Full Code Here

        testFetchOpWithSiblings(bucketType.toString());
    }
   
    private void testFetchOpWithSiblings(String bucketType) throws InterruptedException, ExecutionException
    {
        final BinaryValue key = BinaryValue.unsafeCreate("my_key_3".getBytes());
        final String value = "{\"value\":\"value\"}";
       
        Namespace namespace = new Namespace(bucketType, bucketName.toString());
        StoreBucketPropsOperation op =
            new StoreBucketPropsOperation.Builder(namespace)
View Full Code Here

        }

        @Override
        public Namespace next()
        {
            BinaryValue bucket = iterator.next();
            return new Namespace(type, bucket);
        }
View Full Code Here

     * @param key the key for the object
     * @return data to be stored in Riak.
     */
    public OrmExtracted fromDomain(T domainObject, Namespace namespace, BinaryValue key)
    {       
        BinaryValue bucketName = namespace != null ? namespace.getBucketName() : null;
        BinaryValue bucketType = namespace != null ? namespace.getBucketType() : null;
       
        key = AnnotationUtil.getKey(domainObject, key);
        bucketName = AnnotationUtil.getBucketName(domainObject, bucketName);
        bucketType = AnnotationUtil.getBucketType(domainObject, bucketType);
       
View Full Code Here

  @Override
  protected RiakFuture<Response, BinaryValue> executeAsync(RiakCluster cluster)
  {
   
        BinaryValue jobSpec;
    try
    {
      String spec = writeSpec();
            //System.out.println(spec);
            jobSpec = BinaryValue.create(spec);
View Full Code Here

TOP

Related Classes of com.basho.riak.client.core.util.BinaryValue

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.