public static class WatchOption.Builder extends Object
| Modifier and Type | Method and Description |
|---|---|
WatchOption |
build() |
WatchOption.Builder |
isPrefix(boolean prefix)
Enables watch watch all the keys by prefix.
|
WatchOption.Builder |
withNoDelete(boolean noDelete)
filter out delete event in server side.
|
WatchOption.Builder |
withNoPut(boolean noPut)
filter out put event in server side.
|
WatchOption.Builder |
withPrefix(ByteSequence prefix)
Deprecated.
Use
isPrefix(boolean) instead. |
WatchOption.Builder |
withPrevKV(boolean prevKV)
When prevKV is set, created watcher gets the previous KV before the event happens,
if the previous KV is not compacted.
|
WatchOption.Builder |
withProgressNotify(boolean progressNotify)
When progressNotify is set, the watch server send periodic progress updates.
|
WatchOption.Builder |
withRange(ByteSequence endKey)
Set the end key of the get request.
|
WatchOption.Builder |
withRequireLeader(boolean requireLeader)
When creating the watch streaming stub, use the REQUIRED_LEADER Metadata annotation,
which ensures the stream will error out if quorum is lost by
the server the stream is connected to.
|
WatchOption.Builder |
withRevision(long revision)
Provide the revision to use for the get request.
|
public WatchOption.Builder withRevision(long revision)
If the revision is less or equal to zero, the get is over the newest key-value store.
If the revision has been compacted, ErrCompacted is returned as a response.
revision - the revision to get.public WatchOption.Builder withRange(ByteSequence endKey)
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 gets all keys with the prefix (the given key).
If both key and end key are '\0', it returns all keys.
endKey - end keypublic WatchOption.Builder withPrevKV(boolean prevKV)
prevKV - configure the watcher to receive previous KV.public WatchOption.Builder withProgressNotify(boolean progressNotify)
progressNotify - configure the watcher to receive progress updates.public WatchOption.Builder withNoPut(boolean noPut)
noPut - filter out put eventpublic WatchOption.Builder withNoDelete(boolean noDelete)
noDelete - filter out delete eventpublic WatchOption.Builder isPrefix(boolean prefix)
prefix - flag to watch all the keys by prefix@Deprecated public WatchOption.Builder withPrefix(ByteSequence prefix)
isPrefix(boolean) instead.prefix - the common prefix of all the keys that you want to watchpublic WatchOption.Builder withRequireLeader(boolean requireLeader)
requireLeader - require quorum for watch stream creation.public WatchOption build()
Copyright © 2021. All rights reserved.