Package com.couchbase.client.core.config
Class TopologyChangeNotificationBuffer
java.lang.Object
com.couchbase.client.core.config.TopologyChangeNotificationBuffer
"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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanputIfNewer(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.@Nullable TopologyRevisiontoString()
-
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 globalorigin- where the topology arrived from, for debugging
-
remove
- Parameters:
bucketName- null means global
-
toString
-