org.apache.cassandra.cql3.statements
Class ModificationStatement

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.ModificationStatement
All Implemented Interfaces:
CQLStatement
Direct Known Subclasses:
BatchStatement, DeleteStatement, UpdateStatement

public abstract class ModificationStatement
extends CFStatement
implements CQLStatement

Abstract class for statements that apply on a given column family.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.cassandra.cql3.statements.ParsedStatement
ParsedStatement.Prepared
 
Field Summary
protected  org.apache.cassandra.thrift.ConsistencyLevel cLevel
           
static org.apache.cassandra.thrift.ConsistencyLevel defaultConsistency
           
protected  java.lang.Long timestamp
           
protected  int timeToLive
           
 
Fields inherited from class org.apache.cassandra.cql3.statements.CFStatement
cfName
 
Constructor Summary
ModificationStatement(CFName name, Attributes attrs)
           
ModificationStatement(CFName name, org.apache.cassandra.thrift.ConsistencyLevel cLevel, java.lang.Long timestamp, int timeToLive)
           
 
Method Summary
 void checkAccess(ClientState state)
          Perform any access verification necessary for the statement.
 org.apache.cassandra.thrift.CqlResult execute(ClientState state, java.util.List<java.nio.ByteBuffer> variables)
          Execute the statement and return the resulting result or null if there is no result.
 org.apache.cassandra.thrift.ConsistencyLevel getConsistencyLevel()
           
abstract  java.util.List<IMutation> getMutations(ClientState clientState, java.util.List<java.nio.ByteBuffer> variables)
          Convert statement into a list of mutations to apply on the server
 long getTimestamp(ClientState clientState)
           
 int getTimeToLive()
           
 boolean isSetConsistencyLevel()
          True if an explicit consistency level was parsed from the statement.
 boolean isSetTimestamp()
           
abstract  ParsedStatement.Prepared prepare(CFDefinition.Name[] boundNames)
           
 void validate(ClientState state)
          Perform additional validation required by the statment.
 
Methods inherited from class org.apache.cassandra.cql3.statements.CFStatement
columnFamily, keyspace, prepareKeyspace
 
Methods inherited from class org.apache.cassandra.cql3.statements.ParsedStatement
getBoundsTerms, prepare, 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
getBoundsTerms
 

Field Detail

defaultConsistency

public static final org.apache.cassandra.thrift.ConsistencyLevel defaultConsistency

cLevel

protected final org.apache.cassandra.thrift.ConsistencyLevel cLevel

timestamp

protected java.lang.Long timestamp

timeToLive

protected final int timeToLive
Constructor Detail

ModificationStatement

public ModificationStatement(CFName name,
                             Attributes attrs)

ModificationStatement

public ModificationStatement(CFName name,
                             org.apache.cassandra.thrift.ConsistencyLevel cLevel,
                             java.lang.Long timestamp,
                             int timeToLive)
Method Detail

checkAccess

public void checkAccess(ClientState state)
                 throws org.apache.cassandra.thrift.InvalidRequestException
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:
org.apache.cassandra.thrift.InvalidRequestException

validate

public void validate(ClientState state)
              throws org.apache.cassandra.thrift.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:
org.apache.cassandra.thrift.InvalidRequestException

execute

public org.apache.cassandra.thrift.CqlResult execute(ClientState state,
                                                     java.util.List<java.nio.ByteBuffer> variables)
                                              throws org.apache.cassandra.thrift.InvalidRequestException,
                                                     org.apache.cassandra.thrift.UnavailableException,
                                                     org.apache.cassandra.thrift.TimedOutException
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 client state
variables - the values for bounded variables. The implementation can assume that each bound term have a corresponding value.
Throws:
org.apache.cassandra.thrift.InvalidRequestException
org.apache.cassandra.thrift.UnavailableException
org.apache.cassandra.thrift.TimedOutException

getConsistencyLevel

public org.apache.cassandra.thrift.ConsistencyLevel getConsistencyLevel()

isSetConsistencyLevel

public boolean isSetConsistencyLevel()
True if an explicit consistency level was parsed from the statement.

Returns:
true if a consistency was parsed, false otherwise.

getTimestamp

public long getTimestamp(ClientState clientState)

isSetTimestamp

public boolean isSetTimestamp()

getTimeToLive

public int getTimeToLive()

getMutations

public abstract java.util.List<IMutation> getMutations(ClientState clientState,
                                                       java.util.List<java.nio.ByteBuffer> variables)
                                                throws org.apache.cassandra.thrift.InvalidRequestException
Convert statement into a list of mutations to apply on the server

Parameters:
clientState - current client status
variables - value for prepared statement markers
Returns:
list of the mutations
Throws:
org.apache.cassandra.thrift.InvalidRequestException - on invalid requests

prepare

public abstract ParsedStatement.Prepared prepare(CFDefinition.Name[] boundNames)
                                          throws org.apache.cassandra.thrift.InvalidRequestException
Throws:
org.apache.cassandra.thrift.InvalidRequestException


Copyright © 2012 The Apache Software Foundation