CancelScheduledJob
See javadoc - uk.gov.gchq.gaffer.operation.impl.job.CancelScheduledJob
Available since Gaffer version 1.9.0
Cancels a scheduled job specified by the job id
Required fields
The following fields are required:
- jobId
Examples
Scheduled job before being cancelled
Using this directed graph:
--> 4 <--
/ ^ \
/ | \
1 --> 2 --> 3
\
--> 5
Java
JSON
Full JSON
Python
final OperationChain<JobDetail> operationChain = new OperationChain.Builder()
.first(new GetJobDetails.Builder().jobId(jobId).build())
.build();
{
"class" : "OperationChain",
"operations" : [ {
"class" : "GetJobDetails",
"jobId" : "355d3a76-b476-47e2-8bf3-a511e9adfd1e"
} ]
}
{
"class" : "uk.gov.gchq.gaffer.operation.OperationChain",
"operations" : [ {
"class" : "uk.gov.gchq.gaffer.operation.impl.job.GetJobDetails",
"jobId" : "355d3a76-b476-47e2-8bf3-a511e9adfd1e"
} ]
}
g.OperationChain(
operations=[
g.GetJobDetails(
job_id="355d3a76-b476-47e2-8bf3-a511e9adfd1e"
)
]
)
Result:
Java
JSON
JobDetail[jobId=355d3a76-b476-47e2-8bf3-a511e9adfd1e,user=User[userId=user01,dataAuths=[],opAuths=[]],status=SCHEDULED_PARENT,startTime=1665484754771,endTime=1665484754772,opChain=OperationChain[GetAllElements],serialisedOperationChain={"class":"uk.gov.gchq.gaffer.operation.OperationChain","operations":[{"class":"uk.gov.gchq.gaffer.operation.impl.get.GetAllElements","view":{"edges":{"edge":{},"edge1":{}},"entities":{"entity1":{},"entity":{},"cardinality":{}}}}]},repeat=Repeat[initialDelay=1,repeatPeriod=1,timeUnit=MINUTES]]
{
"repeat" : {
"initialDelay" : 1,
"repeatPeriod" : 1,
"timeUnit" : "MINUTES"
},
"jobId" : "355d3a76-b476-47e2-8bf3-a511e9adfd1e",
"user" : {
"userId" : "user01",
"dataAuths" : [ ],
"opAuths" : [ ]
},
"status" : "SCHEDULED_PARENT",
"startTime" : 1665484754771,
"endTime" : 1665484754772,
"opChain" : "OperationChain[GetAllElements]"
}
Cancel scheduled job
Java
JSON
Full JSON
Python
final OperationChain chain = new OperationChain.Builder()
.first(new CancelScheduledJob.Builder()
.jobId(jobId)
.build())
.build();
{
"class" : "OperationChain",
"operations" : [ {
"class" : "CancelScheduledJob",
"jobId" : "355d3a76-b476-47e2-8bf3-a511e9adfd1e"
} ]
}
{
"class" : "uk.gov.gchq.gaffer.operation.OperationChain",
"operations" : [ {
"class" : "uk.gov.gchq.gaffer.operation.impl.job.CancelScheduledJob",
"jobId" : "355d3a76-b476-47e2-8bf3-a511e9adfd1e"
} ]
}
g.OperationChain(
operations=[
g.CancelScheduledJob(
job_id="355d3a76-b476-47e2-8bf3-a511e9adfd1e"
)
]
)
Scheduled job after being cancelled
Using this directed graph:
--> 4 <--
/ ^ \
/ | \
1 --> 2 --> 3
\
--> 5
Java
JSON
Full JSON
Python
final OperationChain<JobDetail> operationChain = new OperationChain.Builder()
.first(new GetJobDetails.Builder().jobId(jobId).build())
.build();
{
"class" : "OperationChain",
"operations" : [ {
"class" : "GetJobDetails",
"jobId" : "355d3a76-b476-47e2-8bf3-a511e9adfd1e"
} ]
}
{
"class" : "uk.gov.gchq.gaffer.operation.OperationChain",
"operations" : [ {
"class" : "uk.gov.gchq.gaffer.operation.impl.job.GetJobDetails",
"jobId" : "355d3a76-b476-47e2-8bf3-a511e9adfd1e"
} ]
}
g.OperationChain(
operations=[
g.GetJobDetails(
job_id="355d3a76-b476-47e2-8bf3-a511e9adfd1e"
)
]
)
Result:
Java
JSON
JobDetail[jobId=355d3a76-b476-47e2-8bf3-a511e9adfd1e,user=User[userId=user01,dataAuths=[],opAuths=[]],status=CANCELLED,startTime=1665484754771,endTime=1665484754772,opChain=OperationChain[GetAllElements],serialisedOperationChain={"class":"uk.gov.gchq.gaffer.operation.OperationChain","operations":[{"class":"uk.gov.gchq.gaffer.operation.impl.get.GetAllElements","view":{"edges":{"edge":{},"edge1":{}},"entities":{"entity1":{},"entity":{},"cardinality":{}}}}]},repeat=Repeat[initialDelay=1,repeatPeriod=1,timeUnit=MINUTES]]
{
"repeat" : {
"initialDelay" : 1,
"repeatPeriod" : 1,
"timeUnit" : "MINUTES"
},
"jobId" : "355d3a76-b476-47e2-8bf3-a511e9adfd1e",
"user" : {
"userId" : "user01",
"dataAuths" : [ ],
"opAuths" : [ ]
},
"status" : "CANCELLED",
"startTime" : 1665484754771,
"endTime" : 1665484754772,
"opChain" : "OperationChain[GetAllElements]"
}