Package io.etcd.jetcd.options
Class WatchOption
java.lang.Object
io.etcd.jetcd.options.WatchOption
The option for watch operation.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic WatchOption.Builderbuilder()longReturns the revision to watch from.booleanWhether watcher server send watch create event.booleanWhether filter delete event in server side.booleanisNoPut()Whether filter put event in server side.booleanisPrefix()booleanisPrevKV()Whether created watcher gets the previous KV before the event happens.booleanWhether watcher server send periodic progress updates.static WatchOption.BuilderDeprecated.booleanIf true, 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.
-
Field Details
-
DEFAULT
-
-
Method Details
-
getEndKey
-
getRevision
public long getRevision()Returns the revision to watch from.- Returns:
- the revision.
-
isPrevKV
public boolean isPrevKV()Whether created watcher gets the previous KV before the event happens.- Returns:
- if true, watcher receives the previous KV before the event happens.
-
isProgressNotify
public boolean isProgressNotify()Whether watcher server send periodic progress updates.- Returns:
- if true, watcher server should send periodic progress updates.
-
isCreatedNotify
public boolean isCreatedNotify()Whether watcher server send watch create event.- Returns:
- if true, watcher server should send watch create event.
-
isNoPut
public boolean isNoPut()Whether filter put event in server side.- Returns:
- if true, filter put event in server side
-
isNoDelete
public boolean isNoDelete()Whether filter delete event in server side.- Returns:
- if true, filter delete event in server side
-
withRequireLeader
public boolean withRequireLeader()If true, 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. This will make the watch fail with an error and finish. Without this option, a watch running against a server that is out of quorum simply goes silent.- Returns:
- if true, use REQUIRE_LEADER metadata annotation for watch streams
-
isPrefix
public boolean isPrefix() -
newBuilder
Deprecated.usebuilder()Returns the builder.- Returns:
- the builder
-
builder
-
builder()