Class PlatformAbstractJob
- java.lang.Object
-
- org.apache.ignite.internal.processors.platform.compute.PlatformAbstractJob
-
- All Implemented Interfaces:
Externalizable,Serializable,ComputeJob,PlatformSecurityAwareJob,PlatformJob
- Direct Known Subclasses:
PlatformClosureJob,PlatformFullJob
public abstract class PlatformAbstractJob extends Object implements PlatformJob, Externalizable
Base interop job.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected IgniteigniteIgnite instance.protected ObjectjobJob.protected StringjobNameJob name.protected longptrPointer to job in the native platform.protected PlatformAbstractTasktaskParent task; present only on local job instance.
-
Constructor Summary
Constructors Modifier Constructor Description protectedPlatformAbstractJob()Externalizablesupport.protectedPlatformAbstractJob(PlatformAbstractTask task, long ptr, Object job, String jobName)Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected booleancreateJob(PlatformContext ctx)Create job in native platform if needed.@Nullable Objectexecute()Executes this job.protected abstract Objectexecute0(PlatformContext ctx)Internal job execution routine.Objectjob()Gets native job.Stringname()longpointer()Gets native pointer to deployed job.protected ObjectrunLocal(PlatformContext ctx, boolean cancel, PlatformTargetProxy ses)Run local job.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.ignite.compute.ComputeJob
cancel
-
Methods inherited from interface java.io.Externalizable
readExternal, writeExternal
-
-
-
-
Field Detail
-
ignite
@IgniteInstanceResource protected transient Ignite ignite
Ignite instance.
-
task
protected transient PlatformAbstractTask task
Parent task; present only on local job instance.
-
ptr
protected transient long ptr
Pointer to job in the native platform.
-
job
protected Object job
Job.
-
jobName
protected String jobName
Job name.
-
-
Constructor Detail
-
PlatformAbstractJob
protected PlatformAbstractJob()
Externalizablesupport.
-
PlatformAbstractJob
protected PlatformAbstractJob(PlatformAbstractTask task, long ptr, Object job, String jobName)
Constructor.- Parameters:
task- Parent task.ptr- Pointer.job- Job.jobName- Job name.
-
-
Method Detail
-
execute
@Nullable public @Nullable Object execute()
Executes this job.- Specified by:
executein interfaceComputeJob- Returns:
- Job execution result (possibly
null). This result will be returned inComputeJobResult.getData()method passed intoComputeTask.result(ComputeJobResult, List)task method on caller node.
-
execute0
protected abstract Object execute0(PlatformContext ctx) throws IgniteCheckedException
Internal job execution routine.- Parameters:
ctx- Interop processor.- Returns:
- Result.
- Throws:
IgniteCheckedException- If failed.
-
createJob
protected boolean createJob(PlatformContext ctx) throws IgniteCheckedException
Create job in native platform if needed.- Parameters:
ctx- Context.- Returns:
Trueif job was created,falseif this is local job and creation is not necessary.- Throws:
IgniteCheckedException- If failed.
-
runLocal
protected Object runLocal(PlatformContext ctx, boolean cancel, PlatformTargetProxy ses)
Run local job.- Parameters:
ctx- Context.cancel- Cancel flag.ses- Platform compute task session proxy.- Returns:
- Result.
-
pointer
public long pointer()
Gets native pointer to deployed job.- Specified by:
pointerin interfacePlatformJob- Returns:
- Pointer.
-
job
public Object job()
Gets native job.- Specified by:
jobin interfacePlatformJob- Returns:
- Native job.
-
name
public String name()
- Specified by:
namein interfacePlatformSecurityAwareJob- Returns:
- The name of the Platform Compute Job that will be used when authorizing its start and cancellation.
-
-