Examples of UpdateColumnFamily


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

        // drop the index
        CFMetaData meta = CFMetaData.rename(cfs.metadata, cfs.metadata.cfName); // abusing rename to clone
        ColumnDefinition cdOld = meta.column_metadata.values().iterator().next();
        ColumnDefinition cdNew = new ColumnDefinition(cdOld.name, cdOld.getValidator().getClass().getName(), null, null);
        meta.column_metadata.put(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

        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.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.toThrift());
        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

        }

        if (cfDef == null)
            throw new InvalidRequestException("Index '" + index + "' could not be found in any of the ColumnFamilies of keyspace '" + keyspace + "'");

        return new UpdateColumnFamily(cfDef);
    }
View Full Code Here

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

        }

        if (cfDef == null)
            throw new InvalidRequestException("Index '" + index + "' could not be found in any of the column families of keyspace '" + keyspace() + "'");

        return new UpdateColumnFamily(cfDef);
    }
View Full Code Here

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

                throw new InvalidRequestException("No column definition found for column " + columnName);
            }

            CFMetaData.addDefaultIndexNames(cf_def);
            ThriftValidation.validateCfDef(cf_def, oldCfm);
            return new UpdateColumnFamily(cf_def);
        }
        catch (InvalidRequestException e)
        {
            logger.error("oups", e);
            throw e;
View Full Code Here

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

                    cfProps.validate();
                    applyPropertiesToCfDef(thriftDef, cfProps);
                    break;
            }
            return new UpdateColumnFamily(thriftDef);
        }
        catch (ConfigurationException e)
        {
            InvalidRequestException ex = new InvalidRequestException(e.toString());
            ex.initCause(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

        // drop the index
        CFMetaData meta = CFMetaData.rename(cfs.metadata, cfs.metadata.cfName); // abusing rename to clone
        ColumnDefinition cdOld = meta.column_metadata.values().iterator().next();
        ColumnDefinition cdNew = new ColumnDefinition(cdOld.name, cdOld.getValidator().getClass().getName(), null, null);
        meta.column_metadata.put(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
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.