org.apache.cassandra.cql3.statements

## Class UpdateStatement

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

- All Implemented Interfaces:
    CQLStatement, MeasurableForPreparedCache

      public class UpdateStatement
      extends ModificationStatement

  An `UPDATE` statement parsed from a CQL query statement.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.cassandra.cql3.statements.ModificationStatement

      `ModificationStatement.Type`

    - ### 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.ModificationStatement

      `type`

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

      `cfName`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `UpdateStatement(CFName name, Attributes attrs, java.util.List<ColumnIdentifier> columnNames, java.util.List<Term.Raw> columnValues)` Creates a new UpdateStatement from a column family name, a consistency level, key, and lists of column names and values.
    `UpdateStatement(CFName name, java.util.List<Pair<ColumnIdentifier,Operation.RawUpdate>> operations, java.util.List<Relation> whereClause, Attributes attrs)` Creates a new UpdateStatement from a column family name, columns map, consistency level, and key term.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.util.Collection<IMutation>` | `getMutations(java.util.List<java.nio.ByteBuffer> variables, boolean local, ConsistencyLevel cl, long now)` Convert statement into a list of mutations to apply on the server
    `long` | `measureForPreparedCache(org.github.jamm.MemoryMeter meter)`
    `ParsedStatement.Prepared` | `prepare()`
    `ParsedStatement.Prepared` | `prepare(ColumnSpecification[] boundNames)`
    `java.lang.String` | `toString()`
    `protected void` | `validateConsistency(ConsistencyLevel cl)`

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

      `checkAccess, execute, executeInternal, getTimestamp, getTimeToLive, isSetTimestamp, readRows, setTimestamp, validate`

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

      `columnFamily, keyspace, prepareKeyspace`

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

      `getBoundTerms, setBoundTerms`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.apache.cassandra.cql3.CQLStatement

      `getBoundTerms`

- - ### Constructor Detail

    - #### UpdateStatement

          public UpdateStatement(CFName name,
                         java.util.List<Pair<ColumnIdentifier,Operation.RawUpdate>> operations,
                         java.util.List<Relation> whereClause,
                         Attributes attrs)

      Creates a new UpdateStatement from a column family name, columns map, consistency level, and key term.
      Parameters:
        `name` - column family being operated on
        `operations` - a map of column operations to perform
        `whereClause` - the where clause
        `attrs` - additional attributes for statement (CL, timestamp, timeToLive)

    - #### UpdateStatement

          public UpdateStatement(CFName name,
                         Attributes attrs,
                         java.util.List<ColumnIdentifier> columnNames,
                         java.util.List<Term.Raw> columnValues)

      Creates a new UpdateStatement from a column family name, a consistency level, key, and lists of column names and values. It is intended for use with the alternate update format, `INSERT`.
      Parameters:
        `name` - column family being operated on
        `columnNames` - list of column names
        `columnValues` - list of column values (corresponds to names)
        `attrs` - additional attributes for statement (CL, timestamp, timeToLive)

  - ### Method Detail

    - #### measureForPreparedCache

          public long measureForPreparedCache(org.github.jamm.MemoryMeter meter)

    - #### validateConsistency

          protected void validateConsistency(ConsistencyLevel cl)
                                      throws InvalidRequestException

      Specified by:
        `validateConsistency` in class `ModificationStatement`
      Throws:
        `InvalidRequestException`

    - #### getMutations

          public java.util.Collection<IMutation> getMutations(java.util.List<java.nio.ByteBuffer> variables,
                                                     boolean local,
                                                     ConsistencyLevel cl,
                                                     long now)
                                                       throws RequestExecutionException,
                                                              RequestValidationException

      Convert statement into a list of mutations to apply on the server
      Specified by:
        `getMutations` in class `ModificationStatement`
      Parameters:
        `variables` - value for prepared statement markers
        `local` - if true, any requests (for collections) performed by getMutation should be done locally only.
        `cl` - the consistency to use for the potential reads involved in generating the mutations (for lists set/delete operations)
        `now` - the current timestamp in microseconds to use if no timestamp is user provided.
      Returns:
        list of the mutations
      Throws:
        `InvalidRequestException` - on invalid requests
        `RequestExecutionException`
        `RequestValidationException`

    - #### prepare

          public ParsedStatement.Prepared prepare(ColumnSpecification[] boundNames)
                                           throws InvalidRequestException

      Specified by:
        `prepare` in class `ModificationStatement`
      Throws:
        `InvalidRequestException`

    - #### prepare

          public ParsedStatement.Prepared prepare()
                                           throws InvalidRequestException

      Specified by:
        `prepare` in class `ParsedStatement`
      Throws:
        `InvalidRequestException`

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

Copyright © 2014 The Apache Software Foundation