public static class InsertOptions.InsertOptionsBuilder extends WriteOptions.WriteOptionsBuilder
InsertOptions
.Modifier and Type | Method and Description |
---|---|
InsertOptions |
build()
Builds a new
InsertOptions with the configured values. |
InsertOptions.InsertOptionsBuilder |
consistencyLevel(com.datastax.driver.core.ConsistencyLevel consistencyLevel)
Sets the
ConsistencyLevel to use. |
InsertOptions.InsertOptionsBuilder |
fetchSize(int fetchSize)
Sets the query fetch size for
ResultSet chunks. |
InsertOptions.InsertOptionsBuilder |
ifNotExists(boolean ifNotExists)
Use light-weight transactions by applying
IF NOT EXISTS . |
InsertOptions.InsertOptionsBuilder |
readTimeout(long readTimeout)
Sets the read timeout in milliseconds.
|
InsertOptions.InsertOptionsBuilder |
readTimeout(long readTimeout,
TimeUnit timeUnit)
Sets the read timeout.
|
InsertOptions.InsertOptionsBuilder |
retryPolicy(com.datastax.driver.core.policies.RetryPolicy driverRetryPolicy)
Sets the
driver RetryPolicy to use. |
InsertOptions.InsertOptionsBuilder |
tracing(boolean tracing)
Enables statement tracing.
|
InsertOptions.InsertOptionsBuilder |
ttl(int ttl)
Sets the time to live for write operations.
|
InsertOptions.InsertOptionsBuilder |
withIfNotExists()
Use light-weight transactions by applying
IF NOT EXISTS . |
InsertOptions.InsertOptionsBuilder |
withTracing()
Enables statement tracing.
|
applyOptions
public InsertOptions.InsertOptionsBuilder consistencyLevel(com.datastax.driver.core.ConsistencyLevel consistencyLevel)
QueryOptions.QueryOptionsBuilder
ConsistencyLevel
to use.consistencyLevel
in class WriteOptions.WriteOptionsBuilder
consistencyLevel
- must not be null.this
QueryOptions.QueryOptionsBuilder
public InsertOptions.InsertOptionsBuilder retryPolicy(com.datastax.driver.core.policies.RetryPolicy driverRetryPolicy)
QueryOptions.QueryOptionsBuilder
driver RetryPolicy
to use. Setting both ( RetryPolicy
and driver RetryPolicy
) retry policies is not supported.retryPolicy
in class WriteOptions.WriteOptionsBuilder
driverRetryPolicy
- must not be null.this
QueryOptions.QueryOptionsBuilder
public InsertOptions.InsertOptionsBuilder fetchSize(int fetchSize)
QueryOptions.QueryOptionsBuilder
ResultSet
chunks.
The fetch size controls how much resulting rows will be retrieved simultaneously (the goal being to avoid loading too much results in memory for queries yielding large results). Please note that while value as low as 1 can be used, it is *highly* discouraged to use such a low value in practice as it will yield very poor performance.
fetchSize
in class WriteOptions.WriteOptionsBuilder
fetchSize
- the number of rows to fetch per chunking request. To disable chunking of the result set, use
fetchSize == Integer.MAX_VALUE
. Negative values are not allowed.this
QueryOptions.QueryOptionsBuilder
QueryOptions.getFetchSize()
,
Cluster.Builder.withQueryOptions(com.datastax.driver.core.QueryOptions)
public InsertOptions.InsertOptionsBuilder readTimeout(long readTimeout)
QueryOptions.QueryOptionsBuilder
readTimeout
in class WriteOptions.WriteOptionsBuilder
readTimeout
- the read timeout in milliseconds. Negative values are not allowed. If it is 0
, the
read timeout will be disabled for this statement.this
QueryOptions.QueryOptionsBuilder
SocketOptions.getReadTimeoutMillis()
,
Cluster.Builder.withSocketOptions(SocketOptions)
public InsertOptions.InsertOptionsBuilder readTimeout(long readTimeout, TimeUnit timeUnit)
QueryOptions.QueryOptionsBuilder
readTimeout
in class WriteOptions.WriteOptionsBuilder
readTimeout
- the read timeout value. Negative values are not allowed. If it is 0
, the read timeout
will be disabled for this statement.timeUnit
- the TimeUnit
for the supplied timeout; must not be null.this
QueryOptions.QueryOptionsBuilder
SocketOptions.getReadTimeoutMillis()
,
Cluster.Builder.withSocketOptions(SocketOptions)
public InsertOptions.InsertOptionsBuilder tracing(boolean tracing)
QueryOptions.QueryOptionsBuilder
tracing
in class WriteOptions.WriteOptionsBuilder
tracing
- true to enable statement tracing to the executed statements.this
QueryOptions.QueryOptionsBuilder
public InsertOptions.InsertOptionsBuilder withTracing()
QueryOptions.QueryOptionsBuilder
withTracing
in class WriteOptions.WriteOptionsBuilder
this
QueryOptions.QueryOptionsBuilder
public InsertOptions.InsertOptionsBuilder ttl(int ttl)
WriteOptions.WriteOptionsBuilder
ttl
in class WriteOptions.WriteOptionsBuilder
ttl
- the time to live.this
WriteOptions.WriteOptionsBuilder
public InsertOptions.InsertOptionsBuilder withIfNotExists()
IF NOT EXISTS
.this
InsertOptions.InsertOptionsBuilder
public InsertOptions.InsertOptionsBuilder ifNotExists(boolean ifNotExists)
IF NOT EXISTS
.ifNotExists
- true to enable IF NOT EXISTS
.this
InsertOptions.InsertOptionsBuilder
public InsertOptions build()
InsertOptions
with the configured values.build
in class WriteOptions.WriteOptionsBuilder
InsertOptions
with the configured valuesCopyright © 2011–2017 Pivotal Software, Inc.. All rights reserved.