Package me.prettyprint.hector.api.ddl

Examples of me.prettyprint.hector.api.ddl.ColumnFamilyDefinition


// ColumnFamilyInitializer Implementation
//----------------------------------------------------------------------------------------------------------------------

    @Override
    public void initializeColumnFamilies(Cluster cluster) {
        ColumnFamilyDefinition definition = HFactory.createColumnFamilyDefinition(keyspace.getKeyspaceName(), columnFamily);
        definition.setComparatorType(mapper.getComparatorType());
        String alias = mapper.getComparatorTypeAlias();
        if (alias != null) {
            definition.setComparatorTypeAlias(mapper.getComparatorTypeAlias());
        }
        CassidyUtils.createColumnFamily(cluster, definition);
    }
View Full Code Here


// ColumnFamilyInitializer Implementation
//----------------------------------------------------------------------------------------------------------------------

    @Override
    public void initializeColumnFamilies(Cluster cluster) {
        ColumnFamilyDefinition indexColumnFamilyDef = HFactory.createColumnFamilyDefinition(keyspace.getKeyspaceName(), indexColumnFamily, ComparatorType.DYNAMICCOMPOSITETYPE);
        indexColumnFamilyDef.setComparatorTypeAlias(DynamicComposite.DEFAULT_DYNAMIC_COMPOSITE_ALIASES);
        CassidyUtils.createColumnFamily(cluster, indexColumnFamilyDef);

        ColumnFamilyDefinition entryColumnFamilyDef = HFactory.createColumnFamilyDefinition(keyspace.getKeyspaceName(), entryColumnFamily, ComparatorType.INTEGERTYPE);
        CassidyUtils.createColumnFamily(cluster, entryColumnFamilyDef);
    }
View Full Code Here

        columnsDefinition.add(createColumnDefinition("t_long", ComparatorType.LONGTYPE));
        columnsDefinition.add(createColumnDefinition("t_boolean", ComparatorType.BOOLEANTYPE));
        columnsDefinition.add(createColumnDefinition("t_uuid", ComparatorType.UUIDTYPE));
        columnsDefinition.add(createColumnDefinition("t_lexical_uuid", ComparatorType.LEXICALUUIDTYPE));

        ColumnFamilyDefinition cfDef = HFactory.createColumnFamilyDefinition(
                keyspaceName,
                columnFamilyName,
                ComparatorType.UTF8TYPE,
                columnsDefinition.build());

        cfDef.setColumnType(ColumnType.STANDARD);
        cfDef.setComment("presto test table");

        cfDef.setKeyValidationClass(ComparatorType.UTF8TYPE.getTypeName());

        columnFamilyDefinitions.add(cfDef);

        return columnFamilyDefinitions;
    }
View Full Code Here

        this.indexer = indexer;
        createColumnFamilies(context, indexColumnFamily, entryColumnFamily);
    }

    private static void createColumnFamilies(CassidyContext context, String indexColumnFamily, String entryColumnFamily) {
        ColumnFamilyDefinition indexColumnFamilyDef = context.keyspaceHelper().createColumnFamilyDefinition(indexColumnFamily);
        indexColumnFamilyDef.setComparatorType(ComparatorType.DYNAMICCOMPOSITETYPE);
        indexColumnFamilyDef.setComparatorTypeAlias(DynamicComposite.DEFAULT_DYNAMIC_COMPOSITE_ALIASES);
        context.keyspaceHelper().createColumnFamily(indexColumnFamilyDef);

        ColumnFamilyDefinition entryColumnFamilyDef = context.keyspaceHelper().createColumnFamilyDefinition(entryColumnFamily);
        entryColumnFamilyDef.setComparatorType(ComparatorType.INTEGERTYPE);
        context.keyspaceHelper().createColumnFamily(entryColumnFamilyDef);
    }
View Full Code Here

        this.mapper = mapper;
        createColumnFamily(context, columnFamily, mapper);
    }

    private static <N, V> void createColumnFamily(CassidyContext context, String columnFamily, ColumnMapper<N, V> mapper) {
        ColumnFamilyDefinition definition = context.keyspaceHelper().createColumnFamilyDefinition(columnFamily);

        definition.setComparatorType(mapper.getComparatorType());
        String alias = mapper.getComparatorTypeAlias();
        if (alias != null) {
            definition.setComparatorTypeAlias(mapper.getComparatorTypeAlias());
        }
        context.keyspaceHelper().createColumnFamily(definition);
    }
