cascading.stats

## Class CounterCache<Config,JobStatus,Counters>

- java.lang.Object
- - cascading.stats.CounterCache<Config,JobStatus,Counters>

    public abstract class CounterCache<Config,JobStatus,Counters>
    extends java.lang.Object

### Field Summary

Fields
`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`

### Constructor Summary

Constructors
`protected` `CounterCache(CascadingStats stats, Config configuration)`

### Method Summary

Methods
`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()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### COUNTER_TIMEOUT_PROPERTY

    public static final java.lang.String COUNTER_TIMEOUT_PROPERTY

See Also:
  Constant Field Values

#### COUNTER_FETCH_RETRIES_PROPERTY

    public static final java.lang.String COUNTER_FETCH_RETRIES_PROPERTY

See Also:
  Constant Field Values

#### COUNTER_MAX_AGE_PROPERTY

    public static final java.lang.String COUNTER_MAX_AGE_PROPERTY

See Also:
  Constant Field Values

#### NODE_COUNTER_MAX_AGE_PROPERTY

    public static final java.lang.String NODE_COUNTER_MAX_AGE_PROPERTY

See Also:
  Constant Field Values

#### DEFAULT_TIMEOUT_TIMEOUT_SEC

    public static final int DEFAULT_TIMEOUT_TIMEOUT_SEC

See Also:
  Constant Field Values

#### DEFAULT_FETCH_RETRIES

    public static final int DEFAULT_FETCH_RETRIES

See Also:
  Constant Field Values

#### DEFAULT_CACHED_AGE_MAX

    public static final int DEFAULT_CACHED_AGE_MAX

See Also:
  Constant Field Values

#### DEFAULT_NODE_CACHED_AGE_MAX

    public static final int DEFAULT_NODE_CACHED_AGE_MAX

See Also:
  Constant Field Values

#### maxFetchAttempts

    protected int maxFetchAttempts

#### fetchAttempts

    protected int fetchAttempts

#### timeout

    protected int timeout

#### maxAge

    protected int maxAge

#### configuration

    protected final Config configuration

### Constructor Detail

#### CounterCache

    protected CounterCache(CascadingStats stats,
                Config configuration)

### Method Detail

#### getIntProperty

    protected abstract int getIntProperty(java.lang.String property,
                     int defaultValue)

#### getLastSuccessfulFetch

    public long getLastSuccessfulFetch()

#### getJobStatusClient

    protected abstract JobStatus getJobStatusClient()

#### areCountersAvailable

    protected abstract boolean areCountersAvailable(JobStatus runningJob)

#### getCounters

    protected abstract Counters getCounters(JobStatus runningJob)
                                     throws java.io.IOException

Throws:
  `java.io.IOException`

#### getGroupNames

    protected abstract java.util.Collection<java.lang.String> getGroupNames(Counters counters)

#### getCountersFor

    protected abstract java.util.Set<java.lang.String> getCountersFor(Counters counters,
                                                 java.lang.String group)

#### getCounterValue

    protected abstract long getCounterValue(Counters counters,
                       java.lang.Enum counter)

#### getCounterValue

    protected abstract long getCounterValue(Counters counters,
                       java.lang.String group,
                       java.lang.String counter)

#### getCounterGroups

    public java.util.Collection<java.lang.String> getCounterGroups()

#### getCounterGroupsMatching

    public java.util.Collection<java.lang.String> getCounterGroupsMatching(java.lang.String regex)

#### getCountersFor

    public java.util.Collection<java.lang.String> getCountersFor(java.lang.String group)

#### getCounterValue

    public long getCounterValue(java.lang.Enum counter)

#### getCounterValue

    public long getCounterValue(java.lang.String group,
                       java.lang.String counter)

#### cachedCounters

    public Counters cachedCounters()

#### cachedCounters

    public Counters cachedCounters(boolean force)