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) |
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() |
getKeyName, getKeyspace, getTimestamp, getTimeToLive, isSetTimestamppublic 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 AbstractModificationpublic boolean isSetConsistencyLevel()
isSetConsistencyLevel in class AbstractModificationpublic java.util.List<IMutation> prepareRowMutations(java.lang.String keyspace, ThriftClientState clientState, java.util.List<java.nio.ByteBuffer> variables) throws InvalidRequestException, UnauthorizedException
prepareRowMutations in class AbstractModificationkeyspace - The working keyspaceclientState - current client statusInvalidRequestException - on the wrong requestUnauthorizedExceptionpublic 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 AbstractModificationkeyspace - The working keyspaceclientState - current client statustimestamp - global timestamp to use for all mutationsInvalidRequestException - on the wrong requestUnauthorizedExceptionpublic java.lang.String getColumnFamily()
getColumnFamily in class AbstractModificationpublic java.util.List<Term> getKeys()
public java.util.Map<Term,Operation> getColumns() throws InvalidRequestException
InvalidRequestExceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic AbstractType<?> getKeyType(java.lang.String keyspace)
public AbstractType<?> getComparator(java.lang.String keyspace)
public java.util.List<Term> getColumnNames()
public java.util.List<Term> getColumnValues()
Copyright © 2015 The Apache Software Foundation