View Full Code Here

        columnsDefinition.add(createColumnDefinition("t_long", ComparatorType.LONGTYPE));
        columnsDefinition.add(createColumnDefinition("t_boolean", ComparatorType.BOOLEANTYPE));
        columnsDefinition.add(createColumnDefinition("t_uuid", ComparatorType.UUIDTYPE));
        columnsDefinition.add(createColumnDefinition("t_lexical_uuid", ComparatorType.LEXICALUUIDTYPE));

        ColumnFamilyDefinition cfDef = HFactory.createColumnFamilyDefinition(
                keyspaceName,
                columnFamilyName,
                ComparatorType.UTF8TYPE,
                columnsDefinition.build());

        cfDef.setColumnType(ColumnType.STANDARD);
        cfDef.setComment("presto test table");

        cfDef.setKeyValidationClass(ComparatorType.UTF8TYPE.getTypeName());

        columnFamilyDefinitions.add(cfDef);

        return columnFamilyDefinitions;
    }
View Full Code Here

        columnsDefinition.add(createColumnDefinition("t_long", ComparatorType.LONGTYPE));
        columnsDefinition.add(createColumnDefinition("t_boolean", ComparatorType.BOOLEANTYPE));
        columnsDefinition.add(createColumnDefinition("t_uuid", ComparatorType.UUIDTYPE));
        columnsDefinition.add(createColumnDefinition("t_lexical_uuid", ComparatorType.LEXICALUUIDTYPE));

        ColumnFamilyDefinition cfDef = HFactory.createColumnFamilyDefinition(
                keyspaceName,
                columnFamilyName,
                ComparatorType.UTF8TYPE,
                columnsDefinition.build());

        cfDef.setColumnType(ColumnType.STANDARD);
        cfDef.setComment("presto test table");

        cfDef.setKeyValidationClass(ComparatorType.UTF8TYPE.getTypeName());

        columnFamilyDefinitions.add(cfDef);

        return columnFamilyDefinitions;
    }
View Full Code Here

    private void addColumnFamily(ThriftCluster cluster, String cfName, int rowCacheKeysToSave) {

        String cassandraKeyspace = this.env.getProperty("cassandra.keyspace");

        ColumnFamilyDefinition cfd =
                HFactory.createColumnFamilyDefinition(cassandraKeyspace, cfName);

        cfd.setRowCacheKeysToSave(rowCacheKeysToSave);
        cluster.addColumnFamily(cfd);
    }
View Full Code Here

    private void addColumnFamilySortedbyUUID(ThriftCluster cluster, String cfName, int rowCacheKeysToSave) {

        String cassandraKeyspace = this.env.getProperty("cassandra.keyspace");

        ColumnFamilyDefinition cfd =
                HFactory.createColumnFamilyDefinition(cassandraKeyspace, cfName);

        cfd.setRowCacheKeysToSave(rowCacheKeysToSave);
        cfd.setComparatorType(ComparatorType.UUIDTYPE);
        cluster.addColumnFamily(cfd);
    }
View Full Code Here

        columnsDefinition.add(createColumnDefinition("t_long", ComparatorType.LONGTYPE));
        columnsDefinition.add(createColumnDefinition("t_boolean", ComparatorType.BOOLEANTYPE));
        columnsDefinition.add(createColumnDefinition("t_uuid", ComparatorType.UUIDTYPE));
        columnsDefinition.add(createColumnDefinition("t_lexical_uuid", ComparatorType.LEXICALUUIDTYPE));

        ColumnFamilyDefinition cfDef = HFactory.createColumnFamilyDefinition(
                keyspaceName,
                columnFamilyName,
                ComparatorType.UTF8TYPE,
                columnsDefinition.build());

        cfDef.setColumnType(ColumnType.STANDARD);
        cfDef.setComment("presto test table");

        cfDef.setKeyValidationClass(ComparatorType.UTF8TYPE.getTypeName());

        columnFamilyDefinitions.add(cfDef);

        return columnFamilyDefinitions;
    }
View Full Code Here

TOP

Related Classes of me.prettyprint.hector.api.ddl.ColumnFamilyDefinition

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.