Package org.apache.cassandra.thrift

Examples of org.apache.cassandra.thrift.ColumnDef$ColumnDefStandardScheme


        user_Def.name = "PERSON_ADDRESS";
        user_Def.keyspace = "KunderaExamples";
        user_Def.setComparator_type("UTF8Type");
        user_Def.setDefault_validation_class("UTF8Type");
        user_Def.setKey_validation_class("UTF8Type");
        ColumnDef columnDef = new ColumnDef(ByteBuffer.wrap("PERSON_ID".getBytes()), "UTF8Type");
        columnDef.index_type = IndexType.KEYS;
        user_Def.addToColumn_metadata(columnDef);
        ColumnDef columnDef1 = new ColumnDef(ByteBuffer.wrap("ADDRESS_ID".getBytes()), "UTF8Type");
        columnDef1.index_type = IndexType.KEYS;
        user_Def.addToColumn_metadata(columnDef1);

        List<CfDef> cfDefs = new ArrayList<CfDef>();
        cfDefs.add(user_Def);
View Full Code Here


        professionalCfDef.name = COLUMN_FAMILY_PROFESSIONAL;
        professionalCfDef.keyspace = _KEYSPACE;
        professionalCfDef.setComparator_type("UTF8Type");
        professionalCfDef.setKey_validation_class("UTF8Type");

        ColumnDef departmentDef = new ColumnDef(ByteBuffer.wrap("DEPARTMENT_ID".getBytes()), "LongType");
        departmentDef.index_type = IndexType.KEYS;
        ColumnDef exceptionalDef = new ColumnDef(ByteBuffer.wrap("IS_EXCEPTIONAL".getBytes()), "BooleanType");
        exceptionalDef.index_type = IndexType.KEYS;
        ColumnDef enrolmentDateDef = new ColumnDef(ByteBuffer.wrap("ENROLMENT_DATE".getBytes()), "DateType");
        enrolmentDateDef.index_type = IndexType.KEYS;

        professionalCfDef.addToColumn_metadata(departmentDef);
        professionalCfDef.addToColumn_metadata(exceptionalDef);
        professionalCfDef.addToColumn_metadata(enrolmentDateDef);
View Full Code Here

        user_Def.name = "BOOK";
        user_Def.keyspace = _KEYSPACE;
        user_Def.setComparator_type("UTF8Type");
        user_Def.setKey_validation_class("UTF8Type");

        ColumnDef authorDef = new ColumnDef(ByteBuffer.wrap("AUTHOR".getBytes()), "UTF8Type");
        authorDef.index_type = IndexType.KEYS;
        ColumnDef publicationDef = new ColumnDef(ByteBuffer.wrap("PUBLICATION".getBytes()), "UTF8Type");
        publicationDef.index_type = IndexType.KEYS;
        user_Def.addToColumn_metadata(authorDef);
        user_Def.addToColumn_metadata(publicationDef);

        CfDef person_Def = new CfDef();
        person_Def.name = "PERSONNEL";
        person_Def.keyspace = _KEYSPACE;
        person_Def.setComparator_type("UTF8Type");
        person_Def.setKey_validation_class("UTF8Type");
        person_Def.setComparator_type("UTF8Type");
        person_Def.setDefault_validation_class("UTF8Type");
        ColumnDef columnDef = new ColumnDef(ByteBuffer.wrap("PERSON_NAME".getBytes()), "UTF8Type");
        person_Def.addToColumn_metadata(columnDef);

        CfDef address_Def = new CfDef();
        address_Def.name = "ADDRESS";
        address_Def.keyspace = _KEYSPACE;
        address_Def.setKey_validation_class("UTF8Type");
        address_Def.setComparator_type("UTF8Type");
        ColumnDef street = new ColumnDef(ByteBuffer.wrap("STREET".getBytes()), "UTF8Type");
        street.index_type = IndexType.KEYS;
        address_Def.addToColumn_metadata(street);

        ColumnDef personId = new ColumnDef(ByteBuffer.wrap("PERSON_ID".getBytes()), "UTF8Type");
        personId.index_type = IndexType.KEYS;
        address_Def.addToColumn_metadata(personId);

        List<CfDef> cfDefs = new ArrayList<CfDef>();
        cfDefs.add(user_Def);
