Package org.apache.cassandra.thrift

Examples of org.apache.cassandra.thrift.CfDef$CfDefStandardSchemeFactory


     */
    private void loadData() throws TException, InvalidRequestException, UnavailableException, TimedOutException,
            SchemaDisagreementException
    {
        KsDef ksDef = null;
        CfDef user_Def = new CfDef();
        user_Def.name = "users";
        user_Def.keyspace = "KunderaExamples";
        user_Def.setComparator_type("UTF8Type");
        user_Def.setDefault_validation_class("UTF8Type");
        user_Def.setColumn_type("Super");

        List<CfDef> cfDefs = new ArrayList<CfDef>();
        cfDefs.add(user_Def);

        try
View Full Code Here


    public static boolean columnFamilyExist(String columnfamilyName, String keyspaceName)
    {
        try
        {
            client.set_keyspace(keyspaceName);
            client.system_add_column_family(new CfDef(keyspaceName, columnfamilyName));
        }
        catch (InvalidRequestException irex)
        {
        
            StringBuilder builder = new StringBuilder("Cannot add already existing column family ");
View Full Code Here

    }

    private void createSchema() throws InvalidRequestException, SchemaDisagreementException, TException
    {
        KsDef ksDef = null;
        CfDef user_Def = new CfDef();
        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);

        try
View Full Code Here

     */
    private void createKeyspaceAndColumnFamily(String keyspace, String columnFamily, KsDef ksDef)
    {

        List<CfDef> cfDefs = new ArrayList<CfDef>();
        CfDef cfDef = new CfDef(keyspace, columnFamily); // thrift client.
        cfDef.setDefault_validation_class("UTF8Type");
        cfDef.setKey_validation_class("UTF8Type");
        cfDef.setComparator_type("UTF8Type");

        CfDef cfDef1 = new CfDef(keyspace, "kthrift" + columnFamily); // kundera
                                                                      // thrift
                                                                      // client.
        cfDef1.setDefault_validation_class("UTF8Type");
        cfDef1.setKey_validation_class("UTF8Type");
        cfDef1.setComparator_type("UTF8Type");

        CfDef cfDef2 = new CfDef(keyspace, "kpelops" + columnFamily); // kundera
                                                                      // pelops
                                                                      // client.
        cfDef2.setDefault_validation_class("UTF8Type");
        cfDef2.setKey_validation_class("UTF8Type");
        cfDef2.setComparator_type("UTF8Type");

        CfDef cfDef3 = new CfDef(keyspace, "pelops" + columnFamily); // pelops
                                                                     // client.
        cfDef3.setDefault_validation_class("UTF8Type");
        cfDef3.setKey_validation_class("UTF8Type");
        cfDef3.setComparator_type("UTF8Type");

        cfDefs.add(cfDef);
        cfDefs.add(cfDef1);
        cfDefs.add(cfDef2);
        cfDefs.add(cfDef3);
View Full Code Here

    private static void loadData() throws TException, InvalidRequestException, UnavailableException, TimedOutException,
            SchemaDisagreementException
    {
        KsDef ksDef = null;
        CfDef professionalCfDef = new CfDef();
        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);

        List<CfDef> cfDefs = new ArrayList<CfDef>();
        cfDefs.add(professionalCfDef);

        try
View Full Code Here

     */
    private static void loadData() throws TException, InvalidRequestException, UnavailableException, TimedOutException,
            SchemaDisagreementException
    {
        KsDef ksDef = null;
        CfDef user_Def = new CfDef();
        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);
        cfDefs.add(person_Def);
        cfDefs.add(address_Def);
View Full Code Here

     */
    private void loadData() throws TException, InvalidRequestException, UnavailableException, TimedOutException,
            SchemaDisagreementException
    {
        KsDef ksDef = null;
        CfDef user_Def = new CfDef();
        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);

        try
View Full Code Here

            SchemaDisagreementException
    {

        KsDef ksDef = null;

        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);
        cfDefs.add(address_Def);
View Full Code Here

    {
        CassandraCli.cassandraSetUp();
        CassandraCli.createKeySpace("KunderaExamples");
        Cassandra.Client client = CassandraCli.getClient();
        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

     */
    private void loadData() throws TException, InvalidRequestException, UnavailableException, TimedOutException,
            SchemaDisagreementException
    {
        KsDef ksDef = null;
        CfDef user_Def = new CfDef();
        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);

        try
View Full Code Here

TOP

Related Classes of org.apache.cassandra.thrift.CfDef$CfDefStandardSchemeFactory

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.