org.apache.cassandra.cql3.statements
Class SchemaAlteringStatement

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
All Implemented Interfaces:
CQLStatement
Direct Known Subclasses:
AlterKeyspaceStatement, AlterTableStatement, CreateColumnFamilyStatement, CreateIndexStatement, CreateKeyspaceStatement, DropColumnFamilyStatement, DropIndexStatement, DropKeyspaceStatement

public abstract class SchemaAlteringStatement
extends CFStatement
implements CQLStatement

Abstract class for statements that alter the schema.


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
protected SchemaAlteringStatement()
           
protected SchemaAlteringStatement(CFName name)
           
 
Method Summary
abstract  void announceMigration()
           
abstract  ResultMessage.SchemaChange.Change changeType()
           
 ResultMessage execute(ConsistencyLevel cl, QueryState state, java.util.List<java.nio.ByteBuffer> variables)
          Execute the statement and return the resulting result or null if there is no result.
 ResultMessage executeInternal(QueryState state)
          Variante of execute used for internal query against the system tables, and thus only query the local node.
 ParsedStatement.Prepared prepare()
           
 void prepareKeyspace(ClientState state)
           
 void validate(ClientState state)
          Perform additional validation required by the statment.
 
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
checkAccess, getBoundsTerms
 

Constructor Detail

SchemaAlteringStatement

protected SchemaAlteringStatement()

SchemaAlteringStatement

protected SchemaAlteringStatement(CFName name)
Method Detail

prepareKeyspace

public void prepareKeyspace(ClientState state)
                     throws InvalidRequestException
Overrides:
prepareKeyspace in class CFStatement
Throws:
InvalidRequestException

prepare

public ParsedStatement.Prepared prepare()
Specified by:
prepare in class ParsedStatement

changeType

public abstract ResultMessage.SchemaChange.Change changeType()

announceMigration

public abstract void announceMigration()
                                throws RequestValidationException
Throws:
RequestValidationException

validate

public void validate(ClientState state)
              throws RequestValidationException
Description copied from interface: CQLStatement
Perform additional validation required by the statment. To be overriden by subclasses if needed.

Specified by:
validate in interface CQLStatement
Parameters:
state - the current client state
Throws:
RequestValidationException

execute

public ResultMessage execute(ConsistencyLevel cl,
                             QueryState state,
                             java.util.List<java.nio.ByteBuffer> variables)
                      throws RequestValidationException
Description copied from interface: CQLStatement
Execute the statement and return the resulting result or null if there is no result.

Specified by:
execute in interface CQLStatement
state - the current query state
variables - the values for bounded variables. The implementation can assume that each bound term have a corresponding value.
Throws:
RequestValidationException

executeInternal

public ResultMessage executeInternal(QueryState state)
Description copied from interface: CQLStatement
Variante of execute used for internal query against the system tables, and thus only query the local node.

Specified by:
executeInternal in interface CQLStatement
Parameters:
state - the current query state


Copyright © 2012 The Apache Software Foundation