Class TopologyChangeNotificationBuffer

java.lang.Object
com.couchbase.client.core.config.TopologyChangeNotificationBuffer

@NullMarked @Internal public class TopologyChangeNotificationBuffer extends Object
"Squashes" notifications, retaining only the highest revision for each bucket (plus global).

Note this is very regularly reset - it's purely intended to debounce when multiple configs arrive in quick succession.

  • Constructor Details

    • TopologyChangeNotificationBuffer

      public TopologyChangeNotificationBuffer()
  • Method Details

    • putIfNewer

      public boolean putIfNewer(String bucketName, TopologyRevision revision, @Nullable HostAndPort origin)
      Returns true if the given revision was added to the buffer, or false if it was not newer than the existing entry.
      Parameters:
      bucketName - empty means global
      origin - where the topology arrived from, for debugging
    • remove

      public @Nullable TopologyRevision remove(@Nullable String bucketName)
      Parameters:
      bucketName - null means global
    • toString

      public String toString()
      Overrides:
      toString in class Object