ModificationStatement (apache-cassandra API)
Date: 2014-10-21

org.apache.cassandra.cql3.statements

## Class ModificationStatement

- java.lang.Object
- - org.apache.cassandra.cql3.statements.ModificationStatement

- All Implemented Interfaces:
    CQLStatement, MeasurableForPreparedCache
  Direct Known Subclasses:
    DeleteStatement, UpdateStatement

      public abstract class ModificationStatement
      extends java.lang.Object
      implements CQLStatement, MeasurableForPreparedCache

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `ModificationStatement.Parsed`
    `static class` | `ModificationStatement.StatementType`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `Attributes` | `attrs`
    `CFMetaData` | `cfm`
    `protected java.util.Map<ColumnIdentifier,Restriction>` | `processedKeys`
    `ModificationStatement.StatementType` | `type`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ModificationStatement(ModificationStatement.StatementType type, int boundTerms, CFMetaData cfm, Attributes attrs)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addCondition(ColumnCondition cond)`
    `void` | `addConditions(Composite clusteringPrefix, CQL3CasRequest request, QueryOptions options)`
    `void` | `addKeyValue(ColumnDefinition def, Term value)`
    `void` | `addOperation(Operation op)`
    `abstract void` | `addUpdateForKey(ColumnFamily updates, java.nio.ByteBuffer key, Composite prefix, UpdateParameters params)`
    `static ResultSet` | `buildCasResultSet(java.lang.String ksName, java.nio.ByteBuffer key, java.lang.String cfName, ColumnFamily cf, java.lang.Iterable<ColumnDefinition> columnsWithConditions, boolean isBatch, QueryOptions options)`
    `java.util.List<java.nio.ByteBuffer>` | `buildPartitionKeyNames(QueryOptions options)`
    `void` | `checkAccess(ClientState state)` Perform any access verification necessary for the statement.
    `java.lang.String` | `columnFamily()`
    `Composite` | `createClusteringPrefix(QueryOptions options)`
    `ResultMessage` | `execute(QueryState queryState, QueryOptions options)` Execute the statement and return the resulting result or null if there is no result.
    `ResultMessage` | `executeInternal(QueryState queryState, QueryOptions options)` Variante of execute used for internal query against the system tables, and thus only query the local node.
    `ResultMessage` | `executeWithCondition(QueryState queryState, QueryOptions options)`
    `int` | `getBoundTerms()` Returns the number of bound terms in this statement.
    `java.lang.Iterable<ColumnDefinition>` | `getColumnsWithConditions()`
    `protected ColumnDefinition` | `getFirstEmptyKey()`
    `java.util.List<Operation>` | `getOperations()`
    `long` | `getTimestamp(long now, QueryOptions options)`
    `int` | `getTimeToLive(QueryOptions options)`
    `boolean` | `hasConditions()`
    `boolean` | `hasIfExistCondition()`
    `boolean` | `hasIfNotExistCondition()`
    `boolean` | `isCounter()`
    `boolean` | `isTimestampSet()`
    `java.lang.String` | `keyspace()`
    `UpdateParameters` | `makeUpdateParameters(java.util.Collection<java.nio.ByteBuffer> keys, Composite prefix, QueryOptions options, boolean local, long now)`
    `long` | `measureForPreparedCache(org.github.jamm.MemoryMeter meter)`
    `void` | `processWhereClause(java.util.List<Relation> whereClause, VariableSpecifications names)`
    `protected java.util.Map<java.nio.ByteBuffer,CQL3Row>` | `readRequiredRows(java.util.Collection<java.nio.ByteBuffer> partitionKeys, Composite clusteringPrefix, boolean local, ConsistencyLevel cl)`
    `abstract boolean` | `requireFullClusteringKey()`
    `boolean` | `requiresRead()`
    `void` | `setIfExistCondition()`
    `void` | `setIfNotExistCondition()`
    `void` | `validate(ClientState state)` Perform additional validation required by the statment.
    `protected void` | `validateWhereClauseForConditions()` If there are conditions on the statement, this is called after the where clause and conditions have been processed to check that they are compatible.

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

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

- - ### Field Detail

    - #### type

          public final ModificationStatement.StatementType type

    - #### cfm

          public final CFMetaData cfm

    - #### attrs

          public final Attributes attrs

    - #### processedKeys

          protected final java.util.Map<ColumnIdentifier,Restriction> processedKeys

  - ### Constructor Detail

    - #### ModificationStatement

          public ModificationStatement(ModificationStatement.StatementType type,
                               int boundTerms,
                               CFMetaData cfm,
                               Attributes attrs)

  - ### Method Detail

    - #### measureForPreparedCache

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

      Specified by:
        `measureForPreparedCache` in interface `MeasurableForPreparedCache`

    - #### requireFullClusteringKey

          public abstract boolean requireFullClusteringKey()

    - #### addUpdateForKey

          public abstract void addUpdateForKey(ColumnFamily updates,
                             java.nio.ByteBuffer key,
                             Composite prefix,
                             UpdateParameters params)
                                        throws InvalidRequestException

      Throws:
        `InvalidRequestException`

    - #### getBoundTerms

          public int getBoundTerms()

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

    - #### keyspace

          public java.lang.String keyspace()

    - #### columnFamily

          public java.lang.String columnFamily()

    - #### isCounter

          public boolean isCounter()

    - #### getTimestamp

          public long getTimestamp(long now,
                          QueryOptions options)
                            throws InvalidRequestException

      Throws:
        `InvalidRequestException`

    - #### isTimestampSet

          public boolean isTimestampSet()

    - #### getTimeToLive

          public int getTimeToLive(QueryOptions options)
                            throws InvalidRequestException

      Throws:
        `InvalidRequestException`

    - #### checkAccess

          public void checkAccess(ClientState state)
                           throws InvalidRequestException,
                                  UnauthorizedException

      Description copied from interface: `CQLStatement`
      Perform any access verification necessary for the statement.
      Specified by:
        `checkAccess` in interface `CQLStatement`
      Parameters:
        `state` - the current client state
      Throws:
        `InvalidRequestException`
        `UnauthorizedException`

    - #### validate

          public void validate(ClientState state)
                        throws InvalidRequestException

      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:
        `InvalidRequestException`

    - #### addOperation

          public void addOperation(Operation op)

    - #### getOperations

          public java.util.List<Operation> getOperations()

    - #### getColumnsWithConditions

          public java.lang.Iterable<ColumnDefinition> getColumnsWithConditions()

    - #### addCondition

          public void addCondition(ColumnCondition cond)
                            throws InvalidRequestException

      Throws:
        `InvalidRequestException`

    - #### setIfNotExistCondition

          public void setIfNotExistCondition()

    - #### hasIfNotExistCondition

          public boolean hasIfNotExistCondition()

    - #### setIfExistCondition

          public void setIfExistCondition()

    - #### hasIfExistCondition

          public boolean hasIfExistCondition()

    - #### addKeyValue

          public void addKeyValue(ColumnDefinition def,
                         Term value)
                           throws InvalidRequestException

      Throws:
        `InvalidRequestException`

    - #### processWhereClause

          public void processWhereClause(java.util.List<Relation> whereClause,
                                VariableSpecifications names)
                                  throws InvalidRequestException

      Throws:
        `InvalidRequestException`

    - #### buildPartitionKeyNames

          public java.util.List<java.nio.ByteBuffer> buildPartitionKeyNames(QueryOptions options)
                                                                     throws InvalidRequestException

      Throws:
        `InvalidRequestException`

    - #### createClusteringPrefix

          public Composite createClusteringPrefix(QueryOptions options)
                                           throws InvalidRequestException

      Throws:
        `InvalidRequestException`

    - #### getFirstEmptyKey

          protected ColumnDefinition getFirstEmptyKey()

    - #### requiresRead

          public boolean requiresRead()

    - #### readRequiredRows

          protected java.util.Map<java.nio.ByteBuffer,CQL3Row> readRequiredRows(java.util.Collection<java.nio.ByteBuffer> partitionKeys,
                                                                    Composite clusteringPrefix,
                                                                    boolean local,
                                                                    ConsistencyLevel cl)
                                                                         throws RequestExecutionException,
                                                                                RequestValidationException

      Throws:
        `RequestExecutionException`
        `RequestValidationException`

    - #### hasConditions

          public boolean hasConditions()

    - #### execute

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

    - #### executeWithCondition

          public ResultMessage executeWithCondition(QueryState queryState,
                                           QueryOptions options)
                                             throws RequestExecutionException,
                                                    RequestValidationException

      Throws:
        `RequestExecutionException`
        `RequestValidationException`

    - #### addConditions

          public void addConditions(Composite clusteringPrefix,
                           CQL3CasRequest request,
                           QueryOptions options)
                             throws InvalidRequestException

      Throws:
        `InvalidRequestException`

    - #### buildCasResultSet

          public static ResultSet buildCasResultSet(java.lang.String ksName,
                                    java.nio.ByteBuffer key,
                                    java.lang.String cfName,
                                    ColumnFamily cf,
                                    java.lang.Iterable<ColumnDefinition> columnsWithConditions,
                                    boolean isBatch,
                                    QueryOptions options)
                                             throws InvalidRequestException

      Throws:
        `InvalidRequestException`

    - #### executeInternal

          public ResultMessage executeInternal(QueryState queryState,
                                      QueryOptions options)
                                        throws RequestValidationException,
                                               RequestExecutionException

      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:
        `queryState` - the current query state
      Throws:
        `RequestValidationException`
        `RequestExecutionException`

    - #### makeUpdateParameters

          public UpdateParameters makeUpdateParameters(java.util.Collection<java.nio.ByteBuffer> keys,
                                              Composite prefix,
                                              QueryOptions options,
                                              boolean local,
                                              long now)
                                                throws RequestExecutionException,
                                                       RequestValidationException

      Throws:
        `RequestExecutionException`
        `RequestValidationException`

    - #### validateWhereClauseForConditions

          protected void validateWhereClauseForConditions()
                                                   throws InvalidRequestException

      If there are conditions on the statement, this is called after the where clause and conditions have been processed to check that they are compatible.
      Throws:
        `InvalidRequestException`

Copyright © 2014 The Apache Software Foundation