Examples of addAtom()


Examples of org.apache.cassandra.db.ColumnFamily.addAtom()

            if (isRange)
            {
                ByteBuffer start = builder.copy().build();
                ByteBuffer end = builder.buildAsEndOfRange();
                QueryProcessor.validateColumnName(start); // If start is good, end is too
                cf.addAtom(params.makeRangeTombstone(start, end));
            }
            else
            {
                // Delete specific columns
                if (cfDef.isCompact)
View Full Code Here

Examples of org.apache.cassandra.db.ColumnFamily.addAtom()

                                // Delete the whole collection
                                ByteBuffer start = builder.copy().add(column.name.key).build();
                                QueryProcessor.validateColumnName(start);
                                ColumnNameBuilder b = iter.hasNext() ? builder.copy() : builder;
                                ByteBuffer end = b.add(column.name.key).buildAsEndOfRange();
                                cf.addAtom(params.makeRangeTombstone(start, end));
                            }
                            else
                            {
                                builder.add(column.name.key);
                                List<Term> args = Collections.singletonList(keySelected);
View Full Code Here

Examples of org.apache.cassandra.db.ColumnFamily.addAtom()

        // Verify results
        SSTableReader reader = SSTableReader.open(Descriptor.fromFilename(tempSS.getPath()));
        QueryFilter qf = QueryFilter.getIdentityFilter(Util.dk("rowA"), "Standard1", System.currentTimeMillis());
        OnDiskAtomIterator iter = qf.getSSTableColumnIterator(reader);
        ColumnFamily cf = cloneForAdditions(iter);
        while (iter.hasNext()) cf.addAtom(iter.next());
        assert cf.getColumn(Util.cellname("colAA")).value().equals(hexToBytes("76616c4141"));
        assert !(cf.getColumn(Util.cellname("colAA")) instanceof BufferDeletedCell);
        Cell expCol = cf.getColumn(Util.cellname("colAC"));
        assert expCol.value().equals(hexToBytes("76616c4143"));
        assert expCol instanceof ExpiringCell;
View Full Code Here

Examples of org.apache.cassandra.db.ColumnFamily.addAtom()

        SSTableReader reader = SSTableReader.open(Descriptor.fromFilename(tempSS.getPath()));
        QueryFilter qf = QueryFilter.getIdentityFilter(Util.dk("rowA"), "Standard1", System.currentTimeMillis());
        OnDiskAtomIterator iter = qf.getSSTableColumnIterator(reader);
        ColumnFamily cf = cloneForAdditions(iter);
        while (iter.hasNext())
            cf.addAtom(iter.next());
        assert cf.getColumn(Util.cellname("colAA")).value().equals(hexToBytes("76616c4141"));
        assert !(cf.getColumn(Util.cellname("colAA")) instanceof BufferDeletedCell);
        Cell expCol = cf.getColumn(Util.cellname("colAC"));
        assert expCol.value().equals(hexToBytes("76616c4143"));
        assert expCol instanceof ExpiringCell;
View Full Code Here

Examples of org.apache.cassandra.db.ColumnFamily.addAtom()

        QueryFilter qf = QueryFilter.getIdentityFilter(Util.dk("rowA"), "Standard1", System.currentTimeMillis());
        OnDiskAtomIterator iter = qf.getSSTableColumnIterator(reader);
        ColumnFamily cf = cloneForAdditions(iter);
        assertEquals(cf.deletionInfo(), new DeletionInfo(0, 0));
        while (iter.hasNext())
            cf.addAtom(iter.next());
        assert cf.getColumn(Util.cellname("colAA")).value().equals(hexToBytes("76616c4141"));
        assert !(cf.getColumn(Util.cellname("colAA")) instanceof BufferDeletedCell);
        Cell expCol = cf.getColumn(Util.cellname("colAC"));
        assert expCol.value().equals(hexToBytes("76616c4143"));
        assert expCol instanceof ExpiringCell;
View Full Code Here

Examples of org.apache.cassandra.db.ColumnFamily.addAtom()

        // Verify results
        SSTableReader reader = SSTableReader.open(Descriptor.fromFilename(tempSS.getPath()));
        QueryFilter qf = QueryFilter.getIdentityFilter(Util.dk("rowA"), "Counter1", System.currentTimeMillis());
        OnDiskAtomIterator iter = qf.getSSTableColumnIterator(reader);
        ColumnFamily cf = cloneForAdditions(iter);
        while (iter.hasNext()) cf.addAtom(iter.next());
        Cell c = cf.getColumn(Util.cellname("colAA"));
        assert c instanceof CounterCell : c;
        assert ((CounterCell) c).total() == 42;
    }
View Full Code Here

Examples of org.apache.cassandra.db.ColumnFamily.addAtom()

    {
        ColumnFamily cf = updates.cloneMeShallow();
        long t = UUIDGen.microsTimestamp(ballot);
        cf.deletionInfo().updateAllTimestamp(t);
        for (Column column : updates)
            cf.addAtom(column.withUpdatedTimestamp(t));
        return cf;
    }

    @Override
    public String toString()
View Full Code Here

Examples of org.apache.cassandra.db.ColumnFamily.addAtom()

            if (isRange)
            {
                assert toRemove.isEmpty();
                ByteBuffer start = builder.build();
                ByteBuffer end = builder.buildAsEndOfRange();
                cf.addAtom(params.makeRangeTombstone(start, end));
            }
            else
            {
                // Delete specific columns
                if (cfDef.isCompact)
View Full Code Here

Examples of org.apache.cassandra.db.ColumnFamily.addAtom()

    {
        ColumnFamily cf = rm.addOrGet(CFMetaData.SchemaTriggersCf);
        int ldt = (int) (System.currentTimeMillis() / 1000);
        ColumnNameBuilder builder = CFMetaData.SchemaTriggersCf.getCfDef().getColumnNameBuilder();
        builder.add(ByteBufferUtil.bytes(cfName)).add(ByteBufferUtil.bytes(tentry.getKey()));
        cf.addAtom(new RangeTombstone(builder.build(), builder.buildAsEndOfRange(), modificationTimestamp, ldt));
    }

    public static void update(CFMetaData cfm, String triggerName, String clazz)
    {
        Map<String, Map<String, String>> existingTriggers = cfm.getTriggers();
View Full Code Here

Examples of org.apache.cassandra.db.ColumnFamily.addAtom()

        // For the tombstones, we use t-1 so that when insert a collection literall, the range tombstone that deletes the previous values of
        // the collection and we want that to have a lower timestamp and our new values. Since tombstones wins over normal insert, using t-1
        // should not be a problem in general (see #6069).
        cf.deletionInfo().updateAllTimestamp(t-1);
        for (Column column : updates)
            cf.addAtom(column.withUpdatedTimestamp(t));
        return cf;
    }

    @Override
    public String toString()
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.