org.apache.cassandra.cql3.statements

## Class SchemaAlteringStatement

- java.lang.Object
- - org.apache.cassandra.cql3.statements.ParsedStatement
  - - org.apache.cassandra.cql3.statements.CFStatement
    - - org.apache.cassandra.cql3.statements.SchemaAlteringStatement

- All Implemented Interfaces:
    CQLStatement
  Direct Known Subclasses:
    AlterKeyspaceStatement, AlterTableStatement, AlterTypeStatement, CreateIndexStatement, CreateKeyspaceStatement, CreateTableStatement, CreateTriggerStatement, CreateTypeStatement, DropIndexStatement, DropKeyspaceStatement, DropTableStatement, DropTriggerStatement, DropTypeStatement

      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

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `SchemaAlteringStatement()`
    `protected` | `SchemaAlteringStatement(CFName name)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract boolean` | `announceMigration(boolean isLocalOnly)` Announces the migration to other nodes in the cluster.
    `abstract Event.SchemaChange` | `changeEvent()`
    `ResultMessage` | `execute(QueryState state, QueryOptions options)` Execute the statement and return the resulting result or null if there is no result.
    `ResultMessage` | `executeInternal(QueryState state, QueryOptions options)` Variante of execute used for internal query against the system tables, and thus only query the local node.
    `int` | `getBoundTerms()` Returns the number of bound terms in this statement.
    `ParsedStatement.Prepared` | `prepare()`
    `void` | `prepareKeyspace(ClientState state)`

    - ### Methods inherited from class org.apache.cassandra.cql3.statements.CFStatement

      `columnFamily, keyspace, prepareKeyspace`

    - ### Methods inherited from class org.apache.cassandra.cql3.statements.ParsedStatement

      `getBoundVariables, setBoundVariables`

    - ### 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, validate`

- - ### Constructor Detail

    - #### SchemaAlteringStatement

          protected SchemaAlteringStatement()

    - #### SchemaAlteringStatement

          protected SchemaAlteringStatement(CFName name)

  - ### Method Detail

    - #### getBoundTerms

          public int getBoundTerms()

      Description copied from interface: `CQLStatement`
      Returns the number of bound terms in this statement.
      Specified by:
        `getBoundTerms` in interface `CQLStatement`

    - #### 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`

    - #### changeEvent

          public abstract Event.SchemaChange changeEvent()

    - #### announceMigration

          public abstract boolean announceMigration(boolean isLocalOnly)
                                             throws RequestValidationException

      Announces the migration to other nodes in the cluster.
      Returns:
        true if the execution of this statement resulted in a schema change, false otherwise (when IF NOT EXISTS is used, for example)
      Throws:
        `RequestValidationException`

    - #### execute

          public ResultMessage execute(QueryState state,
                              QueryOptions options)
                                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`
      Parameters:
        `state` - the current query state
        `options` - options for this query (consistency, variables, pageSize, ...)
      Throws:
        `RequestValidationException`

    - #### executeInternal

          public ResultMessage executeInternal(QueryState state,
                                      QueryOptions options)

      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 © 2014 The Apache Software Foundation