public class DefaultJobProgressTrackerService extends Object implements JobProgressTrackerService
Modifier and Type | Field and Description |
---|---|
static IntConfOption |
MAX_ALLOWED_TIME_WITHOUT_PROGRESS_MS
Max time job is allowed to not make progress before getting killed
|
Constructor and Description |
---|
DefaultJobProgressTrackerService() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
canFinishInTime(GiraphConfiguration conf,
org.apache.hadoop.mapreduce.Job job,
CombinedWorkerProgress progress)
Determine if the job will finish in allotted time
|
static JobProgressTrackerService |
createJobProgressTrackerService(GiraphConfiguration conf,
GiraphJobObserver jobObserver)
Create job progress server on job client if enabled in configuration.
|
void |
init(GiraphConfiguration conf,
GiraphJobObserver jobObserver)
Initialize the service
|
protected void |
jobGotAllMappers()
Called when job got all mappers, used to check MAX_ALLOWED_JOB_TIME_MS
and potentially start a thread which will kill the job after this time
|
protected boolean |
killJobWithMessage(String message)
Kill job with message describing why it's being killed
|
void |
logError(String logLine,
byte[] exByteArray)
Call this when you want to log an error line and exception
object from any mapper to command line
KryoWritableWrapper.convertFromByteArray can be used to
get exception object back
|
void |
logFailure(String reason)
Notify that job is failing
|
void |
logInfo(String logLine)
Call this when you want to log an info line from any mapper to command line
|
void |
mapperStarted()
Notify JobProgressTracker that mapper started
|
void |
sendMasterCounters(GiraphCountersThriftStruct giraphCounters)
Master should call this method after all supersteps are finished,
and send the aggregated counters to the job client
|
void |
setJob(org.apache.hadoop.mapreduce.Job job)
Set job
|
void |
stop(boolean succeeded)
Stop the thread which logs application progress and server
|
void |
updateMasterProgress(MasterProgress masterProgress)
Master should call this method to update its progress
|
void |
updateProgress(WorkerProgress workerProgress)
Workers should call this method to update their progress
|
public static final IntConfOption MAX_ALLOWED_TIME_WITHOUT_PROGRESS_MS
public void init(GiraphConfiguration conf, GiraphJobObserver jobObserver)
JobProgressTrackerService
init
in interface JobProgressTrackerService
conf
- ConfigurationjobObserver
- Giraph job callbacksprotected boolean canFinishInTime(GiraphConfiguration conf, org.apache.hadoop.mapreduce.Job job, CombinedWorkerProgress progress)
conf
- Giraph configurationjob
- Jobprogress
- Combined worker progressprotected boolean killJobWithMessage(String message)
message
- Message describing why job is being killedpublic void setJob(org.apache.hadoop.mapreduce.Job job)
JobProgressTrackerService
setJob
in interface JobProgressTrackerService
job
- Jobprotected void jobGotAllMappers()
public void mapperStarted()
JobProgressTracker
mapperStarted
in interface JobProgressTracker
public void logInfo(String logLine)
JobProgressTracker
logInfo
in interface JobProgressTracker
logLine
- Line to logpublic void logError(String logLine, byte[] exByteArray)
JobProgressTracker
logError
in interface JobProgressTracker
logLine
- Line to logexByteArray
- Exception byte arraypublic void logFailure(String reason)
JobProgressTracker
logFailure
in interface JobProgressTracker
reason
- Reason for failurepublic void updateProgress(WorkerProgress workerProgress)
JobProgressTracker
updateProgress
in interface JobProgressTracker
workerProgress
- Progress of the workerpublic void updateMasterProgress(MasterProgress masterProgress)
JobProgressTracker
updateMasterProgress
in interface JobProgressTracker
masterProgress
- Progress of the masterpublic void sendMasterCounters(GiraphCountersThriftStruct giraphCounters)
JobProgressTracker
sendMasterCounters
in interface JobProgressTracker
giraphCounters
- Giraph-based counterspublic void stop(boolean succeeded)
JobProgressTrackerService
stop
in interface JobProgressTrackerService
succeeded
- Whether job succeeded or notpublic static JobProgressTrackerService createJobProgressTrackerService(GiraphConfiguration conf, GiraphJobObserver jobObserver)
conf
- ConfigurationjobObserver
- Giraph job callbacksCopyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.