com.datastax.driver.core.querybuilder
Class Batch.Options

java.lang.Object
  extended by com.datastax.driver.core.Query
      extended by com.datastax.driver.core.Statement
          extended by com.datastax.driver.core.querybuilder.Batch.Options
Enclosing class:
Batch

public static class Batch.Options
extends Statement

The options of a BATCH statement.


Field Summary
protected  Boolean isCounterOp
           
protected  T statement
           
 
Method Summary
 Batch add(Statement statement)
          Adds a new statement to the BATCH statement these options are part of.
 Batch.Options and(Using using)
          Adds the provided option.
protected  StringBuilder buildQueryString()
           
 Query disableTracing()
          Disables tracing for this query.
 Query enableTracing()
          Enables tracing for this query.
 ConsistencyLevel getConsistencyLevel()
          Returns the consistency level.
 String getQueryString()
          Returns the query string for this statement.
 RetryPolicy getRetryPolicy()
          Returns the retry policy sets for this query, if any.
 ByteBuffer getRoutingKey()
          Returns the routing key (in binary raw form) to use for token aware routing of this query.
protected  boolean isCounterOp()
           
 boolean isTracing()
          Returns whether tracing is enabled for this query or not.
 Query setConsistencyLevel(ConsistencyLevel consistency)
          Sets the consistency level for the query.
protected  void setCounterOp(boolean isCounterOp)
           
protected  void setDirty()
           
 Query setRetryPolicy(RetryPolicy policy)
          Sets the retry policy to use for this query.
 
Methods inherited from class com.datastax.driver.core.Statement
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

statement

protected T extends com.datastax.driver.core.querybuilder.BuiltStatement statement

isCounterOp

protected Boolean isCounterOp
Method Detail

and

public Batch.Options and(Using using)
Adds the provided option.

Parameters:
using - a BATCH option.
Returns:
this Options object.

add

public Batch add(Statement statement)
Adds a new statement to the BATCH statement these options are part of.

Parameters:
statement - the statement to add.
Returns:
the BATCH statement these options are part of.

getQueryString

public String getQueryString()
Description copied from class: Statement
Returns the query string for this statement.

Returns:
a valid CQL query string.

buildQueryString

protected StringBuilder buildQueryString()

getRoutingKey

public ByteBuffer getRoutingKey()
Description copied from class: Query
Returns the routing key (in binary raw form) to use for token aware routing of this query.

The routing key is optional in that implementers are free to return null. The routing key is an hint used for token-aware routing (see TokenAwarePolicy), and if provided should correspond to the binary value for the query partition key. However, not providing a routing key never causes a query to fail and if the load balancing policy used is not token aware, then the routing key can be safely ignored.

Returns:
the routing key for this query or null.

setDirty

protected void setDirty()

isCounterOp

protected boolean isCounterOp()

setConsistencyLevel

public Query setConsistencyLevel(ConsistencyLevel consistency)
Description copied from class: Query
Sets the consistency level for the query.

The default consistency level, if this method is not called, is ConsistencyLevel.ONE.

Overrides:
setConsistencyLevel in class Query
Parameters:
consistency - the consistency level to set.
Returns:
this Query object.

getConsistencyLevel

public ConsistencyLevel getConsistencyLevel()
Description copied from class: Query
Returns the consistency level.

Overrides:
getConsistencyLevel in class Query
Returns:
the consistency level, which is ConsistencyLevel.ONE if no consistency level has been specified.

enableTracing

public Query enableTracing()
Description copied from class: Query
Enables tracing for this query. By default (that is unless you call this method), tracing is not enabled.

Overrides:
enableTracing in class Query
Returns:
this Query object.

disableTracing

public Query disableTracing()
Description copied from class: Query
Disables tracing for this query.

Overrides:
disableTracing in class Query
Returns:
this Query object.

isTracing

public boolean isTracing()
Description copied from class: Query
Returns whether tracing is enabled for this query or not.

Overrides:
isTracing in class Query
Returns:
true if this query has tracing enabled, false otherwise.

setRetryPolicy

public Query setRetryPolicy(RetryPolicy policy)
Description copied from class: Query
Sets the retry policy to use for this query.

The default retry policy, if this method is not called, is the one returned by Policies.getRetryPolicy() in the cluster configuration. This method is thus only useful in case you want to punctually override the default policy for this request.

Overrides:
setRetryPolicy in class Query
Parameters:
policy - the retry policy to use for this query.
Returns:
this Query object.

getRetryPolicy

public RetryPolicy getRetryPolicy()
Description copied from class: Query
Returns the retry policy sets for this query, if any.

Overrides:
getRetryPolicy in class Query
Returns:
the retry policy sets specifically for this query or null if no query specific retry policy has been set through Query.setRetryPolicy(com.datastax.driver.core.policies.RetryPolicy) (in which case the Cluster retry policy will apply if necessary).

setCounterOp

protected void setCounterOp(boolean isCounterOp)


Copyright © 2013. All Rights Reserved.