cascading.stats

## Class BaseCachedNodeStats<Config,JobStatus,Counters>

- java.lang.Object
- - cascading.stats.CascadingStats<FlowSliceStats>
  - - cascading.stats.FlowNodeStats
    - - cascading.stats.BaseCachedNodeStats<Config,JobStatus,Counters>

All Implemented Interfaces:
  ProvidesCounters, java.io.Serializable

Direct Known Subclasses:
  HadoopNodeStats, TezNodeStats

    public abstract class BaseCachedNodeStats<Config,JobStatus,Counters>
    extends FlowNodeStats

See Also:
  Serialized Form

### Nested Class Summary

### Nested classes/interfaces inherited from class cascading.stats.CascadingStats

`CascadingStats.Status, CascadingStats.Type`

### Field Summary

Fields
`protected boolean` `allChildrenFinished`
`protected CounterCache<Config,JobStatus,Counters>` `counterCache`
`protected java.util.Map<java.lang.String,FlowSliceStats>` `sliceStatsMap`

### Fields inherited from class cascading.stats.FlowNodeStats

`hasCapturedFinalDetail`

### Fields inherited from class cascading.stats.CascadingStats

`clientState, finishedTime, lastCaptureDetail, listeners, name, pendingTime, runTime, startTime, STATS_COMPLETE_CHILD_DETAILS_BLOCK_DURATION, STATS_STORE_INTERVAL, status, submitTime, throwable, throwableTrace`

### Constructor Summary

Constructors
`protected` `BaseCachedNodeStats(FlowNode flowNode, ClientState clientState)` Constructor BaseHadoopNodeStats creates a new BaseHadoopNodeStats instance.

### Method Summary

Methods
`protected Counters` `cachedCounters(boolean force)`
`protected abstract boolean` `captureChildDetailInternal()` Returns true if was able to capture/refresh the internal child stats cache.
`void` `captureDetail(CascadingStats.Type depth)`
`java.util.Collection<FlowSliceStats>` `getChildren()` Method getChildren returns any relevant child statistics instances.
`FlowSliceStats` `getChildWith(java.lang.String id)` Method getChildWith returns a child stats instance with the given ID value.
`java.util.Collection<java.lang.String>` `getCounterGroups()` Method getCounterGroups returns all of the Hadoop counter groups.
`java.util.Collection<java.lang.String>` `getCounterGroupsMatching(java.lang.String regex)` Method getCounterGroupsMatching returns all the Hadoop counter groups that match the give regex pattern.
`java.util.Collection<java.lang.String>` `getCountersFor(java.lang.String group)` Method getCountersFor returns the Hadoop counters for the given group.
`long` `getCounterValue(java.lang.Enum counter)` Method getCounterValue returns the Hadoop counter value for the given counter enum.
`long` `getCounterValue(java.lang.String group, java.lang.String counter)` Method getCounterValue returns the Hadoop counter value for the given group and counter name.
`long` `getLastSuccessfulCounterFetchTime()` Method getLastSuccessfulCounterFetchTime returns the time, in millis, the last moment counters were successfully retrieved.
`boolean` `isAllChildrenFinished()`
`void` `recordChildStats()` Synchronized to prevent state changes mid record, #stop may be called out of band

### Methods inherited from class cascading.stats.FlowNodeStats

`getFlowNode, getID, getKind, getOrdinal, getProcessLogger, getType, hasCapturedFinalDetail, recordInfo, toString`

### Methods inherited from class cascading.stats.CascadingStats

