public class UpdateStatement extends AbstractModification
UPDATE
statement parsed from a CQL query statement.cLevel, columnFamily, defaultConsistency, keyName, keyspace, timestamp, timeToLive
Constructor and Description |
---|
UpdateStatement(java.lang.String keyspace,
java.lang.String columnFamily,
java.lang.String keyName,
java.util.List<Term> columnNames,
java.util.List<Term> columnValues,
java.util.List<Term> keys,
Attributes attrs)
Creates a new UpdateStatement from a column family name, a consistency level,
key, and lists of column names and values.
|
UpdateStatement(java.lang.String keyspace,
java.lang.String columnFamily,
java.lang.String keyName,
java.util.Map<Term,Operation> columns,
java.util.List<Term> keys,
Attributes attrs)
Creates a new UpdateStatement from a column family name, columns map, consistency
level, and key term.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getColumnFamily() |
java.util.List<Term> |
getColumnNames() |
java.util.Map<Term,Operation> |
getColumns() |
java.util.List<Term> |
getColumnValues() |
AbstractType<?> |
getComparator(java.lang.String keyspace) |
ConsistencyLevel |
getConsistencyLevel()
Returns the consistency level of this
UPDATE statement, either
one parsed from the CQL statement, or the default level otherwise. |
java.util.List<Term> |
getKeys() |
AbstractType<?> |
getKeyType(java.lang.String keyspace) |
AbstractType<?> |
getValueValidator(java.lang.String keyspace,
java.nio.ByteBuffer column) |
boolean |
isSetConsistencyLevel()
True if an explicit consistency level was parsed from the statement.
|
java.util.List<IMutation> |
prepareRowMutations(java.lang.String keyspace,
ThriftClientState clientState,
java.util.List<java.nio.ByteBuffer> variables)
Convert statement into a list of mutations to apply on the server
|
java.util.List<IMutation> |
prepareRowMutations(java.lang.String keyspace,
ThriftClientState clientState,
java.lang.Long timestamp,
java.util.List<java.nio.ByteBuffer> variables)
Convert statement into a list of mutations to apply on the server
|
java.lang.String |
toString() |
getKeyspace, getTimestamp, getTimeToLive, isSetTimestamp
public UpdateStatement(java.lang.String keyspace, java.lang.String columnFamily, java.lang.String keyName, java.util.Map<Term,Operation> columns, java.util.List<Term> keys, Attributes attrs)
keyspace
- Keyspace (optional)columnFamily
- column family namekeyName
- alias key namecolumns
- a map of column name/values pairskeys
- the keys to updateattrs
- additional attributes for statement (CL, timestamp, timeToLive)public UpdateStatement(java.lang.String keyspace, java.lang.String columnFamily, java.lang.String keyName, java.util.List<Term> columnNames, java.util.List<Term> columnValues, java.util.List<Term> keys, Attributes attrs)
INSERT
.keyspace
- Keyspace (optional)columnFamily
- column family namekeyName
- alias key namecolumnNames
- list of column namescolumnValues
- list of column values (corresponds to names)keys
- the keys to updateattrs
- additional attributes for statement (CL, timestamp, timeToLive)public ConsistencyLevel getConsistencyLevel()
UPDATE
statement, either
one parsed from the CQL statement, or the default level otherwise.getConsistencyLevel
in class AbstractModification
public boolean isSetConsistencyLevel()
isSetConsistencyLevel
in class AbstractModification
public java.util.List<IMutation> prepareRowMutations(java.lang.String keyspace, ThriftClientState clientState, java.util.List<java.nio.ByteBuffer> variables) throws InvalidRequestException, UnauthorizedException
prepareRowMutations
in class AbstractModification
keyspace
- The working keyspaceclientState
- current client statusInvalidRequestException
- on the wrong requestUnauthorizedException
public java.util.List<IMutation> prepareRowMutations(java.lang.String keyspace, ThriftClientState clientState, java.lang.Long timestamp, java.util.List<java.nio.ByteBuffer> variables) throws InvalidRequestException, UnauthorizedException
prepareRowMutations
in class AbstractModification
keyspace
- The working keyspaceclientState
- current client statustimestamp
- global timestamp to use for all mutationsInvalidRequestException
- on the wrong requestUnauthorizedException
public java.lang.String getColumnFamily()
getColumnFamily
in class AbstractModification
public java.util.List<Term> getKeys()
public java.util.Map<Term,Operation> getColumns() throws InvalidRequestException
InvalidRequestException
public java.lang.String toString()
toString
in class java.lang.Object
public AbstractType<?> getKeyType(java.lang.String keyspace)
public AbstractType<?> getComparator(java.lang.String keyspace)
public AbstractType<?> getValueValidator(java.lang.String keyspace, java.nio.ByteBuffer column)
public java.util.List<Term> getColumnNames()
public java.util.List<Term> getColumnValues()
Copyright © 2013 The Apache Software Foundation