View Full Code Here

            }

            // Iterate over all columns for creating secondary index on them
            for (Column column : columns) {

                ColumnDef columnDef = new ColumnDef();

                columnDef.setName(column.getName());
                columnDef.setValidation_class(CassandraValidationClassMapper.getValidationClass(columnType, false));
                columnDef.setIndex_type(IndexType.KEYS);

                // Add secondary index only if it's not already created
                // (if already created, it would be there in column family
                // definition)
                if (!indexList.contains(new StringAccessor().fromBytes(String.class, column.getName()))) {
View Full Code Here

        prefrenceCfDef.name = "PREFERENCE";
        prefrenceCfDef.keyspace = keyspace;
        prefrenceCfDef.setComparator_type("UTF8Type");
        prefrenceCfDef.setDefault_validation_class("UTF8Type");
        prefrenceCfDef.setKey_validation_class("UTF8Type");
        ColumnDef columnDef = new ColumnDef(ByteBuffer.wrap("WEBSITE_THEME".getBytes()), "UTF8Type");
        columnDef.index_type = IndexType.KEYS;
        ColumnDef columnDef3 = new ColumnDef(ByteBuffer.wrap("PRIVACY_LEVEL".getBytes()), "UTF8Type");
        columnDef3.index_type = IndexType.KEYS;
        prefrenceCfDef.addToColumn_metadata(columnDef);
        prefrenceCfDef.addToColumn_metadata(columnDef3);

        CfDef externalLinkCfDef = new CfDef();
        externalLinkCfDef.name = "EXTERNAL_LINK";
        externalLinkCfDef.keyspace = keyspace;
        externalLinkCfDef.setComparator_type("UTF8Type");
        externalLinkCfDef.setDefault_validation_class("UTF8Type");
        externalLinkCfDef.setKey_validation_class("UTF8Type");
        ColumnDef columnDef1 = new ColumnDef(ByteBuffer.wrap("LINK_TYPE".getBytes()), "UTF8Type");
        columnDef1.index_type = IndexType.KEYS;
        ColumnDef columnDef2 = new ColumnDef(ByteBuffer.wrap("LINK_ADDRESS".getBytes()), "UTF8Type");
        columnDef2.index_type = IndexType.KEYS;
        ColumnDef columnDef4 = new ColumnDef(ByteBuffer.wrap("USER_ID".getBytes()), "UTF8Type");
        columnDef4.index_type = IndexType.KEYS;
        externalLinkCfDef.addToColumn_metadata(columnDef1);
        externalLinkCfDef.addToColumn_metadata(columnDef2);
        externalLinkCfDef.addToColumn_metadata(columnDef4);
View Full Code Here

        user_Def.name = "PERSONCASSANDRA";
        user_Def.keyspace = "KunderaExamples";
        user_Def.setComparator_type("UTF8Type");
        user_Def.setDefault_validation_class("UTF8Type");
        user_Def.setKey_validation_class("UTF8Type");
        ColumnDef columnDef = new ColumnDef(ByteBuffer.wrap("PERSON_NAME".getBytes()), "UTF8Type");
        columnDef.index_type = IndexType.KEYS;
        user_Def.addToColumn_metadata(columnDef);
        ColumnDef columnDef1 = new ColumnDef(ByteBuffer.wrap("AGE".getBytes()), "Int32Type");
        columnDef1.index_type = IndexType.KEYS;
        user_Def.addToColumn_metadata(columnDef1);
        ColumnDef columnDef2 = new ColumnDef(ByteBuffer.wrap("ENUM".getBytes()), "UTF8Type");
        columnDef2.index_type = IndexType.KEYS;
        user_Def.addToColumn_metadata(columnDef2);
        ColumnDef columnDef3 = new ColumnDef(ByteBuffer.wrap("MONTH_ENUM".getBytes()), "UTF8Type");
        columnDef3.index_type = IndexType.KEYS;
        user_Def.addToColumn_metadata(columnDef3);

        List<CfDef> cfDefs = new ArrayList<CfDef>();
        cfDefs.add(user_Def);
View Full Code Here

        CfDef user_Def = new CfDef();
        user_Def.name = CF_PERSON_BATCH;
        user_Def.keyspace = KEYSPACE_KUNDERA_EXAMPLES;
        user_Def.setComparator_type("UTF8Type");
        user_Def.setKey_validation_class("UTF8Type");
        ColumnDef columnDef = new ColumnDef(ByteBuffer.wrap("PERSON_NAME".getBytes()), "UTF8Type");
        columnDef.index_type = IndexType.KEYS;
        user_Def.addToColumn_metadata(columnDef);
        ColumnDef columnDef1 = new ColumnDef(ByteBuffer.wrap("AGE".getBytes()), "Int32Type");
        columnDef1.index_type = IndexType.KEYS;
        user_Def.addToColumn_metadata(columnDef1);
        ColumnDef columnDef2 = new ColumnDef(ByteBuffer.wrap("AGEss".getBytes()), "BytesType");
        columnDef2.index_type = IndexType.KEYS;
        user_Def.addToColumn_metadata(columnDef2);

        CfDef address_Def = new CfDef();
        address_Def.name = CF_ADDRESS_BATCH;
        address_Def.keyspace = KEYSPACE_KUNDERA_EXAMPLES;
        address_Def.setComparator_type("UTF8Type");
        address_Def.setKey_validation_class("UTF8Type");
        ColumnDef columnDefStreet = new ColumnDef(ByteBuffer.wrap("STREET".getBytes()), "UTF8Type");
        columnDefStreet.index_type = IndexType.KEYS;
        address_Def.addToColumn_metadata(columnDefStreet);

        List<CfDef> cfDefs = new ArrayList<CfDef>();
        cfDefs.add(user_Def);
View Full Code Here

        client.set_keyspace("KunderaExamples");
        CfDef cf_def = new CfDef();
        cf_def.keyspace = "KunderaExamples";
        cf_def.name = "users";
        cf_def.setKey_validation_class("UTF8Type");
        ColumnDef columnDef2 = new ColumnDef(ByteBuffer.wrap("full_name".getBytes()), "UTF8Type");
        columnDef2.index_type = IndexType.KEYS;
        cf_def.addToColumn_metadata(columnDef2);
        ColumnDef columnDef3 = new ColumnDef(ByteBuffer.wrap("birth_date".getBytes()), "Int32Type");
        columnDef3.index_type = IndexType.KEYS;
        cf_def.addToColumn_metadata(columnDef3);
        ColumnDef columnDef4 = new ColumnDef(ByteBuffer.wrap("state".getBytes()), "UTF8Type");
        columnDef4.index_type = IndexType.KEYS;
        cf_def.addToColumn_metadata(columnDef4);
        client.system_add_column_family(cf_def);
    }
View Full Code Here

        user_Def.name = "PERSON";
        user_Def.keyspace = "KunderaExamples";
        user_Def.setComparator_type("UTF8Type");
        user_Def.setDefault_validation_class("UTF8Type");
        user_Def.setKey_validation_class("UTF8Type");
        ColumnDef columnDef = new ColumnDef(ByteBuffer.wrap("PERSON_NAME".getBytes()), "UTF8Type");
        columnDef.index_type = IndexType.KEYS;
        user_Def.addToColumn_metadata(columnDef);
        ColumnDef columnDef1 = new ColumnDef(ByteBuffer.wrap("AGE".getBytes()), "UTF8Type");
        columnDef1.index_type = IndexType.KEYS;
        user_Def.addToColumn_metadata(columnDef1);
        ColumnDef columnDef2 = new ColumnDef(ByteBuffer.wrap("ENUM".getBytes()), "UTF8Type");
        columnDef2.index_type = IndexType.KEYS;
        user_Def.addToColumn_metadata(columnDef2);

        List<CfDef> cfDefs = new ArrayList<CfDef>();
        cfDefs.add(user_Def);
View Full Code Here

        user_Def.name = "users";
        user_Def.keyspace = "KunderaExamples";
        user_Def.setComparator_type("UTF8Type");
        user_Def.setDefault_validation_class("UTF8Type");
        user_Def.setKey_validation_class("UTF8Type");
        ColumnDef columnDef = new ColumnDef(ByteBuffer.wrap("birth_date".getBytes()), "Int32Type");
        columnDef.index_type = IndexType.KEYS;
        user_Def.addToColumn_metadata(columnDef);
        ColumnDef columnDef1 = new ColumnDef(ByteBuffer.wrap("state".getBytes()), "UTF8Type");
        columnDef1.index_type = IndexType.KEYS;
        user_Def.addToColumn_metadata(columnDef1);

        ColumnDef columnDef2 = new ColumnDef(ByteBuffer.wrap("full_name".getBytes()), "UTF8Type");
        columnDef2.index_type = IndexType.KEYS;
        user_Def.addToColumn_metadata(columnDef2);

        List<CfDef> cfDefs = new ArrayList<CfDef>();
        cfDefs.add(user_Def);
View Full Code Here

TOP

Related Classes of org.apache.cassandra.thrift.ColumnDef$ColumnDefStandardScheme

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.