Package org.apache.cassandra.db.context.CounterContext

Examples of org.apache.cassandra.db.context.CounterContext.ContextState.writeElement()


        left.writeElement(NodeId.fromInt(9), 2L, 0L);

        right = ContextState.allocate(4, 0, allocator);
        right.writeElement(NodeId.fromInt(3)4L, 0L);
        right.writeElement(NodeId.fromInt(6)3L, 0L);
        right.writeElement(NodeId.fromInt(9)2L, 0L);
        right.writeElement(NodeId.fromInt(12), 1L, 0L);

        assert ContextRelationship.DISJOINT ==
            cc.diff(left.context, right.context);
View Full Code Here


        right = ContextState.allocate(4, 0, allocator);
        right.writeElement(NodeId.fromInt(3)4L, 0L);
        right.writeElement(NodeId.fromInt(6)3L, 0L);
        right.writeElement(NodeId.fromInt(9)2L, 0L);
        right.writeElement(NodeId.fromInt(12), 1L, 0L);

        assert ContextRelationship.DISJOINT ==
            cc.diff(left.context, right.context);

        // disjoint: mixed nodes and counts
View Full Code Here

        left.writeElement(NodeId.fromInt(3), 5L, 0L);
        left.writeElement(NodeId.fromInt(6), 2L, 0L);
        left.writeElement(NodeId.fromInt(9), 2L, 0L);

        right = ContextState.allocate(4, 0, allocator);
        right.writeElement(NodeId.fromInt(3)4L, 0L);
        right.writeElement(NodeId.fromInt(6)3L, 0L);
        right.writeElement(NodeId.fromInt(9)2L, 0L);
        right.writeElement(NodeId.fromInt(12), 1L, 0L);

        assert ContextRelationship.DISJOINT ==
View Full Code Here

        left.writeElement(NodeId.fromInt(6), 2L, 0L);
        left.writeElement(NodeId.fromInt(9), 2L, 0L);

        right = ContextState.allocate(4, 0, allocator);
        right.writeElement(NodeId.fromInt(3)4L, 0L);
        right.writeElement(NodeId.fromInt(6)3L, 0L);
        right.writeElement(NodeId.fromInt(9)2L, 0L);
        right.writeElement(NodeId.fromInt(12), 1L, 0L);

        assert ContextRelationship.DISJOINT ==
            cc.diff(left.context, right.context);
View Full Code Here

        left.writeElement(NodeId.fromInt(9), 2L, 0L);

        right = ContextState.allocate(4, 0, allocator);
        right.writeElement(NodeId.fromInt(3)4L, 0L);
        right.writeElement(NodeId.fromInt(6)3L, 0L);
        right.writeElement(NodeId.fromInt(9)2L, 0L);
        right.writeElement(NodeId.fromInt(12), 1L, 0L);

        assert ContextRelationship.DISJOINT ==
            cc.diff(left.context, right.context);
View Full Code Here

        right = ContextState.allocate(4, 0, allocator);
        right.writeElement(NodeId.fromInt(3)4L, 0L);
        right.writeElement(NodeId.fromInt(6)3L, 0L);
        right.writeElement(NodeId.fromInt(9)2L, 0L);
        right.writeElement(NodeId.fromInt(12), 1L, 0L);

        assert ContextRelationship.DISJOINT ==
            cc.diff(left.context, right.context);

        left = ContextState.allocate(4, 0, allocator);
View Full Code Here

        left.writeElement(NodeId.fromInt(6), 2L, 0L);
        left.writeElement(NodeId.fromInt(7), 2L, 0L);
        left.writeElement(NodeId.fromInt(9), 2L, 0L);

        right = ContextState.allocate(3, 0, allocator);
        right.writeElement(NodeId.fromInt(3), 4L, 0L);
        right.writeElement(NodeId.fromInt(6), 3L, 0L);
        right.writeElement(NodeId.fromInt(9), 2L, 0L);

        assert ContextRelationship.DISJOINT ==
            cc.diff(left.context, right.context);
View Full Code Here

        left.writeElement(NodeId.fromInt(7), 2L, 0L);
        left.writeElement(NodeId.fromInt(9), 2L, 0L);

        right = ContextState.allocate(3, 0, allocator);
        right.writeElement(NodeId.fromInt(3), 4L, 0L);
        right.writeElement(NodeId.fromInt(6), 3L, 0L);
        right.writeElement(NodeId.fromInt(9), 2L, 0L);

        assert ContextRelationship.DISJOINT ==
            cc.diff(left.context, right.context);
    }
View Full Code Here

        left.writeElement(NodeId.fromInt(9), 2L, 0L);

        right = ContextState.allocate(3, 0, allocator);
        right.writeElement(NodeId.fromInt(3), 4L, 0L);
        right.writeElement(NodeId.fromInt(6), 3L, 0L);
        right.writeElement(NodeId.fromInt(9), 2L, 0L);

        assert ContextRelationship.DISJOINT ==
            cc.diff(left.context, right.context);
    }
View Full Code Here

    private void runMerge(Allocator allocator)
    {
        // note: local counts aggregated; remote counts are reconciled (i.e. take max)
        ContextState left = ContextState.allocate(4, 1, allocator);
        left.writeElement(NodeId.fromInt(1), 1L, 1L);
        left.writeElement(NodeId.fromInt(2), 2L, 2L);
        left.writeElement(NodeId.fromInt(4), 6L, 3L);
        left.writeElement(NodeId.getLocalId(), 7L, 3L, true);

        ContextState right = ContextState.allocate(3, 1, allocator);
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.