|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.datastax.driver.core.QueryOptions
public class QueryOptions
Options related to defaults for individual queries.
Field Summary | |
---|---|
static ConsistencyLevel |
DEFAULT_CONSISTENCY_LEVEL
The default consistency level for queries: ConsistencyLevel.ONE . |
static int |
DEFAULT_FETCH_SIZE
The default fetch size for SELECT queries: 5000. |
static ConsistencyLevel |
DEFAULT_SERIAL_CONSISTENCY_LEVEL
The default serial consistency level for conditional updates: ConsistencyLevel.SERIAL . |
Constructor Summary | |
---|---|
QueryOptions()
Creates a new QueryOptions instance using the DEFAULT_CONSISTENCY_LEVEL ,
DEFAULT_SERIAL_CONSISTENCY_LEVEL and DEFAULT_FETCH_SIZE . |
Method Summary | |
---|---|
ConsistencyLevel |
getConsistencyLevel()
The default consistency level used by queries. |
int |
getFetchSize()
The default fetch size used by queries. |
ConsistencyLevel |
getSerialConsistencyLevel()
The default serial consistency level used by queries. |
QueryOptions |
setConsistencyLevel(ConsistencyLevel consistencyLevel)
Sets the default consistency level to use for queries. |
QueryOptions |
setFetchSize(int fetchSize)
Sets the default fetch size to use for SELECT queries. |
QueryOptions |
setSerialConsistencyLevel(ConsistencyLevel serialConsistencyLevel)
Sets the default serial consistency level to use for queries. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final ConsistencyLevel DEFAULT_CONSISTENCY_LEVEL
ConsistencyLevel.ONE
.
public static final ConsistencyLevel DEFAULT_SERIAL_CONSISTENCY_LEVEL
ConsistencyLevel.SERIAL
.
public static final int DEFAULT_FETCH_SIZE
Constructor Detail |
---|
public QueryOptions()
QueryOptions
instance using the DEFAULT_CONSISTENCY_LEVEL
,
DEFAULT_SERIAL_CONSISTENCY_LEVEL
and DEFAULT_FETCH_SIZE
.
Method Detail |
---|
public QueryOptions setConsistencyLevel(ConsistencyLevel consistencyLevel)
The consistency level set through this method will be use for queries
that don't explicitely have a consistency level, i.e. when Statement.getConsistencyLevel()
returns null
.
consistencyLevel
- the new consistency level to set as default.
QueryOptions
instance.public ConsistencyLevel getConsistencyLevel()
public QueryOptions setSerialConsistencyLevel(ConsistencyLevel serialConsistencyLevel)
The serial consistency level set through this method will be use for queries
that don't explicitely have a serial consistency level, i.e. when Statement.getSerialConsistencyLevel()
returns null
.
serialConsistencyLevel
- the new serial consistency level to set as default.
QueryOptions
instance.public ConsistencyLevel getSerialConsistencyLevel()
public QueryOptions setFetchSize(int fetchSize)
The fetch size set through this method will be use for queries
that don't explicitely have a fetch size, i.e. when Statement.getFetchSize()
is less or equal to 0.
fetchSize
- the new fetch size to set as default. It must be
strictly positive but you can use Integer.MAX_VALUE
to disable
paging.
QueryOptions
instance.
IllegalArgumentException
- if fetchSize <e; 0
.public int getFetchSize()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |