Package com.impetus.kundera.configure.ClientProperties.DataStore

Examples of com.impetus.kundera.configure.ClientProperties.DataStore.Schema


        /**
         * @return the replication_factor
         */
        public String getReplication_factor(String schemaName)
        {
            Schema schema = getSchema(schemaName);
            String replication = "1";
            if (schema != null && schema.getSchemaProperties() != null && !schema.getSchemaProperties().isEmpty())
            {
                replication = schema.getSchemaProperties().getProperty(CassandraConstants.REPLICATION_FACTOR);
            }

            if (logger.isInfoEnabled())
            {
                logger.info("Returning replication factor value {}", replication);
View Full Code Here


        /**
         * @return the placement_strategy
         */
        public String getPlacement_strategy(String schemaName)
        {
            Schema schema = getSchema(schemaName);
            String placementStrategy = SimpleStrategy.class.getName();
            if (schema != null && schema.getSchemaProperties() != null && !schema.getSchemaProperties().isEmpty())
            {
                placementStrategy = schema.getSchemaProperties().getProperty(CassandraConstants.PLACEMENT_STRATEGY);
            }

            if (logger.isInfoEnabled())
            {
                logger.info("Returning placement strategy value {}", placementStrategy);
View Full Code Here

            return null;
        }

        public Table getColumnFamily(String schemaName, String cfName)
        {
            Schema schema = getSchema(schemaName);
            if (schema != null)
            {
                if (schema.getTables() != null)
                {
                    for (Table table : schema.getTables())
                    {
                        if (table != null && table.getName() != null && table.getName().equalsIgnoreCase(cfName))
                        {
                            return table;
                        }
View Full Code Here

        String createKeyspace = CQLTranslator.CREATE_KEYSPACE;
        String placement_strategy = csmd.getPlacement_strategy(databaseName);
        String replication_conf = CQLTranslator.SIMPLE_REPLICATION;
        createKeyspace = createKeyspace.replace("$KEYSPACE", "\"" + databaseName + "\"");

        Schema schema = CassandraPropertyReader.csmd.getSchema(databaseName);

        if (schema != null && schema.getName() != null && schema.getName().equalsIgnoreCase(databaseName)
                && schema.getSchemaProperties() != null)
        {
            Properties schemaProperties = schema.getSchemaProperties();
            if (placement_strategy.equalsIgnoreCase(SimpleStrategy.class.getSimpleName())
                    || placement_strategy.equalsIgnoreCase(SimpleStrategy.class.getName()))
            {
                String replicationFactor = schemaProperties.getProperty(CassandraConstants.REPLICATION_FACTOR,
                        CassandraConstants.DEFAULT_REPLICATION_FACTOR);

                replication_conf = replication_conf.replace("$REPLICATION_FACTOR", replicationFactor);
                createKeyspace = createKeyspace.replace("$CLASS", placement_strategy);
            }
            else if (placement_strategy.equalsIgnoreCase(NetworkTopologyStrategy.class.getSimpleName())
                    || placement_strategy.equalsIgnoreCase(NetworkTopologyStrategy.class.getName()))
            {

                if (schema.getDataCenters() != null && !schema.getDataCenters().isEmpty())
                {
                    StringBuilder builder = new StringBuilder();

                    for (DataCenter dc : schema.getDataCenters())
                    {
                        builder.append(CQLTranslator.QUOTE_STR);
                        builder.append(dc.getName());
                        builder.append(":");
                        builder.append(dc.getValue());
View Full Code Here

     * @param strategy_options
     *            the strategy_options
     */
    private void setProperties(KsDef ksDef, Map<String, String> strategy_options)
    {
        Schema schema = CassandraPropertyReader.csmd.getSchema(databaseName);
        if (schema != null && schema.getName() != null && schema.getName().equalsIgnoreCase(databaseName)
                && schema.getSchemaProperties() != null)
        {
            setKeyspaceProperties(ksDef, schema.getSchemaProperties(), strategy_options, schema.getDataCenters());
        }
        else
        {
            setDefaultReplicationFactor(strategy_options);
        }
View Full Code Here

            cfDef.setKeyspace(databaseName);
            cfDef.setName(tableInfo.getTableName());
            cfDef.setKey_validation_class(CassandraValidationClassMapper.getValidationClass(tableInfo.getTableIdType(),
                    isCql3Enabled(tableInfo)));

            Schema schema = CassandraPropertyReader.csmd.getSchema(databaseName);
            tables = schema != null ? schema.getTables() : null;

            Properties cfProperties = getColumnFamilyProperties(tableInfo);
            String defaultValidationClass = null;
            if (tableInfo.getType() != null && tableInfo.getType().equals(Type.SUPER_COLUMN_FAMILY.name()))
            {
View Full Code Here

TOP

Related Classes of com.impetus.kundera.configure.ClientProperties.DataStore.Schema

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.