ExpiredMembers

When a store's heartbeat deletes the member records it finds expired for LeaseStore.EXPIRED_MEMBER_TTLS TTLs (#6703): at most once per TTL for each key the store heartbeats, the time read from clock. It keeps, in memory, the time of the last delete of each key: one entry per key the store instance heartbeats, a handful, dropped with the store. A store opened again (a node restarted) deletes once at its first heartbeat of each key.

Constructors

Link copied to clipboard
constructor(clock: Clock)

Functions

Link copied to clipboard

How long a heartbeat of ttl lets its delete take at most, besides what is left of the heartbeat's bound: a quarter of ttl, so a delete that hangs never holds the heartbeat past its interval (less than half the TTL), and the node's own record, written first, is written again before it expires.

Link copied to clipboard
fun due(service: String, ttl: Duration): Long?

The expiry before which the records of service are to be deleted now, by a heartbeat of ttl; null when they were deleted less than ttl ago. A clock moved back holds the next delete until it passes the last one's time plus ttl again.