java.lang.CloneableBulkWriteOptionspublic class WriteOptions
extends java.lang.Object
implements java.lang.Cloneable
The default behavior is configured when a store is opened using
KVStoreConfig.
| Constructor | Description |
|---|---|
WriteOptions() |
Creates a
WriteOptions with default values. |
WriteOptions(Durability durability,
long timeout,
java.util.concurrent.TimeUnit timeoutUnit) |
Creates a
WriteOptions with the specified parameters. |
WriteOptions(WriteOptions options) |
| Modifier and Type | Method | Description |
|---|---|---|
protected java.lang.Object |
clone() |
|
Durability |
getDurability() |
Returns the durability associated with the operation.
|
int |
getIdentityCacheSize() |
Gets the number of generated identity values that are requested from
the server during a put.
|
long |
getTimeout() |
Returns the timeout, which is an upper bound on the time interval for
processing the operation.
|
java.util.concurrent.TimeUnit |
getTimeoutUnit() |
Returns the unit of the timeout parameter.
|
boolean |
getUpdateTTL() |
Returns true if the absolute expiration time is to be modified during
update operations.
|
WriteOptions |
setDurability(Durability durability) |
Sets durability of write operation.
|
WriteOptions |
setIdentityCacheSize(int identityCacheSize) |
Sets the number of generated identity values that are requested from
the server during a put.
|
WriteOptions |
setTimeout(long timeout,
java.util.concurrent.TimeUnit timeoutUnit) |
Sets timeout for write operation.
|
WriteOptions |
setUpdateTTL(boolean flag) |
Sets whether absolute expiration time will be modified during update.
|
java.lang.String |
toString() |
public WriteOptions()
WriteOptions with default values.
Same as WriteOptions(null, 0, null)WriteOptions(Durability, long, TimeUnit)public WriteOptions(Durability durability, long timeout, java.util.concurrent.TimeUnit timeoutUnit)
WriteOptions with the specified parameters.
If durability is null, the
default durability is used.
The timeout parameter is an upper bound on the time interval for
processing the operation. A best effort is made not to exceed the
specified limit. If zero, the default request timeout is used.
If timeout is not 0, the timeoutUnit parameter must not
be null.
durability - the write durability to usetimeout - the timeout value to usetimeoutUnit - the TimeUnit used by the
timeout parameterjava.lang.IllegalArgumentException - if timeout is negativejava.lang.IllegalArgumentException - if timeout is > 0 and timeoutUnit
is nullpublic WriteOptions(WriteOptions options)
public WriteOptions setDurability(Durability durability)
durability - can be null. If null, the
default durability will be used.public WriteOptions setTimeout(long timeout, java.util.concurrent.TimeUnit timeoutUnit)
timeout - the timeout value to usetimeoutUnit - the TimeUnit used by the
timeout parameterjava.lang.IllegalArgumentException - if timeout is negativejava.lang.IllegalArgumentException - if timeout is > 0 and timeoutUnit
is nullpublic Durability getDurability()
public long getTimeout()
default request timeout is used.public java.util.concurrent.TimeUnit getTimeoutUnit()
TimeUnit or null if the timeout has not been set.public WriteOptions setUpdateTTL(boolean flag)
flag - set to true if the operation should update an existing
record's expiration time.public boolean getUpdateTTL()
public WriteOptions setIdentityCacheSize(int identityCacheSize)
public int getIdentityCacheSize()
protected java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in class java.lang.Objectjava.lang.CloneNotSupportedExceptionpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.