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 collect the stats (currently cluster stats) and caches it internally. Components interested in these stats need to register themselves and will get notified either on every job completion event or some fixed time interval.


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(org.apache.hadoop.mapred.gridmix.Statistics.JobStats 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 addJobStats(org.apache.hadoop.mapred.gridmix.Statistics.JobStats stats)
          Add a submitted job for monitoring.
 void addJobStatsListeners(org.apache.hadoop.mapred.gridmix.StatListener<org.apache.hadoop.mapred.gridmix.Statistics.JobStats> listener)
           
static org.apache.hadoop.mapred.gridmix.Statistics.JobStats generateJobStats(org.apache.hadoop.mapreduce.Job job, org.apache.hadoop.tools.rumen.JobStory jobdesc)
          Generates a job stats.
 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,
                  InterruptedException
Throws:
IOException
InterruptedException
Method Detail

generateJobStats

public static org.apache.hadoop.mapred.gridmix.Statistics.JobStats generateJobStats(org.apache.hadoop.mapreduce.Job job,
                                                                                    org.apache.hadoop.tools.rumen.JobStory jobdesc)
Generates a job stats.


addJobStats

public void addJobStats(org.apache.hadoop.mapred.gridmix.Statistics.JobStats stats)
Add a submitted job for monitoring.


add

public void add(org.apache.hadoop.mapred.gridmix.Statistics.JobStats 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 © 2014 Apache Software Foundation. All Rights Reserved.