org.apache.hadoop.mapred.gridmix
Class StressJobFactory

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

public class StressJobFactory
extends Object


Nested Class Summary
protected static class JobFactory.FilterJobStory
           
 
Field Summary
protected  org.apache.hadoop.conf.Configuration conf
           
protected  IOException error
           
protected  org.apache.hadoop.tools.rumen.JobStoryProducer jobProducer
           
protected  ReentrantLock lock
           
static org.apache.commons.logging.Log LOG
           
protected  float rateFactor
           
protected  Thread rThread
           
protected  org.apache.hadoop.fs.Path scratch
           
protected  AtomicInteger sequence
           
protected  CountDownLatch startFlag
           
protected  org.apache.hadoop.mapred.gridmix.JobSubmitter submitter
           
 
Constructor Summary
StressJobFactory(org.apache.hadoop.mapred.gridmix.JobSubmitter submitter, org.apache.hadoop.tools.rumen.JobStoryProducer jobProducer, org.apache.hadoop.fs.Path scratch, org.apache.hadoop.conf.Configuration conf, CountDownLatch startFlag)
          Creating a new instance does not start the thread.
 
Method Summary
 void abort()
          Interrupt the reader thread.
 void add(Void ignored)
          Add is disabled.
 Thread createReaderThread()
           
 IOException error()
          Obtain the error that caused the thread to exit unexpectedly.
protected  org.apache.hadoop.tools.rumen.JobStory getNextJobFiltered()
           
 void join(long millis)
          Wait for the reader thread to exhaust the job trace.
 void shutdown()
          Interrupt the reader thread.
 void start()
          Start the reader thread, wait for latch if necessary.
 void update(org.apache.hadoop.mapred.gridmix.Statistics.ClusterStats item)
          

STRESS Once you get the notification from StatsCollector.Collect the clustermetrics.

 
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

scratch

protected final org.apache.hadoop.fs.Path scratch

rateFactor

protected final float rateFactor

conf

protected final org.apache.hadoop.conf.Configuration conf

rThread

protected final Thread rThread

sequence

protected final AtomicInteger sequence

submitter

protected final org.apache.hadoop.mapred.gridmix.JobSubmitter submitter

startFlag

protected final CountDownLatch startFlag

error

protected volatile IOException error

jobProducer

protected final org.apache.hadoop.tools.rumen.JobStoryProducer jobProducer

lock

protected final ReentrantLock lock
Constructor Detail

StressJobFactory

public StressJobFactory(org.apache.hadoop.mapred.gridmix.JobSubmitter submitter,
                        org.apache.hadoop.tools.rumen.JobStoryProducer jobProducer,
                        org.apache.hadoop.fs.Path scratch,
                        org.apache.hadoop.conf.Configuration conf,
                        CountDownLatch startFlag)
                 throws IOException
Creating a new instance does not start the thread.

Parameters:
submitter - Component to which deserialized jobs are passed
jobProducer - Stream of job traces with which to construct a ZombieJobProducer
scratch - Directory into which to write output from simulated jobs
conf - Config passed to all jobs to be submitted
startFlag - Latch released from main to start pipeline
Throws:
IOException
Method Detail

createReaderThread

public Thread createReaderThread()

update

public void update(org.apache.hadoop.mapred.gridmix.Statistics.ClusterStats item)

STRESS Once you get the notification from StatsCollector.Collect the clustermetrics. Update current loadStatus with new load status of JT.

Parameters:
item -

start

public void start()
Start the reader thread, wait for latch if necessary.


getNextJobFiltered

protected org.apache.hadoop.tools.rumen.JobStory getNextJobFiltered()
                                                             throws IOException
Throws:
IOException

error

public IOException error()
Obtain the error that caused the thread to exit unexpectedly.


add

public void add(Void ignored)
Add is disabled.

Throws:
UnsupportedOperationException

join

public void join(long millis)
          throws InterruptedException
Wait for the reader thread to exhaust the job trace.

Throws:
InterruptedException

shutdown

public void shutdown()
Interrupt the reader thread.


abort

public void abort()
Interrupt the reader thread. This requires no special consideration, as the thread has no pending work queue.



Copyright © 2009 The Apache Software Foundation