cgl.imr.monitor
Class TwisterMonitor

java.lang.Object
  extended by cgl.imr.monitor.TwisterMonitor
All Implemented Interfaces:
TwisterConstants

public class TwisterMonitor
extends Object
implements TwisterConstants

Monitor the progress of MapReduce computation tasks.


Nested Class Summary
 
Nested classes/interfaces inherited from interface cgl.imr.base.TwisterConstants
TwisterConstants.JobState
 
Field Summary
 
Fields inherited from interface cgl.imr.base.TwisterConstants
COMBINE_INPUT, COMBINE_TOPIC_BASE, DIR_LIST_REQ, DIR_LIST_RES, FAILED, FIXED_DATA_FILE, FIXED_DATA_MODEL, HEP_DATA_STRING, MAP_ITERATIONS_OVER, MAP_REDUCE_TOPIC_BASE, MAP_TASK, MAP_TASK_REQUEST, MAP_WORKER_STARTED, MAPPER_REQUEST, MONITOR_REQUEST, MONITOR_RESPONSE, MONITOR_SLEEP_TIME, NEW_JOB_REQUEST, NEW_JOB_RESPONSE, NUM_MAP_TASKS, NUM_REDUCE_TASKS, PARTITION_FILE_RESPONSE_TOPIC_BASE, PARTITION_FILE_SPLIT_PATTERN, PROPERTIES_FILE, REDUCE_INPUT, REDUCE_RESPONSE, REDUCE_TASK, REDUCE_TASK_REQUEST, REDUCE_TOPIC_BASE, REDUCE_WORKER_REQUEST, RESPONSE_TOPIC_BASE, SEND_RECV_MAX_SLEEP_TIME, SEND_RECV_SLEEP_TIME, SUCCESS, TASK_STATUS, WORKER_RESPONSE
 
Constructor Summary
TwisterMonitor(JobConf jobConf, TwisterDriver driver)
           
 
Method Summary
 void combinerInputReceived()
           
 Exception getMonitoringException()
           
 boolean isComplete()
          Check if the monitoring is complete.
 boolean isHasCombiner()
           
 JobStatus monitorTillCompletion()
          Monitors till the completion of the job.
 JobStatus monitorTillCompletion(int maxMinutes)
          Wait till the completion of the job or till the given number of minutes.
 void onEvent(byte[] message)
          This method receives all the monitoring related events and handles them appropriately.
 void resetMonitor()
           
 void setHasCombiner(boolean hasCombiner)
           
 void setMonitoringException(Exception monitoringException)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TwisterMonitor

public TwisterMonitor(JobConf jobConf,
                      TwisterDriver driver)
Method Detail

combinerInputReceived

public void combinerInputReceived()

getMonitoringException

public Exception getMonitoringException()

isComplete

public boolean isComplete()
                   throws TwisterException
Check if the monitoring is complete.

Returns:
true if completes, otherwise false.
Throws:
TwisterException

isHasCombiner

public boolean isHasCombiner()

monitorTillCompletion

public JobStatus monitorTillCompletion()
                                throws TwisterException
Monitors till the completion of the job.

Returns:
job status.
Throws:
TwisterException

monitorTillCompletion

public JobStatus monitorTillCompletion(int maxMinutes)
                                throws TwisterException
Wait till the completion of the job or till the given number of minutes.

Parameters:
maxMinutes - - Maximum number of minutes to wait.
Returns:
job status
Throws:
TwisterException

onEvent

public void onEvent(byte[] message)
This method receives all the monitoring related events and handles them appropriately.


resetMonitor

public void resetMonitor()

setHasCombiner

public void setHasCombiner(boolean hasCombiner)

setMonitoringException

public void setMonitoringException(Exception monitoringException)


For comments and suggestions please send e-mail to