src/java/org/apache/cassandra/cql/CreateKeyspaceStatement.java
/**
     * The <code>CqlParser</code> only goes as far as extracting the keyword arguments
     * from these statements, so this method is responsible for processing and
     * validating, and must be called prior to access.
     * 
     * @throws InvalidRequestException if arguments are missing or unacceptable
     */
The CqlParser only goes as far as extracting the keyword arguments
from these statements, so this method is responsible for processing and
validating, and must be called prior to access.

@throws InvalidRequestException if arguments are missing or unacceptable
The CqlParser only goes as far as extracting the keyword arguments from these statements so this method is responsible for processing and validating and must be called prior to access . @throws InvalidRequestException if arguments are missing or unacceptable
public void validate() throws InvalidRequestException
    {
        if (!name.matches("\\w+"))
            throw new InvalidRequestException(String.format("\"%s\" is not a valid keyspace name", name));
        if (name.length() > 32)
            throw new InvalidRequestException(String.format("Keyspace names shouldn't be more than 32 character long (got \"%s\")", name));
        if (!attrs.containsKey("strategy_class"))
            throw new InvalidRequestException("missing required argument \"strategy_class\"");
        strategyClass = attrs.get("strategy_class");
        for (String key : attrs.keySet())
            if ((key.contains(":")) && (key.startsWith("strategy_options")))
                strategyOptions.put(key.split(":")[1], attrs.get(key));
        try
        {
            AbstractReplicationStrategy.createReplicationStrategy(name,
                                                                  AbstractReplicationStrategy.getClass(strategyClass),
                                                                  StorageService.instance.getTokenMetadata(),
                                                                  DatabaseDescriptor.getEndpointSnitch(),
                                                                  strategyOptions);
        }
        catch (ConfigurationException e)
        {
            throw new InvalidRequestException(e.getMessage());
        }
    }
public void validate ( ) throws InvalidRequestException { if ( ! name . matches ( "\\w+" ) ) throw new InvalidRequestException ( String . format ( "\"%s\" is not a valid keyspace name" , name ) ) ; if ( name . length ( ) > 32 ) throw new InvalidRequestException ( String . format ( "Keyspace names shouldn't be more than 32 character long (got \"%s\")" , name ) ) ; if ( ! attrs . containsKey ( "strategy_class" ) ) throw new InvalidRequestException ( "missing required argument \"strategy_class\"" ) ; strategyClass = attrs . get ( "strategy_class" ) ; for ( String key : attrs . keySet ( ) ) if ( ( key . contains ( ":" ) ) && ( key . startsWith ( "strategy_options" ) ) ) strategyOptions . put ( key . split ( ":" ) [ 1 ] , attrs . get ( key ) ) ; try { AbstractReplicationStrategy . createReplicationStrategy ( name , AbstractReplicationStrategy . getClass ( strategyClass ) , StorageService . instance . getTokenMetadata ( ) , DatabaseDescriptor . getEndpointSnitch ( ) , strategyOptions ) ; } catch ( ConfigurationException e ) { throw new InvalidRequestException ( e . getMessage ( ) ) ; } }
The <code>CqlParser</code> only goes as far as extracting the keyword arguments
 from these statements, so this method is responsible for processing and
 validating, and must be called prior to access.
The <code > CqlParser< / code > only goes as far as extracting the keyword arguments from these statements so this method is responsible for processing and validating and must be called prior to access .
// keyspace name // required // optional // trial run to let ARS validate class + per-class options