Package org.apache.cassandra.db

Examples of org.apache.cassandra.db.Mutation.apply()


        for (int j = 0; j < 100; j += 2)
        {
            ByteBuffer key = ByteBufferUtil.bytes(String.valueOf(j));
            Mutation rm = new Mutation("Keyspace1", key);
            rm.add("Standard1", cellname("0"), ByteBufferUtil.EMPTY_BYTE_BUFFER, j);
            rm.apply();
        }
        store.forceBlockingFlush();
        CompactionManager.instance.performMaximal(store);

        // check that all our keys are found correctly
View Full Code Here


        for (int j = 0; j < 100; j += 2)
        {
            ByteBuffer key = ByteBufferUtil.bytes(String.valueOf(j));
            Mutation rm = new Mutation("Keyspace1", key);
            rm.add("Standard1", cellname("0"), ByteBufferUtil.EMPTY_BYTE_BUFFER, j);
            rm.apply();
        }
        store.forceBlockingFlush();

        clearAndLoad(store);
        assert store.getMaxRowSize() != 0;
View Full Code Here

        for (int j = 0; j < 10; j++)
        {
            ByteBuffer key = ByteBufferUtil.bytes(String.valueOf(j));
            Mutation rm = new Mutation("Keyspace1", key);
            rm.add("Standard2", cellname("0"), ByteBufferUtil.EMPTY_BYTE_BUFFER, j);
            rm.apply();
        }
        store.forceBlockingFlush();
        CompactionManager.instance.performMaximal(store);

        SSTableReader sstable = store.getSSTables().iterator().next();
View Full Code Here

        Keyspace keyspace = Keyspace.open("Keyspace1");
        ColumnFamilyStore store = keyspace.getColumnFamilyStore("Indexed1");
        ByteBuffer key = ByteBufferUtil.bytes(String.valueOf("k1"));
        Mutation rm = new Mutation("Keyspace1", key);
        rm.add("Indexed1", cellname("birthdate"), ByteBufferUtil.bytes(1L), System.currentTimeMillis());
        rm.apply();
        store.forceBlockingFlush();

        // check if opening and querying works
        assertIndexQueryWorks(store);
    }
View Full Code Here

            if (store.metadata.getKeyValidator().compare(lastKey.getKey(), key.getKey()) < 0)
                lastKey = key;
            Mutation rm = new Mutation(ks, key.getKey());
            rm.add(cf, cellname("col"),
                   ByteBufferUtil.EMPTY_BYTE_BUFFER, timestamp);
            rm.apply();
        }
        store.forceBlockingFlush();

        SSTableReader sstable = store.getSSTables().iterator().next();
        Descriptor desc = sstable.descriptor;
View Full Code Here

        Keyspace keyspace = Keyspace.open("Keyspace1");
        ColumnFamilyStore store = keyspace.getColumnFamilyStore("Indexed1");
        ByteBuffer key = ByteBufferUtil.bytes(String.valueOf("k1"));
        Mutation rm = new Mutation("Keyspace1", key);
        rm.add("Indexed1", cellname("birthdate"), ByteBufferUtil.bytes(1L), System.currentTimeMillis());
        rm.apply();
        store.forceBlockingFlush();

        ColumnFamilyStore indexCfs = store.indexManager.getIndexForColumn(ByteBufferUtil.bytes("birthdate")).getIndexCfs();
        assert indexCfs.partitioner instanceof LocalPartitioner;
        SSTableReader sstable = indexCfs.getSSTables().iterator().next();
View Full Code Here

        Keyspace keyspace = Keyspace.open("Keyspace1");
        ColumnFamilyStore store = keyspace.getColumnFamilyStore("Standard1");
        ByteBuffer key = ByteBufferUtil.bytes(String.valueOf("k1"));
        Mutation rm = new Mutation("Keyspace1", key);
        rm.add("Standard1", cellname("xyz"), ByteBufferUtil.bytes("abc"), 0);
        rm.apply();
        store.forceBlockingFlush();
        boolean foundScanner = false;
        for (SSTableReader s : store.getSSTables())
        {
            ICompactionScanner scanner = s.getScanner(new Range<Token>(t(0), t(1), s.partitioner), null);
View Full Code Here

        for (int j = 0; j < 130; j++)
        {
            ByteBuffer key = ByteBufferUtil.bytes(String.valueOf(j));
            Mutation rm = new Mutation("Keyspace1", key);
            rm.add("Standard2", cellname("0"), ByteBufferUtil.EMPTY_BYTE_BUFFER, j);
            rm.apply();
        }
        store.forceBlockingFlush();
        CompactionManager.instance.performMaximal(store);

        // construct a range which is present in the sstable, but whose
View Full Code Here

        for (int j = 0; j < NUM_ROWS; j++)
        {
            ByteBuffer key = ByteBufferUtil.bytes(String.format("%3d", j));
            Mutation rm = new Mutation("Keyspace1", key);
            rm.add("StandardLowIndexInterval", Util.cellname("0"), ByteBufferUtil.bytes(String.format("%3d", j)), j);
            rm.apply();
        }
        store.forceBlockingFlush();
        CompactionManager.instance.performMaximal(store);

        Collection<SSTableReader> sstables = store.getSSTables();
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.