Examples of UpdateColumnFamily


Examples of org.apache.cassandra.db.migration.UpdateColumnFamily

        // drop the index
        CFMetaData meta = CFMetaData.rename(cfs.metadata, cfs.metadata.cfName); // abusing rename to clone
        ColumnDefinition cdOld = meta.getColumn_metadata().values().iterator().next();
        ColumnDefinition cdNew = new ColumnDefinition(cdOld.name, cdOld.getValidator(), null, null);
        meta.columnMetadata(Collections.singletonMap(cdOld.name, cdNew));
        UpdateColumnFamily update = new UpdateColumnFamily(CFMetaData.convertToAvro(meta));
        update.apply();

        // check
        assert cfs.getIndexedColumns().isEmpty();
        ColumnFamilyStore.scrubDataDirectories("Keyspace6", "Indexed1");
        assert !new File(desc.filenameFor(Component.DATA)).exists();
View Full Code Here

Examples of org.apache.cassandra.db.migration.UpdateColumnFamily

            throw new InvalidRequestException("Could not find column family definition to modify.");
       
        try
        {
            CFMetaData newCfm = oldCfm.apply(cf_def);
            UpdateColumnFamily update = new UpdateColumnFamily(oldCfm, newCfm);
            applyMigrationOnStage(update);
            return DatabaseDescriptor.getDefsVersion().toString();
        }
        catch (ConfigurationException e)
        {
View Full Code Here

Examples of org.apache.cassandra.db.migration.UpdateColumnFamily

            throw newInvalidRequestException("Could not find column family definition to modify.");
       
        try
        {
            CFMetaData newCfm = oldCfm.apply(cf_def);
            UpdateColumnFamily update = new UpdateColumnFamily(oldCfm, newCfm);
            applyMigrationOnStage(update);
            return DatabaseDescriptor.getDefsVersion().toString();
        }
        catch (ConfigurationException e)
        {
View Full Code Here

Examples of org.apache.cassandra.db.migration.UpdateColumnFamily

                CfDef cfamilyDef = CFMetaData.convertToAvro(oldCfm);
                cfamilyDef.column_metadata.add(columnDef.deflate());
               
                try
                {
                    applyMigrationOnStage(new UpdateColumnFamily(cfamilyDef));
                }
                catch (ConfigurationException e)
                {
                    InvalidRequestException ex = new InvalidRequestException(e.toString());
                    ex.initCause(e);
View Full Code Here

Examples of org.apache.cassandra.db.migration.UpdateColumnFamily

       
        try
        {
            // ideally, apply() would happen on the stage with the
            CFMetaData.applyImplicitDefaults(cf_def);
            UpdateColumnFamily update = new UpdateColumnFamily(CFMetaData.convertToAvro(cf_def));
            applyMigrationOnStage(update);
            return DatabaseDescriptor.getDefsVersion().toString();
        }
        catch (ConfigurationException e)
        {
View Full Code Here

Examples of org.apache.cassandra.db.migration.UpdateColumnFamily

        cf_def.min_compaction_threshold = 5;
        cf_def.max_compaction_threshold = 31;
       
        // test valid operations.
        cf_def.comment = "Modified comment";
        new UpdateColumnFamily(cf_def).apply(); // doesn't get set back here.
       
        cf_def.row_cache_size = 2d;
        new UpdateColumnFamily(cf_def).apply();
       
        cf_def.key_cache_size = 3d;
        new UpdateColumnFamily(cf_def).apply();
       
        cf_def.read_repair_chance = 0.23;
        new UpdateColumnFamily(cf_def).apply();
       
        cf_def.gc_grace_seconds = 12;
        new UpdateColumnFamily(cf_def).apply();
       
        cf_def.default_validation_class = "UTF8Type";
        new UpdateColumnFamily(cf_def).apply();

        cf_def.min_compaction_threshold = 3;
        new UpdateColumnFamily(cf_def).apply();

        cf_def.max_compaction_threshold = 33;
        new UpdateColumnFamily(cf_def).apply();

        // can't test changing the reconciler because there is only one impl.
       
        // check the cumulative affect.
        assert DatabaseDescriptor.getCFMetaData(cf.tableName, cf.cfName).getComment().equals(cf_def.comment);
View Full Code Here

Examples of org.apache.cassandra.db.migration.UpdateColumnFamily

        cf_def.min_compaction_threshold = 5;
        cf_def.max_compaction_threshold = 31;
       
        // test valid operations.
        cf_def.comment = "Modified comment";
        new UpdateColumnFamily(cf_def).apply(); // doesn't get set back here.
       
        cf_def.row_cache_size = 2d;
        new UpdateColumnFamily(cf_def).apply();
       
        cf_def.key_cache_size = 3d;
        new UpdateColumnFamily(cf_def).apply();
       
        cf_def.read_repair_chance = 0.23;
        new UpdateColumnFamily(cf_def).apply();
       
        cf_def.gc_grace_seconds = 12;
        new UpdateColumnFamily(cf_def).apply();
       
        cf_def.default_validation_class = "UTF8Type";
        new UpdateColumnFamily(cf_def).apply();

        cf_def.min_compaction_threshold = 3;
        new UpdateColumnFamily(cf_def).apply();

        cf_def.max_compaction_threshold = 33;
        new UpdateColumnFamily(cf_def).apply();

        // can't test changing the reconciler because there is only one impl.
       
        // check the cumulative affect.
        assert Schema.instance.getCFMetaData(cf.ksName, cf.cfName).getComment().equals(cf_def.comment);
View Full Code Here

Examples of org.apache.cassandra.db.migration.UpdateColumnFamily

        // drop the index
        CFMetaData meta = CFMetaData.rename(cfs.metadata, cfs.metadata.cfName); // abusing rename to clone
        ColumnDefinition cdOld = meta.getColumn_metadata().values().iterator().next();
        ColumnDefinition cdNew = new ColumnDefinition(cdOld.name, cdOld.getValidator(), null, null, null);
        meta.columnMetadata(Collections.singletonMap(cdOld.name, cdNew));
        UpdateColumnFamily update = new UpdateColumnFamily(meta.toAvro());
        update.apply();

        // check
        assert cfs.indexManager.getIndexedColumns().isEmpty();
        SSTableDeletingTask.waitForDeletions();
        assert !new File(desc.filenameFor(Component.DATA)).exists();
View Full Code Here

Examples of org.apache.cassandra.db.migration.UpdateColumnFamily

        cf_def.setMax_compaction_threshold(31);
       
        // test valid operations.
        cf_def.setComment("Modified comment");
        CFMetaData updateCfm = cf.apply(cf_def);
        new UpdateColumnFamily(cf, updateCfm).apply();
        cf = updateCfm;
       
        cf_def.setRow_cache_size(2d);
        updateCfm = cf.apply(cf_def);
        new UpdateColumnFamily(cf, updateCfm).apply();
        cf = updateCfm;
       
        cf_def.setKey_cache_size(3d);
        updateCfm = cf.apply(cf_def);
        new UpdateColumnFamily(cf, updateCfm).apply();
        cf = updateCfm;
       
        cf_def.setRead_repair_chance(0.23);
        updateCfm = cf.apply(cf_def);
        new UpdateColumnFamily(cf, updateCfm).apply();
        cf = updateCfm;
       
        cf_def.setGc_grace_seconds(12);
        updateCfm = cf.apply(cf_def);
        new UpdateColumnFamily(cf, updateCfm).apply();
        cf = updateCfm;
       
        cf_def.setDefault_validation_class("UTF8Type");
        updateCfm = cf.apply(cf_def);
        new UpdateColumnFamily(cf, updateCfm).apply();
        cf = updateCfm;

        cf_def.setMin_compaction_threshold(3);
        updateCfm = cf.apply(cf_def);
        new UpdateColumnFamily(cf, updateCfm).apply();
        cf = updateCfm;

        cf_def.setMax_compaction_threshold(33);
        updateCfm = cf.apply(cf_def);
        new UpdateColumnFamily(cf, updateCfm).apply();
        cf = updateCfm;

        // can't test changing the reconciler because there is only one impl.
       
        // check the cumulative affect.
View Full Code Here

Examples of org.apache.cassandra.db.migration.UpdateColumnFamily

            throw newInvalidRequestException("Could not find column family definition to modify.");
       
        try
        {
            CFMetaData newCfm = oldCfm.apply(cf_def);
            UpdateColumnFamily update = new UpdateColumnFamily(oldCfm, newCfm);
            applyMigrationOnStage(update);
            return DatabaseDescriptor.getDefsVersion().toString();
        }
        catch (ConfigurationException e)
        {
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.