Examples of AddKeyspace


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

    {
        assert DatabaseDescriptor.getTableDefinition("EmptyKeyspace") == null;
       
        KSMetaData newKs = new KSMetaData("EmptyKeyspace", SimpleStrategy.class, null, 5);

        new AddKeyspace(newKs).apply();
        assert DatabaseDescriptor.getTableDefinition("EmptyKeyspace") != null;

        CFMetaData newCf = addTestCF("EmptyKeyspace", "AddedLater", "A new CF to add to an empty KS");

        //should not exist until apply
View Full Code Here

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

    {
        // create a keyspace to serve as existing.
        CFMetaData cf = addTestCF("UpdatedKeyspace", "AddedStandard1", "A new cf for a new ks");
        KSMetaData oldKs = new KSMetaData(cf.tableName, SimpleStrategy.class, null, 5, cf);
       
        new AddKeyspace(oldKs).apply();
       
        assert DatabaseDescriptor.getTableDefinition(cf.tableName) != null;
        assert DatabaseDescriptor.getTableDefinition(cf.tableName) == oldKs;
       
        // anything with cf defs should fail.
View Full Code Here

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

    public void testUpdateColumnFamilyNoIndexes() throws ConfigurationException, IOException, ExecutionException, InterruptedException
    {
        // create a keyspace with a cf to update.
        CFMetaData cf = addTestCF("UpdatedCfKs", "Standard1added", "A new cf that will be updated");
        KSMetaData ksm = new KSMetaData(cf.tableName, SimpleStrategy.class, null, 1, cf);
        new AddKeyspace(ksm).apply();
       
        assert DatabaseDescriptor.getTableDefinition(cf.tableName) != null;
        assert DatabaseDescriptor.getTableDefinition(cf.tableName) == ksm;
        assert DatabaseDescriptor.getCFMetaData(cf.tableName, cf.cfName) != null;
       
View Full Code Here

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

                    throw new ConfigurationException("Cannot import schema when one already exists");
            
                Migration migration = null;
                for (KSMetaData table : tables)
                {
                    migration = new AddKeyspace(table);
                    migration.apply();
                }
                return migration;
            }
        };
View Full Code Here

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

                try
                {
                    KSMetaData ksm = new KSMetaData(create.getName(),
                                                    AbstractReplicationStrategy.getClass(create.getStrategyClass()),
                                                    create.getStrategyOptions());
                    applyMigrationOnStage(new AddKeyspace(ksm));
                }
                catch (ConfigurationException e)
                {
                    InvalidRequestException ex = new InvalidRequestException(e.getMessage());
                    ex.initCause(e);
View Full Code Here

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

            KSMetaData ksm = new KSMetaData(ks_def.name,
                                            AbstractReplicationStrategy.getClass(ks_def.strategy_class),
                                            ks_def.strategy_options,
                                            ks_def.replication_factor,
                                            cfDefs.toArray(new CFMetaData[cfDefs.size()]));
            applyMigrationOnStage(new AddKeyspace(ksm));
            return DatabaseDescriptor.getDefsVersion().toString();
        }
        catch (ConfigurationException e)
        {
            InvalidRequestException ex = new InvalidRequestException(e.getMessage());
View Full Code Here

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

                    ksDef.name.toString(),
                    AbstractReplicationStrategy.getClass(ksDef.strategy_class.toString()),
                    strategyOptions,
                    ksDef.replication_factor,
                    cfDefs.toArray(new CFMetaData[cfDefs.size()]));
            applyMigrationOnStage(new AddKeyspace(ksmeta));
            return DatabaseDescriptor.getDefsVersion().toString();
           
        }
        catch (ConfigurationException e)
        {
View Full Code Here

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

                    throw new ConfigurationException("Cannot import schema when one already exists");
            
                Migration migration = null;
                for (KSMetaData table : tables)
                {
                    migration = new AddKeyspace(table);
                    migration.apply();
                }
                return migration;
            }
        };
View Full Code Here

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

        DecoratedKey dk = Util.dk("key0");
        CFMetaData newCf = addTestCF("NewKeyspace1", "AddedStandard1", "A new cf for a new ks");

        KSMetaData newKs = new KSMetaData(newCf.tableName, SimpleStrategy.class, null, 5, newCf);
       
        new AddKeyspace(newKs).apply();
       
        assert DatabaseDescriptor.getTableDefinition(newCf.tableName) != null;
        assert DatabaseDescriptor.getTableDefinition(newCf.tableName) == newKs;

        // test reads and writes.
View Full Code Here

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

    {
        assert DatabaseDescriptor.getTableDefinition("EmptyKeyspace") == null;
       
        KSMetaData newKs = new KSMetaData("EmptyKeyspace", SimpleStrategy.class, null, 5);

        new AddKeyspace(newKs).apply();
        assert DatabaseDescriptor.getTableDefinition("EmptyKeyspace") != null;

        CFMetaData newCf = addTestCF("EmptyKeyspace", "AddedLater", "A new CF to add to an empty KS");

        //should not exist until apply
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.