`addListener, captureDetail, cleanup, fireListeners, getCountersFor, getCurrentDuration, getDuration, getFinishedTime, getName, getPendingTime, getPrefix, getRunTime, getStartTime, getStatsString, getStatus, getSubmitTime, getThrowable, getThrowableTrace, isDetailStale, isEngaged, isFailed, isFinished, isPending, isRunning, isSkipped, isStarted, isStopped, isSubmitted, isSuccessful, logDebug, logError, logError, logInfo, logWarn, markDetailCaptured, markFailed, markFailed, markFailed, markFailed, markFinishedTime, markPending, markPendingTime, markRunning, markRunTime, markSkipped, markStarted, markStartedThenRunning, markStartTime, markStartToRunTime, markStopped, markSubmitted, markSubmitTime, markSuccessful, prepare, recordStats, removeListener, setStatsStoreInterval`

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

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

### Field Detail

#### sliceStatsMap

    protected final java.util.Map<java.lang.String,FlowSliceStats> sliceStatsMap

#### counterCache

    protected CounterCache<Config,JobStatus,Counters> counterCache

#### allChildrenFinished

    protected boolean allChildrenFinished

### Constructor Detail

#### BaseCachedNodeStats

    protected BaseCachedNodeStats(FlowNode flowNode,
                       ClientState clientState)

Constructor BaseHadoopNodeStats creates a new BaseHadoopNodeStats instance.

Parameters:
  `flowNode` -
  `clientState` -

### Method Detail

#### getLastSuccessfulCounterFetchTime

    public long getLastSuccessfulCounterFetchTime()

Description copied from interface: `ProvidesCounters`
Method getLastSuccessfulCounterFetchTime returns the time, in millis, the last moment counters were successfully retrieved.

If -1, counter values were never successfully retrieved.

If this return value is less than the `CascadingStats.getFinishedTime()` it is likely the counter service became unavailable.

Returns:
  the moment counters were last successfully retrieved

#### isAllChildrenFinished

    public boolean isAllChildrenFinished()

#### getCounterGroups

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

Method getCounterGroups returns all of the Hadoop counter groups.

Returns:
  the counterGroups (type Collection<String>) of this HadoopStepStats object.

#### getCounterGroupsMatching

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

Method getCounterGroupsMatching returns all the Hadoop counter groups that match the give regex pattern.

Specified by:
  `getCounterGroupsMatching` in class `CascadingStats<FlowSliceStats>`
Parameters:
  `regex` - of String
Returns:
  Collection<String>

#### getCountersFor

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

Method getCountersFor returns the Hadoop counters for the given group.

Parameters:
  `group` - of String
Returns:
  Collection<String>

#### getCounterValue

    public long getCounterValue(java.lang.Enum counter)

Method getCounterValue returns the Hadoop counter value for the given counter enum.

Parameters:
  `counter` - of Enum
Returns:
  long

#### getCounterValue

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

Method getCounterValue returns the Hadoop counter value for the given group and counter name.

Parameters:
  `group` - of String
  `counter` - of String
Returns:
  long

#### cachedCounters

    protected Counters cachedCounters(boolean force)

#### getChildren

    public java.util.Collection<FlowSliceStats> getChildren()

Description copied from class: `CascadingStats`
Method getChildren returns any relevant child statistics instances. They may not be of type CascadingStats, but instead platform specific.

Specified by:
  `getChildren` in class `CascadingStats<FlowSliceStats>`
Returns:
  a Collection of child statistics

#### getChildWith

    public FlowSliceStats getChildWith(java.lang.String id)

Description copied from class: `CascadingStats`
Method getChildWith returns a child stats instance with the given ID value.

Specified by:
  `getChildWith` in class `CascadingStats<FlowSliceStats>`
Parameters:
  `id` - the id of a child instance
Returns:
  the child stats instance or null if not found

#### captureDetail

    public final void captureDetail(CascadingStats.Type depth)

Specified by:
  `captureDetail` in class `CascadingStats<FlowSliceStats>`

#### captureChildDetailInternal

    protected abstract boolean captureChildDetailInternal()

Returns true if was able to capture/refresh the internal child stats cache.

Returns:
  true if successful

#### recordChildStats

    public void recordChildStats()

Synchronized to prevent state changes mid record, #stop may be called out of band

Specified by:
  `recordChildStats` in class `FlowNodeStats`