public class JobEvent extends EventAdapter
Grid events are used for notification about what happens within the grid. Note that by design Ignite keeps all events generated on the local node locally and it provides APIs for performing a distributed queries across multiple nodes:
IgniteEvents.remoteQuery(org.apache.ignite.lang.IgnitePredicate, long, int...)
-
asynchronously querying events occurred on the nodes specified, including remote nodes.
IgniteEvents.localQuery(org.apache.ignite.lang.IgnitePredicate, int...)
- querying only
local events stored on this local node.
IgniteEvents.localListen(org.apache.ignite.lang.IgnitePredicate, int...)
- listening to
local grid events (events from remote nodes not included).
IgniteEvents.waitForLocal(org.apache.ignite.lang.IgnitePredicate,
int...)
.
It is highly recommended to enable only those events that your application logic requires by using IgniteConfiguration.getIncludeEventTypes()
method in Ignite configuration. Note that
certain events are required for Ignite's internal operations and such events will still be generated but not stored
by event storage SPI if they are disabled in Ignite configuration.
EventType.EVT_JOB_CANCELLED
,
EventType.EVT_JOB_FAILED
,
EventType.EVT_JOB_FAILED_OVER
,
EventType.EVT_JOB_FINISHED
,
EventType.EVT_JOB_MAPPED
,
EventType.EVT_JOB_QUEUED
,
EventType.EVT_JOB_REJECTED
,
EventType.EVT_JOB_RESULTED
,
EventType.EVT_JOB_STARTED
,
EventType.EVT_JOB_TIMEDOUT
,
EventType.EVTS_JOB_EXECUTION
,
Serialized FormConstructor and Description |
---|
JobEvent()
No-arg constructor.
|
JobEvent(ClusterNode node,
String msg,
int type)
Creates job event with given parameters.
|
Modifier and Type | Method and Description |
---|---|
IgniteUuid |
jobId()
Gets job ID.
|
void |
jobId(IgniteUuid jobId)
Sets job ID.
|
@Nullable ComputeJobResultPolicy |
resultPolicy()
Gets job result policy.
|
void |
resultPolicy(@Nullable ComputeJobResultPolicy resPlc)
Sets job result policy.
|
String |
shortDisplay()
Gets a shortened version of
toString() result. |
String |
taskClassName()
Gets name of task class that triggered this event.
|
void |
taskClassName(String taskClsName)
Sets name of the task class that triggered this event.
|
String |
taskName()
Gets name of the task that triggered the event.
|
void |
taskName(String taskName)
Sets name of the task that triggered this event.
|
ClusterNode |
taskNode()
Get node where parent task of the job has originated.
|
void |
taskNode(ClusterNode taskNode)
Sets node where parent task of the job has originated.
|
IgniteUuid |
taskSessionId()
Gets task session ID of the task that triggered this event.
|
void |
taskSessionId(IgniteUuid sesId)
Sets task session ID of the task that triggered this event.
|
UUID |
taskSubjectId()
Gets task subject ID.
|
void |
taskSubjectId(UUID taskSubjId)
Sets task subject ID.
|
String |
toString() |
public JobEvent()
public JobEvent(ClusterNode node, String msg, int type)
node
- Node.msg
- Optional message.type
- Event type.public String shortDisplay()
toString()
result. Suitable for humans to read.shortDisplay
in interface Event
shortDisplay
in class EventAdapter
toString()
result.public String taskName()
public String taskClassName()
public IgniteUuid taskSessionId()
public IgniteUuid jobId()
public void taskName(String taskName)
taskName
- Task name to set.public void taskClassName(String taskClsName)
taskClsName
- Task class name to set.public void taskSessionId(IgniteUuid sesId)
sesId
- Task session ID to set.public void jobId(IgniteUuid jobId)
jobId
- Job ID to set.public ClusterNode taskNode()
public void taskNode(ClusterNode taskNode)
taskNode
- Node where parent task of the job has originated.public UUID taskSubjectId()
public void taskSubjectId(UUID taskSubjId)
taskSubjId
- Task subject ID.@Nullable public @Nullable ComputeJobResultPolicy resultPolicy()
EventType.EVT_JOB_RESULTED
and EventType.EVT_JOB_FAILED_OVER
event types.public void resultPolicy(@Nullable @Nullable ComputeJobResultPolicy resPlc)
resPlc
- New result policy.public String toString()
toString
in class EventAdapter
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.16.0 Release Date : December 15 2023