Package com.netflix.astyanax.ddl

Examples of com.netflix.astyanax.ddl.KeyspaceDefinition


        cfProps.put("compression_options.sstable_compression", "");
       
        cluster.createColumnFamily(cfProps);
       
        Properties cfProps1 = cluster.getKeyspaceProperties(keyspaceName);
        KeyspaceDefinition ksdef = cluster.describeKeyspace(keyspaceName);
        ColumnFamilyDefinition cfdef = ksdef.getColumnFamily("cf1");
        LOG.info(cfProps1.toString());
       
        LOG.info(cfdef.getProperties().toString());
        Assert.assertEquals(cfProps1.get("cf_defs.cf1.comparator_type"), "org.apache.cassandra.db.marshal.BytesType");
       
View Full Code Here


                        }, RunOnce.get());
    }

    @Override
    public Properties getKeyspaceProperties() throws ConnectionException {
        KeyspaceDefinition ksDef = this.describeKeyspace();
        if (ksDef == null)
            throw new NotFoundException(String.format("Keyspace '%s' not found", getKeyspaceName()));
       
        Properties props = new Properties();
        ThriftKeyspaceDefinitionImpl thriftKsDef = (ThriftKeyspaceDefinitionImpl)ksDef;
View Full Code Here

        return props;
    }

    @Override
    public Properties getColumnFamilyProperties(String columnFamily) throws ConnectionException {
        KeyspaceDefinition ksDef = this.describeKeyspace();
        ColumnFamilyDefinition cfDef = ksDef.getColumnFamily(columnFamily);
        if (cfDef == null)
            throw new NotFoundException(String.format("Column family '%s' in keyspace '%s' not found", columnFamily, getKeyspaceName()));
       
        Properties props = new Properties();
        ThriftColumnFamilyDefinitionImpl thriftCfDef = (ThriftColumnFamilyDefinitionImpl)cfDef;
View Full Code Here

                        "CREATE TABLE users (id text PRIMARY KEY, given text, surname text, favs map<text, text>);")
                .execute();

        Thread.sleep(CASSANDRA_WAIT_TIME);

        KeyspaceDefinition ki = keyspaceContext.getEntity().describeKeyspace();
        LOG.info("Describe Keyspace: " + ki.getName());

    }
View Full Code Here

        keyspace.createColumnFamily(CF_ALL_ROWS,            null);
        keyspace.createColumnFamily(CF_ALL_ROWS_TOMBSTONE,  null);
        keyspace.createColumnFamily(CF_LOTS_OF_ROWS,        null);
        keyspace.createColumnFamily(CF_CHECKPOINTS,         null);
       
        KeyspaceDefinition ki = keyspaceContext.getEntity().describeKeyspace();
        System.out.println("Describe Keyspace: " + ki.getName());

        MutationBatch m;
        try {
            m = keyspace.prepareMutationBatch();
            // Add 10 rows
View Full Code Here

        return props;
    }

    @Override
    public Properties getKeyspaceProperties(String keyspace) throws ConnectionException {
        KeyspaceDefinition ksDef = this.describeKeyspace(keyspace);
        if (ksDef == null)
            throw new NotFoundException(String.format("Keyspace '%s' not found", keyspace));
       
        Properties props = new Properties();
        ThriftKeyspaceDefinitionImpl thriftKsDef = (ThriftKeyspaceDefinitionImpl)ksDef;
View Full Code Here

        return props;
    }

    @Override
    public Properties getColumnFamilyProperties(String keyspace, String columnFamily) throws ConnectionException {
        KeyspaceDefinition ksDef = this.describeKeyspace(keyspace);
        ColumnFamilyDefinition cfDef = ksDef.getColumnFamily(columnFamily);
        if (cfDef == null)
            throw new NotFoundException(String.format("Column family '%s' in keyspace '%s' not found", columnFamily, keyspace));
       
        Properties props = new Properties();
        ThriftColumnFamilyDefinitionImpl thriftCfDef = (ThriftColumnFamilyDefinitionImpl)cfDef;
View Full Code Here

                                .put("index_type",       "KEYS")
                                .build())
                        .build())
                     .build());
       
        KeyspaceDefinition ki = keyspaceContext.getClient().describeKeyspace();
        System.out.println("Describe Keyspace: " + ki.getName());

        try {
            //
            // CF_Super :
            // 'A' :
View Full Code Here

       
    }
   
    @Test
    public void getKeyspaceDefinition() throws Exception {
        KeyspaceDefinition def = keyspaceContext.getEntity().describeKeyspace();
        Collection<String> fieldNames = def.getFieldNames();
        LOG.info("Getting field names");
        for (String field : fieldNames) {
            LOG.info(field);
        }
        LOG.info(fieldNames.toString());
       
        for (FieldMetadata field : def.getFieldsMetadata()) {
            LOG.info(field.getName() + " = " + def.getFieldValue(field.getName()) + " (" + field.getType() + ")");
        }
       
        for (ColumnFamilyDefinition cfDef : def.getColumnFamilyList()) {
            LOG.info("----------" );
            for (FieldMetadata field : cfDef.getFieldsMetadata()) {
                LOG.info(field.getName() + " = " + cfDef.getFieldValue(field.getName()) + " (" + field.getType() + ")");
            }
        }
View Full Code Here

        }
    }
   
    @Test
    public void testCopyKeyspace() throws Exception {
        KeyspaceDefinition def = keyspaceContext.getEntity().describeKeyspace();
        Properties props = def.getProperties();
       
        for (Entry<Object, Object> prop : props.entrySet()) {
            LOG.info(prop.getKey() + " : " + prop.getValue());
        }
       
View Full Code Here

TOP

Related Classes of com.netflix.astyanax.ddl.KeyspaceDefinition

Copyright © 2018 www.massapicom. 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.