public abstract class CounterCache<Config,JobStatus,Counters> extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected Config |
configuration |
static java.lang.String |
COUNTER_FETCH_RETRIES_PROPERTY |
static java.lang.String |
COUNTER_MAX_AGE_PROPERTY |
static java.lang.String |
COUNTER_TIMEOUT_PROPERTY |
static int |
DEFAULT_CACHED_AGE_MAX |
static int |
DEFAULT_FETCH_RETRIES |
static int |
DEFAULT_NODE_CACHED_AGE_MAX |
static int |
DEFAULT_TIMEOUT_TIMEOUT_SEC |
protected int |
fetchAttempts |
protected int |
maxAge |
protected int |
maxFetchAttempts |
static java.lang.String |
NODE_COUNTER_MAX_AGE_PROPERTY |
protected int |
timeout |
Modifier | Constructor and Description |
---|---|
protected |
CounterCache(CascadingStats stats,
Config configuration) |
Modifier and Type | Method and Description |
---|---|
protected abstract boolean |
areCountersAvailable(JobStatus runningJob) |
Counters |
cachedCounters() |
Counters |
cachedCounters(boolean force) |
java.util.Collection<java.lang.String> |
getCounterGroups() |
java.util.Collection<java.lang.String> |
getCounterGroupsMatching(java.lang.String regex) |
protected abstract Counters |
getCounters(JobStatus runningJob) |
protected abstract java.util.Set<java.lang.String> |
getCountersFor(Counters counters,
java.lang.String group) |
java.util.Collection<java.lang.String> |
getCountersFor(java.lang.String group) |
protected abstract long |
getCounterValue(Counters counters,
java.lang.Enum counter) |
protected abstract long |
getCounterValue(Counters counters,
java.lang.String group,
java.lang.String counter) |
long |
getCounterValue(java.lang.Enum counter) |
long |
getCounterValue(java.lang.String group,
java.lang.String counter) |
protected abstract java.util.Collection<java.lang.String> |
getGroupNames(Counters counters) |
protected abstract int |
getIntProperty(java.lang.String property,
int defaultValue) |
protected abstract JobStatus |
getJobStatusClient() |
long |
getLastSuccessfulFetch() |
public static final java.lang.String COUNTER_TIMEOUT_PROPERTY
public static final java.lang.String COUNTER_FETCH_RETRIES_PROPERTY
public static final java.lang.String COUNTER_MAX_AGE_PROPERTY
public static final java.lang.String NODE_COUNTER_MAX_AGE_PROPERTY
public static final int DEFAULT_TIMEOUT_TIMEOUT_SEC
public static final int DEFAULT_FETCH_RETRIES
public static final int DEFAULT_CACHED_AGE_MAX
public static final int DEFAULT_NODE_CACHED_AGE_MAX
protected int maxFetchAttempts
protected int fetchAttempts
protected int timeout
protected int maxAge
protected final Config configuration
protected CounterCache(CascadingStats stats, Config configuration)
protected abstract int getIntProperty(java.lang.String property, int defaultValue)
public long getLastSuccessfulFetch()
protected abstract JobStatus getJobStatusClient()
protected abstract boolean areCountersAvailable(JobStatus runningJob)
protected abstract Counters getCounters(JobStatus runningJob) throws java.io.IOException
java.io.IOException
protected abstract java.util.Collection<java.lang.String> getGroupNames(Counters counters)
protected abstract java.util.Set<java.lang.String> getCountersFor(Counters counters, java.lang.String group)
protected abstract long getCounterValue(Counters counters, java.lang.Enum counter)
protected abstract long getCounterValue(Counters counters, java.lang.String group, java.lang.String counter)
public java.util.Collection<java.lang.String> getCounterGroups()
public java.util.Collection<java.lang.String> getCounterGroupsMatching(java.lang.String regex)
public java.util.Collection<java.lang.String> getCountersFor(java.lang.String group)
public long getCounterValue(java.lang.Enum counter)
public long getCounterValue(java.lang.String group, java.lang.String counter)
public Counters cachedCounters()
public Counters cachedCounters(boolean force)
Copyright © 2007-2015 Xplenty, Inc. All Rights Reserved.