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

Examples of com.basho.riak.client.core.query.crdt.ops.SetOp


    }

    @Override
    public SetOp getOp()
    {
        return new SetOp(adds, removes);
    }
View Full Code Here


    {

        BinaryValue addition = BinaryValue.create("1");
        BinaryValue removal = BinaryValue.create("2");

        SetOp op = new SetOp()
            .add(addition)
            .remove(removal);

        DtUpdateOperation.Builder operation = new DtUpdateOperation.Builder(namespace);
        RiakDtPB.SetOp setOp = operation.getSetOp(op);
View Full Code Here

        BinaryValue mapAddValue = BinaryValue.create("value");

        MapOp op = new MapOp()
            .update(counterKey, new CounterOp(1))
            .update(setKey, new SetOp().add(setAddValue))
            .update(flagKey, new FlagOp(true))
            .update(registerKey, new RegisterOp(registerValue))
            .update(mapKey, new MapOp());

        DtUpdateOperation.Builder operation = new DtUpdateOperation.Builder(namespace);
View Full Code Here

            BinaryValue wrapped = BinaryValue.create(buff.array());
            testValues.add(wrapped);

            DtUpdateOperation update =
                new DtUpdateOperation.Builder(location)
                    .withOp(new SetOp().add(wrapped))
                    .withReturnBody(true)
                    .build();

            cluster.execute(update);
            DtUpdateOperation.Response resp = update.get();
            ctx = resp.getContext();
            set = resp.getCrdtElement().getAsSet();
        }

        assertEquals(iterations, set.view().size());
        assertEquals(testValues, set.view());

       
        for (BinaryValue setElement : testValues)
        {

            DtUpdateOperation update =
                new DtUpdateOperation.Builder(location)
                    .withOp(new SetOp().remove(setElement))
                    .withContext(ctx)
                    .build();

            cluster.execute(update);
            update.get();
View Full Code Here

            BinaryValue wrapped = BinaryValue.create(buff.array());
            testValues.add(wrapped);

            DtUpdateOperation add =
                new DtUpdateOperation.Builder(location)
                    .withOp(new SetOp().add(wrapped))
                    .withReturnBody(true)
                    .build();

            cluster.execute(add);
            DtUpdateOperation.Response resp = add.get();

            DtUpdateOperation delete =
                new DtUpdateOperation.Builder(location)
                    .withOp(new SetOp().remove(wrapped))
                    .withContext(resp.getContext())
                    .build();

            cluster.execute(delete);
            delete.get();
View Full Code Here

        BinaryValue setValue = BinaryValue.create("value");
        BinaryValue mapKey = BinaryValue.create("set");
       
        DtUpdateOperation update =
            new DtUpdateOperation.Builder(location)
                .withOp(new MapOp().update(mapKey, new SetOp().add(setValue)))
                .build();

        cluster.execute(update);
        update.get();
View Full Code Here

        byte[] now = nowBinary.array();
       
        CounterOp counterOp = new CounterOp(1);
        RegisterOp registerOp = new RegisterOp(BinaryValue.create(now));
        FlagOp flagOp = new FlagOp(false);
        SetOp setOp = new SetOp()
                        .add(BinaryValue.create("Item 1"))
                        .add(BinaryValue.create("Item 2"));
       
        innerMap.update(logins, counterOp)
                .update(lastLogin, registerOp)
View Full Code Here

        BinaryValue key = BinaryValue.create("simple-map");
        BinaryValue mapKey = BinaryValue.create("set");
        Namespace ns = new Namespace(mapBucketType, bucketName);
        Location loc = new Location(ns, key);
       
        SetOp setOp = new SetOp()
                        .add(BinaryValue.create("Item 1"))
                        .add(BinaryValue.create("Item 2"));
       
       
        MapOp op = new MapOp().update(mapKey, setOp);
View Full Code Here

     * @return the update used by the client core.
     */
    @Override
    public SetOp getOp()
    {
        return new SetOp(adds, removes);
    }
View Full Code Here

TOP

Related Classes of com.basho.riak.client.core.query.crdt.ops.SetOp

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.