Examples of apply()


Examples of org.apache.cassandra.config.CFMetaData.apply()

        removeIndexDef.index_type = org.apache.cassandra.avro.IndexType.KEYS;
        removeIndexDef.name = ByteBuffer.wrap(new byte[] { 0 });
        removeIndexDef.validation_class = BytesType.class.getName();
        assert cfDef.column_metadata.remove(removeIndexDef);
       
        cfm.apply(cfDef);
       
        for (int i = 1; i < indexes.size(); i++)
            assert cfm.getColumn_metadata().get(ByteBuffer.wrap(new byte[] { 1 })) != null;
        assert cfm.getColumn_metadata().get(ByteBuffer.wrap(new byte[] { 0 })) == null;
        assert cfm.getColumn_metadata().get(ByteBuffer.wrap(new byte[] { 5 })) != null;
View Full Code Here

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

            for (int j = 0; j < 10; j++)
                rm.add("Standard1", Util.cellname(Integer.toString(j)),
                       ByteBufferUtil.EMPTY_BYTE_BUFFER,
                       timestamp,
                       0);
            rm.apply();
        }
        store.forceBlockingFlush();
        return store;
    }
   
View Full Code Here

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

        ColumnFamilyStore cfs = table.getColumnFamilyStore("Standard1");

        ByteBuffer key = ByteBufferUtil.bytes("k");
        RowMutation rm = new RowMutation("Keyspace1", key);
        rm.add(new QueryPath("Standard1", null, ByteBufferUtil.bytes("c")), ByteBufferUtil.EMPTY_BYTE_BUFFER, 0);
        rm.apply();
        cfs.forceBlockingFlush();

        assertBytes(cfs, Integer.MAX_VALUE, true);
    }
View Full Code Here

Examples of org.apache.cassandra.db.migration.AddColumnFamily.apply()

        // add a cf.
        CFMetaData newCf1 = addTestCF("Keyspace1", "MigrationCf_1", "Migration CF");

        Migration m1 = new AddColumnFamily(newCf1);
        m1.apply();
        UUID ver1 = m1.getVersion();
        assert DatabaseDescriptor.getDefsVersion().equals(ver1);
       
        // rename it.
        Migration m2 = new RenameColumnFamily("Keyspace1", "MigrationCf_1", "MigrationCf_2");
View Full Code Here

Examples of org.apache.cassandra.db.migration.AddKeyspace.apply()

        DatabaseDescriptor.loadSchemas();
        assert DatabaseDescriptor.getNonSystemTables().size() == 0;
       
        // add a few.
        AddKeyspace ks0 = new AddKeyspace(new KSMetaData("ks0", SimpleStrategy.class, null, 3));
        ks0.apply();
        AddKeyspace ks1 = new AddKeyspace(new KSMetaData("ks1", SimpleStrategy.class, null, 3));
        ks1.apply();
       
        assert DatabaseDescriptor.getTableDefinition("ks0") != null;
        assert DatabaseDescriptor.getTableDefinition("ks1") != null;
View Full Code Here

Examples of org.apache.cassandra.db.migration.DropColumnFamily.apply()

        UUID ver2 = m2.getVersion();
        assert DatabaseDescriptor.getDefsVersion().equals(ver2);
       
        // drop it.
        Migration m3 = new DropColumnFamily("Keyspace1", "MigrationCf_2");
        m3.apply();
        UUID ver3 = m3.getVersion();
        assert DatabaseDescriptor.getDefsVersion().equals(ver3);
       
        // now lets load the older migrations to see if that code works.
        Collection<IColumn> serializedMigrations = Migration.getLocalMigrations(ver1, ver3);
View Full Code Here

Examples of org.apache.cassandra.db.migration.Migration.apply()

                            else
                            {
                                logger.debug("Applying {} from {}", m.getClass().getSimpleName(), message.getFrom());
                                try
                                {
                                    m.apply();
                                    // update gossip, but don't contact nodes directly
                                    m.passiveAnnounce();
                                }
                                catch (ConfigurationException ex)
                                {
View Full Code Here

Examples of org.apache.cassandra.db.migration.RenameColumnFamily.apply()

        UUID ver1 = m1.getVersion();
        assert DatabaseDescriptor.getDefsVersion().equals(ver1);
       
        // rename it.
        Migration m2 = new RenameColumnFamily("Keyspace1", "MigrationCf_1", "MigrationCf_2");
        m2.apply();
        UUID ver2 = m2.getVersion();
        assert DatabaseDescriptor.getDefsVersion().equals(ver2);
       
        // drop it.
        Migration m3 = new DropColumnFamily("Keyspace1", "MigrationCf_2");
View Full Code Here

Examples of org.apache.cassandra.db.migration.UpdateColumnFamily.apply()

        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.cayenne.graph.GraphDiff.apply()

                newIds[0] = newId;
            }
        };

        diff.apply(diffChecker);
        assertEquals(1, diffChecker.getCallbackCount());
        assertSame(a.getObjectId(), newIds[0]);
       
        // commit a mix of new and modified
        Painting p = context.newObject(Painting.class);
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.