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.
-
-
Field Summary
Fields Modifier and Type Field Description private final Stringnameprivate final Integerordinalprivate final EnumEntries<KvWatchOption>entries
-
Enum Constant Summary
Enum Constants Enum Constant Description IGNORE_DELETEDrop 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_ONLYAsk the server for headers only, so no entry carries a value
Sets
headersOnlyon the watch consumer (io/nats/client/impl/NatsKeyValueWatchSubscription.java:46), so KeyValueEntry.value isnullon every entry, PUT included, while KeyValueEntry.operation and KeyValueEntry.revision still arrive.INCLUDE_HISTORYStart 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_ONLYSkip 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 KvWatchOptionvalueOf(String value)Returns the enum constant of this type with the specified name. final EnumEntries<KvWatchOption>getEntries()-
-
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.)
-
getEntries
final EnumEntries<KvWatchOption> getEntries()
-
-
-
-