Package org.apache.cassandra.db.IClock

Examples of org.apache.cassandra.db.IClock.ClockRelationship


     * The external input is assumed to be a superset of internal.
     */
    public ColumnFamily diff(ColumnFamily cfComposite)
    {
        ColumnFamily cfDiff = new ColumnFamily(cfComposite.type, cfComposite.clockType, getComparator(), getSubComparator(), cfComposite.reconciler, cfComposite.id());
        ClockRelationship rel = cfComposite.getMarkedForDeleteAt().compare(getMarkedForDeleteAt());
        if (ClockRelationship.GREATER_THAN == rel)
        {
            cfDiff.delete(cfComposite.getLocalDeletionTime(), cfComposite.getMarkedForDeleteAt());
        }

View Full Code Here


            {
                cf.remove(cname);
            }
            else
            {
                ClockRelationship rel = c.clock().compare(cf.getMarkedForDeleteAt());
                if ((ClockRelationship.LESS_THAN == rel) || (ClockRelationship.EQUAL == rel))
                {
                    cf.remove(cname);
                }
            }
View Full Code Here

                {
                    c.remove(subColumn.name());
                }
                else
                {
                    ClockRelationship subRel = subColumn.clock().compare(minClock);
                    if ((ClockRelationship.LESS_THAN == subRel) || (ClockRelationship.EQUAL == subRel))
                    {
                        c.remove(subColumn.name());
                    }
                }
View Full Code Here

    private TimestampReconciler()
    {/* singleton */}

    public Column reconcile(Column left, Column right)
    {
        ClockRelationship cr = left.clock().compare(right.clock());
        switch (cr)
        {
        case EQUAL:
            // tombstones take precedence.  (if both are tombstones, then it doesn't matter which one we use.)
            if (left.isMarkedForDelete())
View Full Code Here

    public IColumn diff(IColumn columnNew)
    {
        IClock _markedForDeleteAt = markedForDeleteAt.get();
        IColumn columnDiff = new SuperColumn(columnNew.name(), ((SuperColumn)columnNew).getComparator(), _markedForDeleteAt.type(), reconciler);
        ClockRelationship rel = columnNew.getMarkedForDeleteAt().compare(_markedForDeleteAt);
        if (ClockRelationship.GREATER_THAN == rel)
        {
            ((SuperColumn)columnDiff).markForDeleteAt(columnNew.getLocalDeletionTime(), columnNew.getMarkedForDeleteAt());
        }
View Full Code Here

    public static void atomicSetMax(AtomicReference<IClock> atomic, IClock newClock)
    {
        while (true)
        {
            IClock oldClock = atomic.get();
            ClockRelationship rel = oldClock.compare(newClock);
            if (rel == ClockRelationship.DISJOINT)
            {
                newClock = oldClock.getSuperset(Arrays.asList(newClock));
            }
            if (rel == ClockRelationship.GREATER_THAN || rel == ClockRelationship.EQUAL
View Full Code Here

public class TimestampReconciler extends AbstractReconciler
{

    public Column reconcile(Column left, Column right)
    {
        ClockRelationship cr = left.clock().compare(right.clock());
        switch (cr)
        {
        case EQUAL:
        case GREATER_THAN:
            return left;
View Full Code Here

            {
                cf.remove(cname);
            }
            else
            {
                ClockRelationship rel = c.clock().compare(cf.getMarkedForDeleteAt());
                if ((ClockRelationship.LESS_THAN == rel) || (ClockRelationship.EQUAL == rel))
                {
                    cf.remove(cname);
                }
            }
View Full Code Here

                {
                    c.remove(subColumn.name());
                }
                else
                {
                    ClockRelationship subRel = subColumn.clock().compare(minClock);
                    if ((ClockRelationship.LESS_THAN == subRel) || (ClockRelationship.EQUAL == subRel))
                    {
                        c.remove(subColumn.name());
                    }
                }
View Full Code Here

    }

    // note that we do not call this simply compareTo since it also makes sense to compare Columns by name
    public ClockRelationship comparePriority(Column o)
    {
        ClockRelationship rel = clock.compare(o.clock());

        // tombstone always wins ties.
        if (isMarkedForDelete())
        {
            switch (rel)
View Full Code Here

TOP

Related Classes of org.apache.cassandra.db.IClock.ClockRelationship

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.