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

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


        svFuture = client.executeAsync(sv);
       
        svFuture.await();
        assertTrue(svFuture.isSuccess());
       
        Namespace ns = new Namespace(Namespace.DEFAULT_BUCKET_TYPE, bucketName.toString());
       
        BinIndexQuery biq  =
            new BinIndexQuery.Builder(ns, "test_index", "index_test_index_key").withKeyAndIndex(true).build();
        BinIndexQuery.Response iResp = client.execute(biq);
View Full Code Here


        svFuture = client.executeAsync(sv);
       
        svFuture.await();
        assertTrue(svFuture.isSuccess());
       
        Namespace ns = new Namespace(Namespace.DEFAULT_BUCKET_TYPE, bucketName.toString());
        BinIndexQuery biq  =
            new BinIndexQuery.Builder(ns, "test_index", "index_test_index_key0", "index_test_index_key9").withKeyAndIndex(true).build();
        BinIndexQuery.Response iResp = client.execute(biq);
       
        assertTrue(iResp.hasEntries());
View Full Code Here

    private void simpleTest(String bucketType)
    {
        try
        {
            RiakClient client = new RiakClient(cluster);
            Namespace ns = new Namespace(bucketType, bucketName.toString());
            Location loc = new Location(ns, "test_fetch_key1");
           
            Pojo pojo = new Pojo();
            pojo.value = "test value";
            StoreValue sv =
View Full Code Here

    }
   
    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());
View Full Code Here

    @Ignore
    @Test
    public void ReproRiakTombstoneBehavior() throws ExecutionException, InterruptedException
    {
        // We're back to allow_mult=false as default
        Namespace ns = new Namespace(Namespace.DEFAULT_BUCKET_TYPE, bucketName.toString());
        StoreBucketPropsOperation op =
            new StoreBucketPropsOperation.Builder(ns)
                .withAllowMulti(true)
                .build();
        cluster.execute(op);
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 =
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);
        assertNotNull(rap.vtag);
        assertNotNull(rap.lastModified);
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()
View Full Code Here

    @Before
    public void changeBucketProps() throws ExecutionException, InterruptedException
    {
        if (testBucketType)
        {
            Namespace ns = new Namespace(bucketType.toString(), mrBucketName);
            StoreBucketProperties op = new StoreBucketProperties.Builder(ns).withAllowMulti(false).build();
            client.execute(op);
        }
    }
View Full Code Here

    @After
    public void cleanUp() throws InterruptedException, ExecutionException
    {
        // Because some of these tests blow up due to Riak bugs we need
        // to clean up the mess here
        Namespace ns = new Namespace(mrBucketName);
        resetAndEmptyBucket(ns);
       
        if (testBucketType)
        {
            ns = new Namespace(bucketType.toString(), mrBucketName);
            resetAndEmptyBucket(ns);
        }
       
    }
View Full Code Here

TOP

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

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.