org.apache.cassandra.cql3.statements
Class CreateKeyspaceStatement

java.lang.Object
  extended by org.apache.cassandra.cql3.statements.ParsedStatement
      extended by org.apache.cassandra.cql3.statements.CFStatement
          extended by org.apache.cassandra.cql3.statements.SchemaAlteringStatement
              extended by org.apache.cassandra.cql3.statements.CreateKeyspaceStatement
All Implemented Interfaces:
CQLStatement

public class CreateKeyspaceStatement
extends SchemaAlteringStatement

A CREATE KEYSPACE statement parsed from a CQL query.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.cassandra.cql3.statements.ParsedStatement
ParsedStatement.Prepared
 
Field Summary
 
Fields inherited from class org.apache.cassandra.cql3.statements.CFStatement
cfName
 
Constructor Summary
CreateKeyspaceStatement(java.lang.String name, java.util.Map<java.lang.String,java.lang.String> attrs)
          Creates a new CreateKeyspaceStatement instance for a given keyspace name and keyword arguments.
 
Method Summary
 void announceMigration()
           
 void validate(ClientState state)
          The CqlParser only goes as far as extracting the keyword arguments from these statements, so this method is responsible for processing and validating.
 
Methods inherited from class org.apache.cassandra.cql3.statements.SchemaAlteringStatement
checkAccess, execute, prepare, prepareKeyspace
 
Methods inherited from class org.apache.cassandra.cql3.statements.CFStatement
columnFamily, keyspace
 
Methods inherited from class org.apache.cassandra.cql3.statements.ParsedStatement
getBoundsTerms, setBoundTerms
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.cassandra.cql3.CQLStatement
getBoundsTerms
 

Constructor Detail

CreateKeyspaceStatement

public CreateKeyspaceStatement(java.lang.String name,
                               java.util.Map<java.lang.String,java.lang.String> attrs)
Creates a new CreateKeyspaceStatement instance for a given keyspace name and keyword arguments.

Parameters:
name - the name of the keyspace to create
attrs - map of the raw keyword arguments that followed the WITH keyword.
Method Detail

validate

public void validate(ClientState state)
              throws org.apache.cassandra.thrift.InvalidRequestException,
                     org.apache.cassandra.thrift.SchemaDisagreementException
The CqlParser only goes as far as extracting the keyword arguments from these statements, so this method is responsible for processing and validating.

Specified by:
validate in interface CQLStatement
Overrides:
validate in class SchemaAlteringStatement
Parameters:
state - the current client state
Throws:
org.apache.cassandra.thrift.InvalidRequestException - if arguments are missing or unacceptable
org.apache.cassandra.thrift.SchemaDisagreementException

announceMigration

public void announceMigration()
                       throws org.apache.cassandra.thrift.InvalidRequestException,
                              ConfigurationException
Specified by:
announceMigration in class SchemaAlteringStatement
Throws:
org.apache.cassandra.thrift.InvalidRequestException
ConfigurationException


Copyright © 2012 The Apache Software Foundation