Package io.etcd.jetcd.options
Class DeleteOption.Builder
java.lang.Object
io.etcd.jetcd.options.DeleteOption.Builder
- Enclosing class:
- DeleteOption
-
Method Summary
Modifier and TypeMethodDescriptionbuild()isPrefix(boolean prefix) Enables 'Delete' requests to delete all the keys by prefix.When autoRetry is set, the delete operation is treated as idempotent from the point of view of automated retries.withPrefix(ByteSequence prefix) Deprecated.withPrevKV(boolean prevKV) Get the previous key/value pairs before deleting them.withRange(ByteSequence endKey) Set the end key of the delete request.
-
Method Details
-
withRange
Set the end key of the delete request. If it is set, the delete request will delete the keys from key to endKey (exclusive).If end key is '\0', the range is all keys >= key.
If the end key is one bit larger than the given key, then it deletes all keys with the prefix (the given key).
If both key and end key are '\0', it deletes all keys.
- Parameters:
endKey- end key- Returns:
- builder
-
isPrefix
Enables 'Delete' requests to delete all the keys by prefix.- Parameters:
prefix- flag to delete all the keys by prefix- Returns:
- builder
-
withPrefix
Deprecated.UseisPrefix(boolean)instead.Enables 'Delete' requests to delete all the keys with matching prefix.You should pass the key that is passed into
KV.deletemethod into this method as the given key.- Parameters:
prefix- the common prefix of all the keys that you want to delete- Returns:
- builder
-
withPrevKV
Get the previous key/value pairs before deleting them.- Parameters:
prevKV- flag to get previous key/value pairs before deleting them.- Returns:
- builder
-
withAutoRetry
When autoRetry is set, the delete operation is treated as idempotent from the point of view of automated retries. Note under some failure scenarios true may make a delete operation be attempted 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 the operation did not happen. Requesting withAutoRetry means the client is explicitly asking for retry nevertheless.- Returns:
- builder
-
build
-
isPrefix(boolean)instead.