Package org.apache.cassandra.db

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


        ColumnFamily scf1 = ColumnFamily.create("Keyspace1", "Super1");
        scf1.delete(new DeletionInfo(0L, (int) (System.currentTimeMillis() / 1000)));

        // these columns created after the previous deletion
        ColumnFamily scf2 = ColumnFamily.create("Keyspace1", "Super1");
        scf2.addColumn(superColumn(scf2, "super1", column("one", "A", 1), column("two", "A", 1)));

        //these columns created after the next delete
        ColumnFamily scf3 = ColumnFamily.create("Keyspace1", "Super1");
        scf3.addColumn(superColumn(scf3, "super1", column("two", "B", 3)));
        scf3.addColumn(superColumn(scf3, "super2", column("three", "A", 3), column("four", "A", 3)));
View Full Code Here


        ColumnFamily scf2 = ColumnFamily.create("Keyspace1", "Super1");
        scf2.addColumn(superColumn(scf2, "super1", column("one", "A", 1), column("two", "A", 1)));

        //these columns created after the next delete
        ColumnFamily scf3 = ColumnFamily.create("Keyspace1", "Super1");
        scf3.addColumn(superColumn(scf3, "super1", column("two", "B", 3)));
        scf3.addColumn(superColumn(scf3, "super2", column("three", "A", 3), column("four", "A", 3)));

        ColumnFamily scf4 = ColumnFamily.create("Keyspace1", "Super1");
        scf4.delete(new DeletionInfo(2L, (int) (System.currentTimeMillis() / 1000)));
View Full Code Here

        scf2.addColumn(superColumn(scf2, "super1", column("one", "A", 1), column("two", "A", 1)));

        //these columns created after the next delete
        ColumnFamily scf3 = ColumnFamily.create("Keyspace1", "Super1");
        scf3.addColumn(superColumn(scf3, "super1", column("two", "B", 3)));
        scf3.addColumn(superColumn(scf3, "super2", column("three", "A", 3), column("four", "A", 3)));

        ColumnFamily scf4 = ColumnFamily.create("Keyspace1", "Super1");
        scf4.delete(new DeletionInfo(2L, (int) (System.currentTimeMillis() / 1000)));

        ColumnFamily superResolved = RowRepairResolver.resolveSuperset(Arrays.asList(scf1, scf2, scf3, scf4));
View Full Code Here

                // Delete specific columns
                if (cfDef.isCompact)
                {
                    ByteBuffer columnName = builder.build();
                    QueryProcessor.validateColumnName(columnName);
                    cf.addColumn(params.makeTombstone(columnName));
                }
                else
                {
                    Iterator<Pair<CFDefinition.Name, Term>> iter = toRemove.iterator();
                    while (iter.hasNext())
View Full Code Here

                        else
                        {
                            ColumnNameBuilder b = iter.hasNext() ? builder.copy() : builder;
                            ByteBuffer columnName = b.add(column.name.key).build();
                            QueryProcessor.validateColumnName(columnName);
                            cf.addColumn(params.makeTombstone(columnName));
                        }
                    }
                }
            }
        }
View Full Code Here

            {
                // Delete specific columns
                if (cfDef.isCompact)
                {
                    ByteBuffer columnName = builder.build();
                    cf.addColumn(params.makeTombstone(columnName));
                }
                else
                {
                    for (Operation op : toRemove)
                        op.execute(key, cf, builder.copy(), params);
View Full Code Here

{
    @Test
    public void testResolveSupersetNewer()
    {
        ColumnFamily cf1 = ColumnFamily.create("Keyspace1", "Standard1");
        cf1.addColumn(column("c1", "v1", 0));

        ColumnFamily cf2 = ColumnFamily.create("Keyspace1", "Standard1");
        cf2.addColumn(column("c1", "v2", 1));

        ColumnFamily resolved = ReadResponseResolver.resolveSuperset(Arrays.asList(cf1, cf2));
View Full Code Here

    {
        ColumnFamily cf1 = ColumnFamily.create("Keyspace1", "Standard1");
        cf1.addColumn(column("c1", "v1", 0));

        ColumnFamily cf2 = ColumnFamily.create("Keyspace1", "Standard1");
        cf2.addColumn(column("c1", "v2", 1));

        ColumnFamily resolved = ReadResponseResolver.resolveSuperset(Arrays.asList(cf1, cf2));
        assertColumns(resolved, "c1");
        assertColumns(ColumnFamily.diff(cf1, resolved), "c1");
        assertNull(ColumnFamily.diff(cf2, resolved));
View Full Code Here

    @Test
    public void testResolveSupersetDisjoint()
    {
        ColumnFamily cf1 = ColumnFamily.create("Keyspace1", "Standard1");
        cf1.addColumn(column("c1", "v1", 0));

        ColumnFamily cf2 = ColumnFamily.create("Keyspace1", "Standard1");
        cf2.addColumn(column("c2", "v2", 1));

        ColumnFamily resolved = ReadResponseResolver.resolveSuperset(Arrays.asList(cf1, cf2));
View Full Code Here

    {
        ColumnFamily cf1 = ColumnFamily.create("Keyspace1", "Standard1");
        cf1.addColumn(column("c1", "v1", 0));

        ColumnFamily cf2 = ColumnFamily.create("Keyspace1", "Standard1");
        cf2.addColumn(column("c2", "v2", 1));

        ColumnFamily resolved = ReadResponseResolver.resolveSuperset(Arrays.asList(cf1, cf2));
        assertColumns(resolved, "c1", "c2");
        assertColumns(ColumnFamily.diff(cf1, resolved), "c2");
        assertColumns(ColumnFamily.diff(cf2, resolved), "c1");
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.