xgt.Job

class xgt.Job(conn, job_id)

Represents a user-scheduled Job.

An instance of this object is created by job-scheduling functions like xgt.Connection.run_job and xgt.Connection.schedule_job.

A Job is used as a proxy for a job in the server and allows the user to monitor its execution, possibly cancel it, and learn about its status during and after execution.

__init__(conn, job_id)

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(conn, job_id)

Initialize self.

Attributes

end_time

Date and time when the job finished running.

error

User-friendly error message describing the reason a job failed.

error_type

Class that belongs to the XgtError hierarchy that corresponds to the original exception type thrown and caused the Job to fail.

id

Identifier of the job.

start_time

Date and time when the job was scheduled.

status

Status of the job.

trace

Very detailed error message for a failed job.

visited_edges

A 64-bit integer giving the number of edges visited during the job.

property end_time

Date and time when the job finished running.

This is a formatted string that has a resolution of seconds.

Type

str

property error

User-friendly error message describing the reason a job failed.

Type

str

property error_type

Class that belongs to the XgtError hierarchy that corresponds to the original exception type thrown and caused the Job to fail.

Type

object

property id

Identifier of the job.

A 64-bit integer value that uniquely identifies a job. It is automatically incremented for each scheduled job over the lifetime of the xgtd server process.

Type

int

property start_time

Date and time when the job was scheduled.

This is a formatted string that has a resolution of seconds.

Type

str

property status

Status of the job.

Job status

Status

Description

scheduled

The state after the job has been created, but before it has started running.

running

The job is being executed.

completed

The job finished successfully.

canceled

The job was canceled.

failed

The job failed. When the job fails the error and trace properties are populated.

rollback

The job had a transactional conflict with another job and was rolled back.

Type

str

property trace

Very detailed error message for a failed job.

This error message contains the friendly error message and a stack strace for the code that participated in the error.

Type

str

property visited_edges

A 64-bit integer giving the number of edges visited during the job.

If the configuration variable stats.job_stats is not set to true, then the value returned is always 0.

Type

int