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

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


        records.add(new NodeId.NodeIdRecord(id6, 10L));

        ContextState ctx = ContextState.allocate(6, 3, allocator);
        ctx.writeElement(id1, 1L, 1L, true);
        ctx.writeElement(NodeId.fromInt(2), 2L, 2L);
        ctx.writeElement(id3, 3L, 3L, true);
        ctx.writeElement(NodeId.fromInt(4), 6L, 3L);
        ctx.writeElement(NodeId.fromInt(5), 7L, 3L, true);
        ctx.writeElement(id6, 5L, 6L);

        ByteBuffer merger = cc.computeOldShardMerger(ctx.context, records, Integer.MAX_VALUE);
View Full Code Here


        ContextState ctx = ContextState.allocate(6, 3, allocator);
        ctx.writeElement(id1, 1L, 1L, true);
        ctx.writeElement(NodeId.fromInt(2), 2L, 2L);
        ctx.writeElement(id3, 3L, 3L, true);
        ctx.writeElement(NodeId.fromInt(4), 6L, 3L);
        ctx.writeElement(NodeId.fromInt(5), 7L, 3L, true);
        ctx.writeElement(id6, 5L, 6L);

        ByteBuffer merger = cc.computeOldShardMerger(ctx.context, records, Integer.MAX_VALUE);
        ByteBuffer merged = cc.merge(ctx.context, merger, allocator);
View Full Code Here

        ContextState ctx = ContextState.allocate(6, 3, allocator);
        ctx.writeElement(id1, 1L, 1L, true);
        ctx.writeElement(NodeId.fromInt(2), 2L, 2L);
        ctx.writeElement(id3, 3L, 3L, true);
        ctx.writeElement(NodeId.fromInt(4), 6L, 3L);
        ctx.writeElement(NodeId.fromInt(5), 7L, 3L, true);
        ctx.writeElement(id6, 5L, 6L);

        ByteBuffer merger = cc.computeOldShardMerger(ctx.context, records, Integer.MAX_VALUE);
        ByteBuffer merged = cc.merge(ctx.context, merger, allocator);
        assert cc.total(ctx.context) == cc.total(merged);
View Full Code Here

        ctx.writeElement(id1, 1L, 1L, true);
        ctx.writeElement(NodeId.fromInt(2), 2L, 2L);
        ctx.writeElement(id3, 3L, 3L, true);
        ctx.writeElement(NodeId.fromInt(4), 6L, 3L);
        ctx.writeElement(NodeId.fromInt(5), 7L, 3L, true);
        ctx.writeElement(id6, 5L, 6L);

        ByteBuffer merger = cc.computeOldShardMerger(ctx.context, records, Integer.MAX_VALUE);
        ByteBuffer merged = cc.merge(ctx.context, merger, allocator);
        assert cc.total(ctx.context) == cc.total(merged);
View Full Code Here

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

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

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

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

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

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

        left.writeElement(NodeId.fromInt(12), 0L, 0L);

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

        assert ContextRelationship.GREATER_THAN ==
            cc.diff(left.context, right.context);
       
        // less than: left has subset of nodes (counts equal)
View Full Code Here

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

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

        assert ContextRelationship.LESS_THAN ==
View Full Code Here

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

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

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

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

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

        assert ContextRelationship.LESS_THAN ==
            cc.diff(left.context, right.context);
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.