K - public class MetaInformation<K extends TurbineData>
extends java.lang.Object
InstanceMonitor(s)
An e.g of meta info is
data: {type:meta, name:meta, reportingHostsLast10Seconds:30}
See MetaInfoUpdator for details on how and when the meta info is updated and sent downstream.
See MetaInfoAdaptor for details on how data from the MetaInfo is converted to the right data format in order to be
streamed to interested listeners.| Modifier and Type | Field and Description |
|---|---|
protected ClusterMonitor<K> |
clusterMonitor |
protected java.util.concurrent.atomic.AtomicLong |
lastUpdateTime |
static java.lang.String |
Meta |
protected MetaInfoAdaptor<K> |
metaInfoAdaptor |
protected java.util.concurrent.atomic.AtomicLong |
numReportingHosts |
static java.lang.String |
ReportingHostsLast10Seconds |
static java.lang.String |
Timestamp |
| Constructor and Description |
|---|
MetaInformation(ClusterMonitor<K> monitor,
MetaInfoAdaptor<K> adaptor)
Public constructor
|
| Modifier and Type | Method and Description |
|---|---|
long |
getLastUpdateTime()
Timestamp when the meta info was last updated
|
long |
getReportingHosts()
Return hosts that received data in the last 10 seconds
|
boolean |
shouldStream()
Used to determine whether we should send the data downstream.
|
void |
streamDataToListeners()
Send data to downstream listeners.
|
void |
update()
Update the meta info using the custom biz logic.
|
protected final ClusterMonitor<K extends TurbineData> clusterMonitor
protected final MetaInfoAdaptor<K extends TurbineData> metaInfoAdaptor
protected final java.util.concurrent.atomic.AtomicLong lastUpdateTime
protected final java.util.concurrent.atomic.AtomicLong numReportingHosts
public static final java.lang.String Meta
public static final java.lang.String ReportingHostsLast10Seconds
public static final java.lang.String Timestamp
public MetaInformation(ClusterMonitor<K> monitor, MetaInfoAdaptor<K> adaptor)
monitor - adaptor - public boolean shouldStream()
public void update()
public void streamDataToListeners()
public long getReportingHosts()
public long getLastUpdateTime()