I
- Vertex idV
- Vertex dataE
- Edge datapublic class GraphTaskManager<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable> extends Object implements ResetSuperstepMetricsObserver
Modifier and Type | Class and Description |
---|---|
static interface |
GraphTaskManager.CheckerIfWorkerShouldFailAfterException
Interface to check if worker should fail after a thread gets an exception
|
static class |
GraphTaskManager.FailWithEveryExceptionOccurred
Class to use by default, where each exception causes job failure
|
Modifier and Type | Field and Description |
---|---|
static ClassConfOption<GraphTaskManager.CheckerIfWorkerShouldFailAfterException> |
CHECKER_IF_WORKER_SHOULD_FAIL_AFTER_EXCEPTION_CLASS
Class which checks if an exception on some thread should cause worker
to fail
|
static String |
TIMER_COMMUNICATION_TIME
Name of metric for time from first message till last message flushed
|
static String |
TIMER_COMPUTE_ALL
Name of metric for compute on all vertices in msec
|
static String |
TIMER_SUPERSTEP_GC_TIME
Name of metric for time spent doing GC per superstep in msec
|
static String |
TIMER_SUPERSTEP_TIME
Name of metric for superstep time in msec
|
static String |
TIMER_TIME_TO_FIRST_MSG
Name of metric for time from begin compute to first message sent
|
Constructor and Description |
---|
GraphTaskManager(org.apache.hadoop.mapreduce.Mapper.Context context)
Default constructor for GiraphTaskManager.
|
Modifier and Type | Method and Description |
---|---|
void |
cleanup()
Called by owner of this GraphTaskManager object on each compute node
|
Thread.UncaughtExceptionHandler |
createUncaughtExceptionHandler()
Creates exception handler that will terminate process gracefully in case
of any uncaught exception.
|
Thread.UncaughtExceptionHandler |
createUncaughtExceptionHandler(GraphTaskManager.CheckerIfWorkerShouldFailAfterException checker)
Creates exception handler with the passed implementation of
GraphTaskManager.CheckerIfWorkerShouldFailAfterException . |
void |
execute()
Perform the work assigned to this compute node for this job run.
|
ImmutableClassesGiraphConfiguration<I,V,E> |
getConf() |
GraphFunctions |
getGraphFunctions()
Get the worker function enum.
|
JobProgressTracker |
getJobProgressTracker() |
long |
getSuperstepGCTime() |
WorkerContext |
getWorkerContext() |
String |
getZookeeperList()
Returns a list of zookeeper servers to connect to.
|
static boolean |
isConnectionResetByPeer(Throwable throwable)
Checks the message of a throwable, and checks whether it is a
"connection reset by peer" type of exception.
|
boolean |
isMaster()
Get "isMaster" status flag -- we need to know if we're the master in the
"finally" block of our GiraphYarnTask#execute() to commit final job output.
|
void |
newSuperstep(SuperstepMetricsRegistry superstepMetrics)
Starting a new superstep.
|
void |
notifyFinishedCommunication()
Notification of last message flushed.
|
void |
notifySentMessages()
Notification from Vertex that a message has been sent.
|
void |
sendWorkerCountersAndFinishCleanup()
Method to send the counter values from the worker to the master,
after all supersteps are done, and finish cleanup
|
void |
setIsMaster(boolean im)
Sets the "isMaster" flag for final output commit to happen on master.
|
void |
setup(org.apache.hadoop.fs.Path[] zkPathList)
Called by owner of this GraphTaskManager on each compute node
|
void |
setupMapperObservers()
Setup mapper observers
|
void |
workerFailureCleanup()
Cleanup all of Giraph's framework-agnostic resources
regardless of which type of cluster Giraph is running on.
|
void |
zooKeeperCleanup()
Cleanup a ZooKeeper instance managed by this
GiraphWorker upon job run failure.
|
public static final ClassConfOption<GraphTaskManager.CheckerIfWorkerShouldFailAfterException> CHECKER_IF_WORKER_SHOULD_FAIL_AFTER_EXCEPTION_CLASS
public static final String TIMER_SUPERSTEP_TIME
public static final String TIMER_COMPUTE_ALL
public static final String TIMER_TIME_TO_FIRST_MSG
public static final String TIMER_COMMUNICATION_TIME
public static final String TIMER_SUPERSTEP_GC_TIME
public GraphTaskManager(org.apache.hadoop.mapreduce.Mapper.Context context)
context
- a handle to the underlying cluster framework.
For Hadoop clusters, this is a Mapper#Context.public void setup(org.apache.hadoop.fs.Path[] zkPathList) throws IOException, InterruptedException
zkPathList
- the path to the ZK jars we need to run the jobIOException
InterruptedException
public void execute() throws IOException, InterruptedException
IOException
InterruptedException
public void setIsMaster(boolean im)
im
- the boolean input to set isMaster. Applies to "pure YARN only"public boolean isMaster()
public GraphFunctions getGraphFunctions()
public final WorkerContext getWorkerContext()
public JobProgressTracker getJobProgressTracker()
public void newSuperstep(SuperstepMetricsRegistry superstepMetrics)
ResetSuperstepMetricsObserver
newSuperstep
in interface ResetSuperstepMetricsObserver
superstepMetrics
- SuperstepMetricsRegistry being used.public void notifySentMessages()
public void notifyFinishedCommunication()
public void setupMapperObservers()
public void cleanup() throws IOException, InterruptedException
IOException
InterruptedException
public void sendWorkerCountersAndFinishCleanup()
public void zooKeeperCleanup()
public void workerFailureCleanup()
public Thread.UncaughtExceptionHandler createUncaughtExceptionHandler()
public Thread.UncaughtExceptionHandler createUncaughtExceptionHandler(GraphTaskManager.CheckerIfWorkerShouldFailAfterException checker)
GraphTaskManager.CheckerIfWorkerShouldFailAfterException
.checker
- Instance that checks whether the job should fail.public ImmutableClassesGiraphConfiguration<I,V,E> getConf()
public long getSuperstepGCTime()
public String getZookeeperList()
public static boolean isConnectionResetByPeer(Throwable throwable)
throwable
- ThrowableCopyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.