org.apache.hadoop.mapred.gridmix
Class Statistics

java.lang.Object
  extended by org.apache.hadoop.mapred.gridmix.Statistics

public class Statistics
extends Object

Component collecting the stats required by other components to make decisions. Single thread Collector tries to collec the stats. Each of thread poll updates certain datastructure(Currently ClusterStats). Components interested in these datastructure, need to register. StatsCollector notifies each of the listeners.


Field Summary
static org.apache.commons.logging.Log LOG
           
 
Constructor Summary
Statistics(org.apache.hadoop.conf.Configuration conf, int pollingInterval, CountDownLatch startFlag)
           
 
Method Summary
 void abort()
          Shut down immediately, aborting any work in progress and discarding all pending work.
 void add(Job job)
          Used by JobMonitor to add the completed job.
 void addClusterStatsObservers(org.apache.hadoop.mapred.gridmix.StatListener<org.apache.hadoop.mapred.gridmix.Statistics.ClusterStats> listener)
           
 void addJobStatsListeners(org.apache.hadoop.mapred.gridmix.StatListener<org.apache.hadoop.mapred.gridmix.Statistics.JobStats> listener)
           
 void join(long millis)
          Wait until the service completes.
 void shutdown()
          Shut down gracefully, finishing all pending work.
 void start()
          Attempt to start the service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

public static final org.apache.commons.logging.Log LOG
Constructor Detail

Statistics

public Statistics(org.apache.hadoop.conf.Configuration conf,
                  int pollingInterval,
                  CountDownLatch startFlag)
           throws IOException
Throws:
IOException
Method Detail

add

public void add(Job job)
Used by JobMonitor to add the completed job.


addClusterStatsObservers

public void addClusterStatsObservers(org.apache.hadoop.mapred.gridmix.StatListener<org.apache.hadoop.mapred.gridmix.Statistics.ClusterStats> listener)

addJobStatsListeners

public void addJobStatsListeners(org.apache.hadoop.mapred.gridmix.StatListener<org.apache.hadoop.mapred.gridmix.Statistics.JobStats> listener)

start

public void start()
Attempt to start the service.


join

public void join(long millis)
          throws InterruptedException
Wait until the service completes. It is assumed that either a shutdown or abort() has been requested.

Throws:
InterruptedException

shutdown

public void shutdown()
Shut down gracefully, finishing all pending work. Reject new requests.


abort

public void abort()
Shut down immediately, aborting any work in progress and discarding all pending work. It is legal to store pending work for another thread to process.



Copyright © 2009 The Apache Software Foundation