Package org.apache.cassandra.db

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


    {
        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 = RowRepairResolver.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


    @Test
    public void testResolveSupersetNullOne()
    {
        ColumnFamily cf2 = ColumnFamily.create("Keyspace1", "Standard1");
        cf2.addColumn(column("c2", "v2", 1));

        ColumnFamily resolved = RowRepairResolver.resolveSuperset(Arrays.asList(null, cf2));
        assertColumns(resolved, "c2");
        assertColumns(ColumnFamily.diff(null, resolved), "c2");
        assertNull(ColumnFamily.diff(cf2, resolved));
View Full Code Here

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

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

    }

    private ColumnFamily createCF()
    {
        ColumnFamily cf = ArrayBackedSortedColumns.factory.create(keyspaceName, standardCFName);
        cf.addColumn(column("vijay", "try", 1));
        cf.addColumn(column("to", "be_nice", 1));
        return cf;
    }

    private ColumnFamily createCounterCF()
View Full Code Here

    private ColumnFamily createCF()
    {
        ColumnFamily cf = ArrayBackedSortedColumns.factory.create(keyspaceName, standardCFName);
        cf.addColumn(column("vijay", "try", 1));
        cf.addColumn(column("to", "be_nice", 1));
        return cf;
    }

    private ColumnFamily createCounterCF()
    {
View Full Code Here

    }

    private ColumnFamily createCounterCF()
    {
        ColumnFamily cf = ArrayBackedSortedColumns.factory.create(keyspaceName, counterCFName);
        cf.addColumn(counterColumn("vijay", 1L, 1));
        cf.addColumn(counterColumn("wants", 1000000, 1));
        return cf;
    }

    @Test
View Full Code Here

    private ColumnFamily createCounterCF()
    {
        ColumnFamily cf = ArrayBackedSortedColumns.factory.create(keyspaceName, counterCFName);
        cf.addColumn(counterColumn("vijay", 1L, 1));
        cf.addColumn(counterColumn("wants", 1000000, 1));
        return cf;
    }

    @Test
    public void testCFSerialization() throws IOException
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

    public static ColumnFamily createCF(long mfda, int ldt, IColumn... cols)
    {
        ColumnFamily cf = ColumnFamily.create(TABLENAME, CFNAME);
        cf.delete(new DeletionInfo(mfda, ldt));
        for (IColumn col : cols)
            cf.addColumn(col);
        return cf;
    }

    public static File tempSSTableFile(String tablename, String cfname) throws IOException
    {
View Full Code Here

        {
            Map<String, ColumnFamily> map = new HashMap<String, ColumnFamily>();
            for (String key : keys)
            {
                ColumnFamily cf = ColumnFamily.create(ksname, cfname);
                cf.addColumn(new Column(ByteBufferUtil.bytes(key), ByteBufferUtil.bytes(key), 0));
                map.put(key, cf);
            }
            return write(map);
        }
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.