org.apache.hadoop.mapreduce.counters
Class CounterGroupFactory<C extends Counter,G extends CounterGroupBase<C>>

java.lang.Object
  extended by org.apache.hadoop.mapreduce.counters.CounterGroupFactory<C,G>
Type Parameters:
C - type of the counter
G - type of the group

@InterfaceAudience.Private
public abstract class CounterGroupFactory<C extends Counter,G extends CounterGroupBase<C>>
extends Object

An abstract class to provide common implementation of the group factory in both mapred and mapreduce packages.


Nested Class Summary
static interface CounterGroupFactory.FrameworkGroupFactory<F>
           
 
Constructor Summary
CounterGroupFactory()
           
 
Method Summary
static int getFrameworkGroupId(String name)
          Get the id of a framework group
static boolean isFrameworkGroup(String name)
          Check whether a group name is a name of a framework group (including the filesystem group).
protected abstract  G newFileSystemGroup()
          Abstract factory method to create a file system counter group
 G newFrameworkGroup(int id)
          Create a new framework group
protected abstract
<T extends Enum<T>>
CounterGroupFactory.FrameworkGroupFactory<G>
newFrameworkGroupFactory(Class<T> cls)
          Required override to return a new framework group factory
protected abstract  G newGenericGroup(String name, String displayName, Limits limits)
          Abstract factory method to create a generic (vs framework) counter group
 G newGroup(String name, Limits limits)
          Create a new counter group
 G newGroup(String name, String displayName, Limits limits)
          Create a new counter group
 int version()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CounterGroupFactory

public CounterGroupFactory()
Method Detail

newFrameworkGroupFactory

protected abstract <T extends Enum<T>> CounterGroupFactory.FrameworkGroupFactory<G> newFrameworkGroupFactory(Class<T> cls)
Required override to return a new framework group factory

Type Parameters:
T - type of the counter enum class
Parameters:
cls - the counter enum class
Returns:
a new framework group factory

newGroup

public G newGroup(String name,
                  Limits limits)
Create a new counter group

Parameters:
name - of the group
limits - the counters limits policy object
Returns:
a new counter group

newGroup

public G newGroup(String name,
                  String displayName,
                  Limits limits)
Create a new counter group

Parameters:
name - of the group
displayName - of the group
limits - the counters limits policy object
Returns:
a new counter group

newFrameworkGroup

public G newFrameworkGroup(int id)
Create a new framework group

Parameters:
id - of the group
Returns:
a new framework group

getFrameworkGroupId

public static int getFrameworkGroupId(String name)
Get the id of a framework group

Parameters:
name - of the group
Returns:
the framework group id

version

public int version()
Returns:
the counter factory version

isFrameworkGroup

public static boolean isFrameworkGroup(String name)
Check whether a group name is a name of a framework group (including the filesystem group).

Parameters:
name - to check
Returns:
true for framework group names

newGenericGroup

protected abstract G newGenericGroup(String name,
                                     String displayName,
                                     Limits limits)
Abstract factory method to create a generic (vs framework) counter group

Parameters:
name - of the group
displayName - of the group
limits - limits of the counters
Returns:
a new generic counter group

newFileSystemGroup

protected abstract G newFileSystemGroup()
Abstract factory method to create a file system counter group

Returns:
a new file system counter group


Copyright © 2013 Apache Software Foundation. All Rights Reserved.