CQL3CasRequest (apache-cassandra API)
Date: 2018-02-14

org.apache.cassandra.cql3.statements

## Class CQL3CasRequest

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

- All Implemented Interfaces:
    CASRequest

      public class CQL3CasRequest
      extends java.lang.Object
      implements CASRequest

  Processed CAS conditions and update on potentially multiple rows of the same partition.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `CFMetaData` | `cfm`
    `boolean` | `isBatch`
    `DecoratedKey` | `key`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CQL3CasRequest(CFMetaData cfm, DecoratedKey key, boolean isBatch, PartitionColumns conditionColumns, boolean updatesRegularRows, boolean updatesStaticRow)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addConditions(Clustering clustering, java.util.Collection<ColumnCondition> conds, QueryOptions options)`
    `void` | `addExist(Clustering clustering)`
    `void` | `addNotExist(Clustering clustering)`
    `void` | `addRangeDeletion(Slice slice, ModificationStatement stmt, QueryOptions options, long timestamp)`
    `void` | `addRowUpdate(Clustering clustering, ModificationStatement stmt, QueryOptions options, long timestamp)`
    `boolean` | `appliesTo(FilteredPartition current)` Checks whether the conditions represented by this object applies provided the current state of the partition on which those conditions are.
    `PartitionUpdate` | `makeUpdates(FilteredPartition current)` The updates to perform of a CAS success.
    `SinglePartitionReadCommand` | `readCommand(int nowInSec)` The command to use to fetch the value to compare for the CAS.

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

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

- - ### Field Detail

    - #### cfm

          public final CFMetaData cfm

    - #### key

          public final DecoratedKey key

    - #### isBatch

          public final boolean isBatch

  - ### Constructor Detail

    - #### CQL3CasRequest

          public CQL3CasRequest(CFMetaData cfm,
                                DecoratedKey key,
                                boolean isBatch,
                                PartitionColumns conditionColumns,
                                boolean updatesRegularRows,
                                boolean updatesStaticRow)

  - ### Method Detail

    - #### addRowUpdate

          public void addRowUpdate(Clustering clustering,
                                   ModificationStatement stmt,
                                   QueryOptions options,
                                   long timestamp)

    - #### addRangeDeletion

          public void addRangeDeletion(Slice slice,
                                       ModificationStatement stmt,
                                       QueryOptions options,
                                       long timestamp)

    - #### addNotExist

          public void addNotExist(Clustering clustering)
                           throws InvalidRequestException

      Throws:
        `InvalidRequestException`

    - #### addExist

          public void addExist(Clustering clustering)
                        throws InvalidRequestException

      Throws:
        `InvalidRequestException`

    - #### addConditions

          public void addConditions(Clustering clustering,
                                    java.util.Collection<ColumnCondition> conds,
                                    QueryOptions options)
                             throws InvalidRequestException

      Throws:
        `InvalidRequestException`

    - #### readCommand

          public SinglePartitionReadCommand readCommand(int nowInSec)

      Description copied from interface: `CASRequest`
      The command to use to fetch the value to compare for the CAS.
      Specified by:
        `readCommand` in interface `CASRequest`

    - #### appliesTo

          public boolean appliesTo(FilteredPartition current)
                            throws InvalidRequestException

      Checks whether the conditions represented by this object applies provided the current state of the partition on which those conditions are.
      Specified by:
        `appliesTo` in interface `CASRequest`
      Parameters:
        `current` - the partition with current data corresponding to these conditions. More precisely, this must be the result of executing the command returned by `readCommand(int)`. This can be empty but it should not be `null`.
      Returns:
        whether the conditions represented by this object applies or not.
      Throws:
        `InvalidRequestException`

    - #### makeUpdates

          public PartitionUpdate makeUpdates(FilteredPartition current)
                                      throws InvalidRequestException

      Description copied from interface: `CASRequest`
      The updates to perform of a CAS success. The values fetched using the readFilter() are passed as argument.
      Specified by:
        `makeUpdates` in interface `CASRequest`
      Throws:
        `InvalidRequestException`

Copyright © 2018 The Apache Software Foundation