Examples of RiakDatatype


Examples of com.basho.riak.client.core.query.crdt.types.RiakDatatype

                            .setType(RiakDtPB.MapField.MapFieldType.MAP)))))
            .build();

        CrdtResponseConverter converter = new CrdtResponseConverter();

        RiakDatatype element = converter.convert(resp);

        assertTrue(element.isMap());
        RiakMap map = element.getAsMap();
        assertTrue(map.get(mapKey).get(0).isMap());
        map = map.get(mapKey).get(0).getAsMap();
        assertTrue(map.get(mapKey).get(0).isMap());
        map = map.get(mapKey).get(0).getAsMap();
        assertTrue(map.get(mapKey).get(0).isMap());
View Full Code Here

Examples of com.basho.riak.client.core.query.crdt.types.RiakDatatype

    {
        Location location = new Location(new Namespace(type, bucket), key);
        DtFetchOperation fetch = new DtFetchOperation.Builder(location).build();
        cluster.execute(fetch);
        DtFetchOperation.Response response = fetch.get();
        RiakDatatype element = response.getCrdtElement();

        assertNotNull(element);
        assertTrue(element.isCounter());

        return element.getAsCounter();
    }
View Full Code Here

Examples of com.basho.riak.client.core.query.crdt.types.RiakDatatype

        Location location = new Location(new Namespace(type, bucket), key);
        DtFetchOperation fetch = new DtFetchOperation.Builder(location).build();

        cluster.execute(fetch);
        DtFetchOperation.Response response = fetch.get();
        RiakDatatype element = response.getCrdtElement();

        assertNotNull(element);
        assertTrue(element.isSet());

        return element.getAsSet();
    }
View Full Code Here

Examples of com.basho.riak.client.core.query.crdt.types.RiakDatatype

        Location location = new Location(new Namespace(type, bucket), key);
        DtFetchOperation fetch = new DtFetchOperation.Builder(location).build();

        cluster.execute(fetch);
        DtFetchOperation.Response response = fetch.get();
        RiakDatatype element = response.getCrdtElement();

        assertNotNull(element);
        assertTrue(element.isMap());

        return element.getAsMap();
    }
View Full Code Here

Examples of com.basho.riak.client.core.query.crdt.types.RiakDatatype

        {
            DtUpdateOperation.Response response = update.get();
            assertNotNull(response);
            assertTrue(response.hasCrdtElement());
            assertTrue(response.hasContext());
            RiakDatatype dt = response.getCrdtElement();
            assertTrue(dt.isMap());
            map = dt.getAsMap();
        }
        else
        {
            map = fetchMap(mapBucketType, bucketName, key);
        }
View Full Code Here

Examples of com.basho.riak.client.core.query.crdt.types.RiakDatatype

        assertTrue(update.isSuccess());
        DtUpdateOperation.Response response = update.get();
        assertNotNull(response);
        assertTrue(response.hasCrdtElement());
        assertTrue(response.hasContext());
        RiakDatatype dt = response.getCrdtElement();
        assertTrue(dt.isMap());
        RiakMap map = dt.getAsMap();
       
        resetAndEmptyBucket(new Namespace(mapBucketType, bucketName));
       
       
       
View Full Code Here

Examples of com.basho.riak.client.core.query.crdt.types.RiakDatatype

        DtFetchOperation fetch = new DtFetchOperation.Builder(location)
            .build();
        cluster.execute(fetch);

        // users
        RiakDatatype element = fetch.get().getCrdtElement();
        assertNotNull(element);
        assertTrue(element.isMap());
        RiakMap usersMap = element.getAsMap();

        // username
        List<RiakDatatype> usernameElement = usersMap.get(BinaryValue.create(username));
        assertNotNull(usernameElement);
      assertEquals(1, usernameElement.size());
View Full Code Here

Examples of com.basho.riak.client.core.query.crdt.types.RiakDatatype

            new CoreFutureAdapter<FetchSet.Response, Location, DtFetchOperation.Response, Location>(coreFuture) {

            @Override
            protected FetchSet.Response convertResponse(DtFetchOperation.Response coreResponse)
            {
                RiakDatatype element = coreResponse.getCrdtElement();
               
                Context context = null;
                if (coreResponse.hasContext())
                {
                    context = new Context(coreResponse.getContext());
View Full Code Here

Examples of com.basho.riak.client.core.query.crdt.types.RiakDatatype

                protected Response convertResponse(DtUpdateOperation.Response coreResponse)
                {
                    RiakSet set = null;
                    if (coreResponse.hasCrdtElement())
                    {
                        RiakDatatype element = coreResponse.getCrdtElement();
                        set = element.getAsSet();
                    }
                    BinaryValue returnedKey = coreResponse.hasGeneratedKey()
                        ? coreResponse.getGeneratedKey()
                        : null;
                    Context returnedCtx = null;
View Full Code Here

Examples of com.basho.riak.client.core.query.crdt.types.RiakDatatype

            new CoreFutureAdapter<FetchMap.Response, Location, DtFetchOperation.Response, Location>(coreFuture) {

            @Override
            protected FetchMap.Response convertResponse(DtFetchOperation.Response coreResponse)
            {
                RiakDatatype element = coreResponse.getCrdtElement();
               
                Context context = null;
                if (coreResponse.hasContext())
                {
                    context = new Context(coreResponse.getContext());
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.