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" : "a3786c5e-98d0-4811-85d9-d84d90eb2633"
  } ]
}
{
  "class" : "uk.gov.gchq.gaffer.operation.OperationChain",
  "operations" : [ {
    "class" : "uk.gov.gchq.gaffer.operation.impl.job.GetJobDetails",
    "jobId" : "a3786c5e-98d0-4811-85d9-d84d90eb2633"
  } ]
}
g.OperationChain( 
  operations=[ 
    g.GetJobDetails( 
      job_id="a3786c5e-98d0-4811-85d9-d84d90eb2633" 
    ) 
  ] 
)

Result:

Java
JSON
JobDetail[jobId=a3786c5e-98d0-4811-85d9-d84d90eb2633,userId=user01,status=SCHEDULED_PARENT,startTime=1557749958710,endTime=1557749958712,opChain=OperationChain[GetAllElements],repeat=Repeat[initialDelay=1,repeatPeriod=1,timeUnit=MINUTES]]
{
  "repeat" : {
    "initialDelay" : 1,
    "repeatPeriod" : 1,
    "timeUnit" : "MINUTES"
  },
  "jobId" : "a3786c5e-98d0-4811-85d9-d84d90eb2633",
  "userId" : "user01",
  "status" : "SCHEDULED_PARENT",
  "startTime" : 1557749958710,
  "endTime" : 1557749958712,
  "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" : "a3786c5e-98d0-4811-85d9-d84d90eb2633"
  } ]
}
{
  "class" : "uk.gov.gchq.gaffer.operation.OperationChain",
  "operations" : [ {
    "class" : "uk.gov.gchq.gaffer.operation.impl.job.CancelScheduledJob",
    "jobId" : "a3786c5e-98d0-4811-85d9-d84d90eb2633"
  } ]
}
g.OperationChain( 
  operations=[ 
    g.CancelScheduledJob( 
      job_id="a3786c5e-98d0-4811-85d9-d84d90eb2633" 
    ) 
  ] 
)


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" : "a3786c5e-98d0-4811-85d9-d84d90eb2633"
  } ]
}
{
  "class" : "uk.gov.gchq.gaffer.operation.OperationChain",
  "operations" : [ {
    "class" : "uk.gov.gchq.gaffer.operation.impl.job.GetJobDetails",
    "jobId" : "a3786c5e-98d0-4811-85d9-d84d90eb2633"
  } ]
}
g.OperationChain( 
  operations=[ 
    g.GetJobDetails( 
      job_id="a3786c5e-98d0-4811-85d9-d84d90eb2633" 
    ) 
  ] 
)

Result:

Java
JSON
JobDetail[jobId=a3786c5e-98d0-4811-85d9-d84d90eb2633,userId=user01,status=CANCELLED,startTime=1557749958710,endTime=1557749958712,opChain=OperationChain[GetAllElements],repeat=Repeat[initialDelay=1,repeatPeriod=1,timeUnit=MINUTES]]
{
  "repeat" : {
    "initialDelay" : 1,
    "repeatPeriod" : 1,
    "timeUnit" : "MINUTES"
  },
  "jobId" : "a3786c5e-98d0-4811-85d9-d84d90eb2633",
  "userId" : "user01",
  "status" : "CANCELLED",
  "startTime" : 1557749958710,
  "endTime" : 1557749958712,
  "opChain" : "OperationChain[GetAllElements]"
}


results matching ""

    No results matching ""