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" : "9544d401-d20b-4c11-a62b-083570f9ce92"
  } ]
}
{
  "class" : "uk.gov.gchq.gaffer.operation.OperationChain",
  "operations" : [ {
    "class" : "uk.gov.gchq.gaffer.operation.impl.job.GetJobDetails",
    "jobId" : "9544d401-d20b-4c11-a62b-083570f9ce92"
  } ]
}
g.OperationChain( 
  operations=[ 
    g.GetJobDetails( 
      job_id="9544d401-d20b-4c11-a62b-083570f9ce92" 
    ) 
  ] 
)

Result:

Java
JSON
JobDetail[jobId=9544d401-d20b-4c11-a62b-083570f9ce92,user=User[userId=user01,dataAuths=[],opAuths=[]],status=SCHEDULED_PARENT,startTime=1620991715678,endTime=1620991715679,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" : "9544d401-d20b-4c11-a62b-083570f9ce92",
  "user" : {
    "userId" : "user01",
    "dataAuths" : [ ],
    "opAuths" : [ ]
  },
  "status" : "SCHEDULED_PARENT",
  "startTime" : 1620991715678,
  "endTime" : 1620991715679,
  "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" : "9544d401-d20b-4c11-a62b-083570f9ce92"
  } ]
}
{
  "class" : "uk.gov.gchq.gaffer.operation.OperationChain",
  "operations" : [ {
    "class" : "uk.gov.gchq.gaffer.operation.impl.job.CancelScheduledJob",
    "jobId" : "9544d401-d20b-4c11-a62b-083570f9ce92"
  } ]
}
g.OperationChain( 
  operations=[ 
    g.CancelScheduledJob( 
      job_id="9544d401-d20b-4c11-a62b-083570f9ce92" 
    ) 
  ] 
)


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" : "9544d401-d20b-4c11-a62b-083570f9ce92"
  } ]
}
{
  "class" : "uk.gov.gchq.gaffer.operation.OperationChain",
  "operations" : [ {
    "class" : "uk.gov.gchq.gaffer.operation.impl.job.GetJobDetails",
    "jobId" : "9544d401-d20b-4c11-a62b-083570f9ce92"
  } ]
}
g.OperationChain( 
  operations=[ 
    g.GetJobDetails( 
      job_id="9544d401-d20b-4c11-a62b-083570f9ce92" 
    ) 
  ] 
)

Result:

Java
JSON
JobDetail[jobId=9544d401-d20b-4c11-a62b-083570f9ce92,user=User[userId=user01,dataAuths=[],opAuths=[]],status=CANCELLED,startTime=1620991715678,endTime=1620991715679,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" : "9544d401-d20b-4c11-a62b-083570f9ce92",
  "user" : {
    "userId" : "user01",
    "dataAuths" : [ ],
    "opAuths" : [ ]
  },
  "status" : "CANCELLED",
  "startTime" : 1620991715678,
  "endTime" : 1620991715679,
  "opChain" : "OperationChain[GetAllElements]"
}


results matching ""

    No results matching ""