Examples of truncateBlocking()


Examples of org.apache.cassandra.db.ColumnFamilyStore.truncateBlocking()

    @Test
    public void testFileRemoval() throws InterruptedException
    {
        Keyspace keyspace = Keyspace.open(KEYSPACE);
        ColumnFamilyStore cfs = keyspace.getColumnFamilyStore(CF);
        cfs.truncateBlocking();
        ArrayBackedSortedColumns cf = ArrayBackedSortedColumns.factory.create(cfs.metadata);
        for (int i = 0; i < 100; i++)
            cf.addColumn(Util.cellname(i), ByteBuffer.allocate(1000), 1);
        File dir = cfs.directories.getDirectoryForNewSSTables();
        SSTableWriter writer = getWriter(cfs, dir);
View Full Code Here

Examples of org.apache.cassandra.db.ColumnFamilyStore.truncateBlocking()

    @Test
    public void testFileRemovalNoAbort() throws InterruptedException
    {
        Keyspace keyspace = Keyspace.open(KEYSPACE);
        ColumnFamilyStore cfs = keyspace.getColumnFamilyStore(CF);
        cfs.truncateBlocking();
        ArrayBackedSortedColumns cf = ArrayBackedSortedColumns.factory.create(cfs.metadata);
        for (int i = 0; i < 1000; i++)
            cf.addColumn(Util.column(String.valueOf(i), "a", 1));
        File dir = cfs.directories.getDirectoryForNewSSTables();
        SSTableWriter writer = getWriter(cfs, dir);
View Full Code Here

Examples of org.apache.cassandra.db.ColumnFamilyStore.truncateBlocking()

    @Test
    public void testNumberOfFilesAndSizes() throws Exception
    {
        Keyspace keyspace = Keyspace.open(KEYSPACE);
        ColumnFamilyStore cfs = keyspace.getColumnFamilyStore(CF);
        cfs.truncateBlocking();

        SSTableReader s = writeFile(cfs, 1000);
        cfs.addSSTable(s);
        long startStorageMetricsLoad = StorageMetrics.load.count();
        Set<SSTableReader> compacting = Sets.newHashSet(s);
View Full Code Here

Examples of org.apache.cassandra.db.ColumnFamilyStore.truncateBlocking()

    @Test
    public void testNumberOfFiles_dont_clean_readers() throws Exception
    {
        Keyspace keyspace = Keyspace.open(KEYSPACE);
        ColumnFamilyStore cfs = keyspace.getColumnFamilyStore(CF);
        cfs.truncateBlocking();

        SSTableReader s = writeFile(cfs, 1000);
        cfs.addSSTable(s);

        Set<SSTableReader> compacting = Sets.newHashSet(s);
View Full Code Here

Examples of org.apache.cassandra.db.ColumnFamilyStore.truncateBlocking()

    @Test
    public void testNumberOfFiles_abort() throws Exception
    {
        Keyspace keyspace = Keyspace.open(KEYSPACE);
        ColumnFamilyStore cfs = keyspace.getColumnFamilyStore(CF);
        cfs.truncateBlocking();

        SSTableReader s = writeFile(cfs, 1000);
        cfs.addSSTable(s);
        long startSize = cfs.metric.liveDiskSpaceUsed.count();
        DecoratedKey origFirst = s.first;
View Full Code Here

Examples of org.apache.cassandra.db.ColumnFamilyStore.truncateBlocking()

    @Test
    public void testNumberOfFiles_abort2() throws Exception
    {
        Keyspace keyspace = Keyspace.open(KEYSPACE);
        ColumnFamilyStore cfs = keyspace.getColumnFamilyStore(CF);
        cfs.truncateBlocking();

        SSTableReader s = writeFile(cfs, 1000);
        cfs.addSSTable(s);

        DecoratedKey origFirst = s.first;
View Full Code Here

Examples of org.apache.cassandra.db.ColumnFamilyStore.truncateBlocking()

            assertEquals(sstablesToCorrupt + 1, cfs.getSSTables().size());
            break;
        }


        cfs.truncateBlocking();
        assertEquals(failures, sstablesToCorrupt);
    }
}
View Full Code Here

Examples of org.apache.cassandra.db.ColumnFamilyStore.truncateBlocking()

    {
        String ksname = "Keyspace1";
        String cfname = "Standard1";
        Keyspace keyspace = Keyspace.open(ksname);
        ColumnFamilyStore cfs = keyspace.getColumnFamilyStore(cfname);
        cfs.truncateBlocking();
        cfs.disableAutoCompaction();

        ByteBuffer value = ByteBuffer.wrap(new byte[100]);

        // create 3 sstables
View Full Code Here

Examples of org.apache.cassandra.db.ColumnFamilyStore.truncateBlocking()

    {
        String ksname = "Keyspace1";
        String cfname = "Standard1";
        Keyspace keyspace = Keyspace.open(ksname);
        ColumnFamilyStore cfs = keyspace.getColumnFamilyStore(cfname);
        cfs.truncateBlocking();
        cfs.disableAutoCompaction();

        ByteBuffer value = ByteBuffer.wrap(new byte[100]);

        // create 10 sstables
View Full Code Here

Examples of org.apache.cassandra.db.ColumnFamilyStore.truncateBlocking()

            assertEquals(sstablesToCorrupt + 1, cfs.getSSTables().size());
            break;
        }


        cfs.truncateBlocking();
        assertEquals(failures, sstablesToCorrupt);
    }
}
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.