public class CacheCore
extends java.lang.Object
Constructor and Description |
---|
CacheCore(long maxIntervalSecs,
long intervalSecs,
long maxException)
constructor: CacheCore needs two intervals to configure metrics time window
and one number to limit exception count
|
Modifier and Type | Method and Description |
---|---|
void |
addMetricException(TopologyMaster.PublishMetrics metrics)
compatible with heron::tmaster::TMetricsCollector
|
boolean |
componentInstanceExists(java.lang.String componentName,
java.lang.String instanceId) |
ExceptionResponse |
getExceptions(ExceptionRequest request)
for internal process use
|
MetricResponse |
getMetrics(MetricRequest request,
MetricsFilter metricNameType)
for internal process use
|
boolean |
metricExists(java.lang.String name) |
void |
purge() |
void |
startPurge(WakeableLooper wakeableLooper)
start purge looper task
|
void |
stopPurge()
stop metric purge looper
|
java.lang.String |
toString() |
public CacheCore(long maxIntervalSecs, long intervalSecs, long maxException)
maxIntervalSecs
- metric: cache how long time? in secondsintervalSecs
- metric: purge how often? in secondsmaxException
- exception: cache how many?public boolean componentInstanceExists(java.lang.String componentName, java.lang.String instanceId)
public boolean metricExists(java.lang.String name)
public void addMetricException(TopologyMaster.PublishMetrics metrics)
metrics
- The metrics to be addedpublic MetricResponse getMetrics(MetricRequest request, MetricsFilter metricNameType)
request
- idxMetricName == null: query all metrics idxMetricName == []: query none metric idxMetricName == [a, b, c .. ]: query metric a, b and c, ..
idxComponentInstance == null: query all components idxComponentInstance == []: query none component idxComponentInstance == [c1->null, ..]: query all instances of c1, .. idxComponentInstance == [c1->[], ..]: query none instance of c1, .. idxComponentInstance == [c1->[a, b, c, ..], ..]: query instance a, b, c, .. of c1, ..
assert: startTime <= endTime
metricNameType
- map: metric name to typepublic ExceptionResponse getExceptions(ExceptionRequest request)
request
- idxComponentInstance == null: query all components idxComponentInstance == []: query none component idxComponentInstance == [c1->null, ..]: query all instances of c1, .. idxComponentInstance == [c1->[], ..]: query none instance of c1, .. idxComponentInstance == [c1->[a, b, c, ..], ..]: query instance a, b, c, .. of c1, ..
public void purge()
public void startPurge(WakeableLooper wakeableLooper)
wakeableLooper
- the looper to run timerpublic void stopPurge()
public java.lang.String toString()
toString
in class java.lang.Object