Class WatchOption


  • public final class WatchOption
    extends java.lang.Object
    The option for watch operation.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  WatchOption.Builder  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Optional<ByteSequence> getEndKey()  
      long getRevision()
      Returns the revision to watch from.
      boolean isNoDelete()
      Whether filter delete event in server side.
      boolean isNoPut()
      Whether filter put event in server side.
      boolean isPrefix()  
      boolean isPrevKV()
      Whether created watcher gets the previous KV before the event happens.
      boolean isProgressNotify()
      Whether watcher server send periodic progress updates.
      static WatchOption.Builder newBuilder()
      Create a builder to construct option for watch operation.
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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()