Enum KvWatchOption

  • All Implemented Interfaces:
    java.io.Serializable , kotlin.Comparable

    
    public enum KvWatchOption
    extends Enum<KvWatchOption>
                        

    How a Key-Value watch starts, and what it carries

    An option changes where the watch begins or how much of each revision the server sends. The un-optioned watch starts at the latest revision of every matching key and then follows changes (io/nats/client/impl/NatsKeyValueWatchSubscription.java:41).

    INCLUDE_HISTORY and UPDATES_ONLY are two answers to one question - where to start - and cannot both be given. IGNORE_DELETE and META_ONLY are independent of the starting point and of each other.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      IGNORE_DELETE

      Drop DELETE and PURGE markers, leaving only live values

      The filter is applied by the client, not the server (io/nats/client/impl/NatsKeyValueWatchSubscription.java:75-77), so a key whose latest revision is a deletion is simply absent: a cache warmed this way cannot tell "never existed" from "deleted".

      META_ONLY

      Ask the server for headers only, so no entry carries a value

      Sets headersOnly on the watch consumer (io/nats/client/impl/NatsKeyValueWatchSubscription.java:46), so KeyValueEntry.value is null on every entry, PUT included, while KeyValueEntry.operation and KeyValueEntry.revision still arrive.

      INCLUDE_HISTORY

      Start at the first revision of every matching key rather than the latest

      DeliverPolicy.All (io/nats/client/impl/NatsKeyValueWatchSubscription.java:49): the whole retained history replays before the initial snapshot is complete.

      UPDATES_ONLY

      Skip the snapshot entirely and start at the next change

      DeliverPolicy.New (io/nats/client/impl/NatsKeyValueWatchSubscription.java:48). The initial sync is complete immediately, before any entry - and, uniquely to this option, before the watch has been established at all (io/nats/client/impl/NatsWatchSubscription.java:50-52), so KvWatchEvent.InitialSyncComplete is not a rendezvous a writer can wait on here.

    • Method Summary

      Modifier and Type Method Description
      final Array<KvWatchOption> values() Returns an array containing the constants of this enum type, in the order they're declared.
      final KvWatchOption valueOf(String value) Returns the enum constant of this type with the specified name.
      final EnumEntries<KvWatchOption> getEntries()
      • Methods inherited from class kotlin.Enum

        getName, getOrdinal
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • values

         final Array<KvWatchOption> values()

        Returns an array containing the constants of this enum type, in the order they're declared.

        This method may be used to iterate over the constants.

      • valueOf

         final KvWatchOption valueOf(String value)

        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)