Package io.etcd.jetcd.options
Class PutOption.Builder
java.lang.Object
io.etcd.jetcd.options.PutOption.Builder
- Enclosing class:
- PutOption
Builder to construct a put option.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()build the put option.When autoRetry is set, treat this put as idempotent from the point of view of automated retries.withLeaseId(long leaseId) Assign a leaseId for a put operation.When withPrevKV is set, put response contains previous key-value pair.
-
Method Details
-
withLeaseId
Assign a leaseId for a put operation. Zero means no lease.- Parameters:
leaseId- lease id to apply to a put operation- Returns:
- builder
- Throws:
IllegalArgumentException- if lease is less than zero.
-
withPrevKV
When withPrevKV is set, put response contains previous key-value pair.- Returns:
- builder
-
withAutoRetry
When autoRetry is set, treat this put as idempotent from the point of view of automated retries. Note under some failure scenarios autoRetry=true may make a put operation execute more than once, where a first attempt succeeded but its result did not reach the client; by default (autoRetry=false), the client won't retry since it is not safe to assume on such a failure that the operation did not happen in the server. Requesting withAutoRetry means the client is explicitly asking for retry nevertheless.- Returns:
- builder
-
build
build the put option.- Returns:
- the put option
-