Class JobEndNotifier
java.lang.Object
org.apache.hadoop.mapreduce.v2.app.JobEndNotifier
- All Implemented Interfaces:
org.apache.hadoop.conf.Configurable
This class handles job end notification. Submitters of jobs can choose to be notified of the end of a job by supplying a URL to which a connection will be established.
- The URL connection is fire and forget by default.
- User can specify number of retry attempts and a time interval at which to attempt retries
- Cluster administrators can set final parameters to set maximum number of tries (0 would disable job end notification) and max time interval and a proxy if needed
- The URL may contain sentinels which will be replaced by jobId and jobStatus (eg. SUCCEEDED/KILLED/FAILED)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.hadoop.conf.ConfigurationgetConf()voidnotify(org.apache.hadoop.mapreduce.v2.api.records.JobReport jobReport) Notify a server of the completion of a submitted job.protected booleanNotify the URL just once.voidsetConf(org.apache.hadoop.conf.Configuration conf) Parse the URL that needs to be notified of the end of the job, along with the number of retries in case of failure, the amount of time to wait between retries and proxy settings
-
Field Details
-
userUrl
-
proxyConf
-
numTries
protected int numTries -
waitInterval
protected int waitInterval -
timeout
protected int timeout -
urlToNotify
-
proxyToUse
-
-
Constructor Details
-
JobEndNotifier
public JobEndNotifier()
-
-
Method Details
-
setConf
public void setConf(org.apache.hadoop.conf.Configuration conf) Parse the URL that needs to be notified of the end of the job, along with the number of retries in case of failure, the amount of time to wait between retries and proxy settings- Specified by:
setConfin interfaceorg.apache.hadoop.conf.Configurable- Parameters:
conf- the configuration
-
getConf
public org.apache.hadoop.conf.Configuration getConf()- Specified by:
getConfin interfaceorg.apache.hadoop.conf.Configurable
-
notifyURLOnce
protected boolean notifyURLOnce()Notify the URL just once. Use best effort. -
notify
public void notify(org.apache.hadoop.mapreduce.v2.api.records.JobReport jobReport) throws InterruptedException Notify a server of the completion of a submitted job. The user must have configured MRJobConfig.MR_JOB_END_NOTIFICATION_URL- Parameters:
jobReport- JobReport used to read JobId and JobStatus- Throws:
InterruptedException
-