Package io.etcd.jetcd.options
Class WatchOption
- java.lang.Object
-
- io.etcd.jetcd.options.WatchOption
-
public final class WatchOption extends java.lang.ObjectThe option for watch operation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWatchOption.Builder
-
Field Summary
Fields Modifier and Type Field Description static WatchOptionDEFAULT
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<ByteSequence>getEndKey()longgetRevision()Returns the revision to watch from.booleanisNoDelete()Whether 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.booleanisProgressNotify()Whether watcher server send periodic progress updates.static WatchOption.BuildernewBuilder()Create a builder to construct option for watch operation.booleanwithRequireLeader()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.
-
-
-
Field Detail
-
DEFAULT
public static final WatchOption DEFAULT
-
-
Method Detail
-
newBuilder
public static WatchOption.Builder newBuilder()
Create a builder to construct option for watch operation.- Returns:
- builder
-
getEndKey
public java.util.Optional<ByteSequence> 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.
-
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()
-
-