HbsCollector gets and collects the HBs received between invocations of startCollectingHbs and stopCollectingHBs.
HBs older than a given TTL (>0) are automatically removed from the container so that dead processes will disappear after they stop sending HBs. The reception time of the HB is checked against the TTL in a Timer task.
The removal of old HBs periodically done by the timer task can be paused/resumed
TODO: There is some overlap with the HbMonitor here: let HbMonitor re-use this class
Value parameters
- brokers
-
Kafka brokers to connect to
- consumerId
-
The id for the kafka consumer
- ttl
-
time to leave (msec>=0) disabled by default, if ttl>0, HBs older then ttl are automatically removed from the container if ttl<=0, received HBs are never removed from the container It makes sense to link TTL to the HB period set in the CDB ("hbFrequency")
- ttlCheckTime
-
the period (msec>0) to check for old HBs
Attributes
- Companion
- object
- Graph
-
- Supertypes
Members list
Value members
Concrete methods
Remove all the HBs collected so far
Remove all the HBs collected so far
Attributes
Collect HBs for the passed time
Collect HBs for the passed time
Attributes
Get and return the HB of the tool with the given type and id
Get and return the HB of the tool with the given type and id
Value parameters
- hbProdType
-
the type of the producer
- id
-
the ID of the tool
Attributes
Return all the HB messages in the container
Return all the HB messages in the container
Attributes
Get and return the HBs in the map of the passed type
Get and return the HBs in the map of the passed type
Value parameters
- hbProdType
-
the type of the producers
Attributes
An heartbeat has been read from the HB topic: it is added to the container
An heartbeat has been read from the HB topic: it is added to the container
Value parameters
- hbMsg
-
The HB message
Attributes
- Definition Classes
Attributes
- Returns
-
true if the container is collecting HBs
Return true if the consumer has been initialized and is ready to get HB from the BSDB
Return true if the consumer has been initialized and is ready to get HB from the BSDB
Attributes
Attributes
- Returns
-
true if the container is empty
Attributes
- Returns
-
true if the thread to remove old HBs is paused
Pause the timer.
Pause the timer.
As the java timer cannot be paused, the pause/resume is simulated in the timer task (run)
Attributes
Resume the timer.
Resume the timer.
As the java timer cannot be paused, the pause/resume is simulated in the time task (run)
Attributes
The task run by the timer that removes the HBs older than the ttl
The task run by the timer that removes the HBs older than the ttl
Attributes
Connect to the kafka brokers.
Connect to the kafka brokers.
Attributes
Disconnect the consumer
Disconnect the consumer
Attributes
Return the number of items in the container
Return the number of items in the container
Attributes
Starts collecting the HBs.
Starts collecting the HBs.
Attributes
Stops collecting the HBs.
Stops collecting the HBs.
Attributes
Inherited methods
Attributes
- Inherited from:
- TimerTask
Attributes
- Inherited from:
- TimerTask
Concrete fields
The consumer of HBs
The consumer of HBs
Attributes
The timer to remove old HBs
The timer to remove old HBs