|
GridGain 2.1.0
Java API Specification |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
@Apache20LicenseCompatible public interface GridJob
Defines executable unit for GridTask.
GridTask. Grid task gets split into jobs
when GridTask.map(List, Object) method is called. This method returns
all jobs for the task mapped to their corresponding grid nodes for execution. Grid
will then serialize this jobs and send them to requested nodes for execution.
When a node receives a request to execute a job, the following sequence of events
takes place:
GridCollisionSpi SPI.
GridJobResult passed into
GridTask.result(GridJobResult, List) method will contain
GridExecutionRejectedException exception. If you are using any
of the task adapters shipped with GridGain, then job will be failed
over automatically for execution on another node.
GridTaskSession)
will be injected.
GridJob.execute() method.
GridJob.cancel()
method will be called. Note that just like with Thread.interrupt()
method, grid job cancellation serves as a hint that a job should stop
executing or exhibit some other user defined behavior. Generally it is
up to a job to decide whether it wants to react to cancellation or
ignore it. Job cancellation can happen for several reasons:
GridTaskFuture.cancel() method.GridTask.result(GridJobResult, List)
method via GridJobResult instance. If job execution resulted
in a checked exception, then GridJobResult.getException() method
will contain that exception. If job execution threw a runtime exception
or error, then it will be wrapped into GridUserUndeclaredException
exception.
GridTaskSessionResourceGridJobContextResourceGridInstanceResourceGridLoggerResourceGridHomeResourceGridExecutorServiceResourceGridLocalNodeIdResourceGridMBeanServerResourceGridMarshallerResourceGridSpringApplicationContextResourceGridSpringResource
GridJobAdapter adapter that provides
default empty implementation for GridJob.cancel() method and also
allows user to set and get job argument, if there is one.
GridTaskSession). Other jobs
can wait for an attribute to be set either synchronously or asynchronously.
Such functionality allows jobs to synchronize their execution with other jobs
at any point and can be useful when other jobs within task need to be made aware
of certain event or state change that occurred during job execution.
Distributed task session can be injected into GridJob implementation
using @GridTaskSessionResource annotation.
Both, field and method based injections are supported. Refer to
GridTaskSession documentation for more information on session functionality.
GridTaskSession.saveCheckpoint(String, Serializable, GridCheckpointScope, long)GridTaskSession.loadCheckpoint(String)GridTaskSession.removeCheckpoint(String)
Documentation
Email Support
Online Forums
Issue Tracking
Author: 2005-2008 Copyright © GridGain Systems. All Rights Reserved. ver. 2.1.0

| Method Summary | |
|---|---|
void |
cancel()
This method is called when when system detects that completion of this job can no longer alter the overall outcome (for example, when parent task has already reduced the results). |
Serializable |
execute()
Executes this job. |
| Method Detail |
|---|
void cancel()
GridTaskFuture.cancel() is called.
Note that job cancellation is only a hint, and just like with
Thread.interrupt() method, it is really upto the actual job
instance to gracefully finish execution and exit.
Serializable execute()
throws GridException
GridException - If job execution caused an exception. This exception will be
returned in GridJobResult.getException() method passed into
GridTask.result(GridJobResult, List) method into task on caller node.
If execution produces a RuntimeException or Error, then
it will be wrapped into GridException.
GridJobResult.getData() method passed into
GridTask.result(GridJobResult, List) method into task on caller node.
|
GridGain 2.1.0
Java API Specification |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
|
GridGain - Grid Computing Made Simple, ver. 2.1.0.19122008
2005-2008 Copyright © GridGain Systems. All Rights Reserved. |
|
|