com.databricks.sdk.service.jobs.Run Maven / Gradle / Ivy
// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT.
package com.databricks.sdk.service.jobs;
import com.databricks.sdk.support.Generated;
import com.databricks.sdk.support.ToStringer;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Collection;
import java.util.Objects;
/** Run was retrieved successfully */
@Generated
public class Run {
/**
* The sequence number of this run attempt for a triggered job run. The initial attempt of a run
* has an attempt_number of 0. If the initial run attempt fails, and the job has a retry policy
* (`max_retries` > 0), subsequent runs are created with an `original_attempt_run_id` of the
* original attempt’s ID and an incrementing `attempt_number`. Runs are retried only until they
* succeed, and the maximum `attempt_number` is the same as the `max_retries` value for the job.
*/
@JsonProperty("attempt_number")
private Long attemptNumber;
/**
* The time in milliseconds it took to terminate the cluster and clean up any associated
* artifacts. The duration of a task run is the sum of the `setup_duration`, `execution_duration`,
* and the `cleanup_duration`. The `cleanup_duration` field is set to 0 for multitask job runs.
* The total duration of a multitask job run is the value of the `run_duration` field.
*/
@JsonProperty("cleanup_duration")
private Long cleanupDuration;
/**
* The cluster used for this run. If the run is specified to use a new cluster, this field is set
* once the Jobs service has requested a cluster for the run.
*/
@JsonProperty("cluster_instance")
private ClusterInstance clusterInstance;
/** A snapshot of the job’s cluster specification when this run was created. */
@JsonProperty("cluster_spec")
private ClusterSpec clusterSpec;
/**
* The creator user name. This field won’t be included in the response if the user has already
* been deleted.
*/
@JsonProperty("creator_user_name")
private String creatorUserName;
/** Description of the run */
@JsonProperty("description")
private String description;
/**
* The time at which this run ended in epoch milliseconds (milliseconds since 1/1/1970 UTC). This
* field is set to 0 if the job is still running.
*/
@JsonProperty("end_time")
private Long endTime;
/**
* The time in milliseconds it took to execute the commands in the JAR or notebook until they
* completed, failed, timed out, were cancelled, or encountered an unexpected error. The duration
* of a task run is the sum of the `setup_duration`, `execution_duration`, and the
* `cleanup_duration`. The `execution_duration` field is set to 0 for multitask job runs. The
* total duration of a multitask job run is the value of the `run_duration` field.
*/
@JsonProperty("execution_duration")
private Long executionDuration;
/**
* An optional specification for a remote Git repository containing the source code used by tasks.
* Version-controlled source code is supported by notebook, dbt, Python script, and SQL File
* tasks.
*
* If `git_source` is set, these tasks retrieve the file from the remote repository by default.
* However, this behavior can be overridden by setting `source` to `WORKSPACE` on the task.
*
*
Note: dbt and SQL File tasks support only version-controlled sources. If dbt or SQL File
* tasks are used, `git_source` must be defined on the job.
*/
@JsonProperty("git_source")
private GitSource gitSource;
/** Only populated by for-each iterations. The parent for-each task is located in tasks array. */
@JsonProperty("iterations")
private Collection iterations;
/**
* A list of job cluster specifications that can be shared and reused by tasks of this job.
* Libraries cannot be declared in a shared job cluster. You must declare dependent libraries in
* task settings.
*/
@JsonProperty("job_clusters")
private Collection jobClusters;
/** The canonical identifier of the job that contains this run. */
@JsonProperty("job_id")
private Long jobId;
/** Job-level parameters used in the run */
@JsonProperty("job_parameters")
private Collection jobParameters;
/**
* ID of the job run that this run belongs to. For legacy and single-task job runs the field is
* populated with the job run ID. For task runs, the field is populated with the ID of the job run
* that the task run belongs to.
*/
@JsonProperty("job_run_id")
private Long jobRunId;
/** A token that can be used to list the next page of sub-resources. */
@JsonProperty("next_page_token")
private String nextPageToken;
/** A unique identifier for this job run. This is set to the same value as `run_id`. */
@JsonProperty("number_in_job")
private Long numberInJob;
/**
* If this run is a retry of a prior run attempt, this field contains the run_id of the original
* attempt; otherwise, it is the same as the run_id.
*/
@JsonProperty("original_attempt_run_id")
private Long originalAttemptRunId;
/** The parameters used for this run. */
@JsonProperty("overriding_parameters")
private RunParameters overridingParameters;
/** A token that can be used to list the previous page of sub-resources. */
@JsonProperty("prev_page_token")
private String prevPageToken;
/** The time in milliseconds that the run has spent in the queue. */
@JsonProperty("queue_duration")
private Long queueDuration;
/** The repair history of the run. */
@JsonProperty("repair_history")
private Collection repairHistory;
/** The time in milliseconds it took the job run and all of its repairs to finish. */
@JsonProperty("run_duration")
private Long runDuration;
/** The canonical identifier of the run. This ID is unique across all runs of all jobs. */
@JsonProperty("run_id")
private Long runId;
/** An optional name for the run. The maximum length is 4096 bytes in UTF-8 encoding. */
@JsonProperty("run_name")
private String runName;
/** The URL to the detail page of the run. */
@JsonProperty("run_page_url")
private String runPageUrl;
/**
* The type of a run. * `JOB_RUN`: Normal job run. A run created with :method:jobs/runNow. *
* `WORKFLOW_RUN`: Workflow run. A run created with [dbutils.notebook.run]. * `SUBMIT_RUN`: Submit
* run. A run created with :method:jobs/submit.
*
* [dbutils.notebook.run]:
* https://docs.databricks.com/dev-tools/databricks-utils.html#dbutils-workflow
*/
@JsonProperty("run_type")
private RunType runType;
/** The cron schedule that triggered this run if it was triggered by the periodic scheduler. */
@JsonProperty("schedule")
private CronSchedule schedule;
/**
* The time in milliseconds it took to set up the cluster. For runs that run on new clusters this
* is the cluster creation time, for runs that run on existing clusters this time should be very
* short. The duration of a task run is the sum of the `setup_duration`, `execution_duration`, and
* the `cleanup_duration`. The `setup_duration` field is set to 0 for multitask job runs. The
* total duration of a multitask job run is the value of the `run_duration` field.
*/
@JsonProperty("setup_duration")
private Long setupDuration;
/**
* The time at which this run was started in epoch milliseconds (milliseconds since 1/1/1970 UTC).
* This may not be the time when the job task starts executing, for example, if the job is
* scheduled to run on a new cluster, this is the time the cluster creation call is issued.
*/
@JsonProperty("start_time")
private Long startTime;
/** Deprecated. Please use the `status` field instead. */
@JsonProperty("state")
private RunState state;
/** The current status of the run */
@JsonProperty("status")
private RunStatus status;
/**
* The list of tasks performed by the run. Each task has its own `run_id` which you can use to
* call `JobsGetOutput` to retrieve the run resutls.
*/
@JsonProperty("tasks")
private Collection tasks;
/**
* The type of trigger that fired this run.
*
* * `PERIODIC`: Schedules that periodically trigger runs, such as a cron scheduler. *
* `ONE_TIME`: One time triggers that fire a single run. This occurs you triggered a single run on
* demand through the UI or the API. * `RETRY`: Indicates a run that is triggered as a retry of a
* previously failed run. This occurs when you request to re-run the job in case of failures. *
* `RUN_JOB_TASK`: Indicates a run that is triggered using a Run Job task. * `FILE_ARRIVAL`:
* Indicates a run that is triggered by a file arrival. * `TABLE`: Indicates a run that is
* triggered by a table update.
*/
@JsonProperty("trigger")
private TriggerType trigger;
/** Additional details about what triggered the run */
@JsonProperty("trigger_info")
private TriggerInfo triggerInfo;
public Run setAttemptNumber(Long attemptNumber) {
this.attemptNumber = attemptNumber;
return this;
}
public Long getAttemptNumber() {
return attemptNumber;
}
public Run setCleanupDuration(Long cleanupDuration) {
this.cleanupDuration = cleanupDuration;
return this;
}
public Long getCleanupDuration() {
return cleanupDuration;
}
public Run setClusterInstance(ClusterInstance clusterInstance) {
this.clusterInstance = clusterInstance;
return this;
}
public ClusterInstance getClusterInstance() {
return clusterInstance;
}
public Run setClusterSpec(ClusterSpec clusterSpec) {
this.clusterSpec = clusterSpec;
return this;
}
public ClusterSpec getClusterSpec() {
return clusterSpec;
}
public Run setCreatorUserName(String creatorUserName) {
this.creatorUserName = creatorUserName;
return this;
}
public String getCreatorUserName() {
return creatorUserName;
}
public Run setDescription(String description) {
this.description = description;
return this;
}
public String getDescription() {
return description;
}
public Run setEndTime(Long endTime) {
this.endTime = endTime;
return this;
}
public Long getEndTime() {
return endTime;
}
public Run setExecutionDuration(Long executionDuration) {
this.executionDuration = executionDuration;
return this;
}
public Long getExecutionDuration() {
return executionDuration;
}
public Run setGitSource(GitSource gitSource) {
this.gitSource = gitSource;
return this;
}
public GitSource getGitSource() {
return gitSource;
}
public Run setIterations(Collection iterations) {
this.iterations = iterations;
return this;
}
public Collection getIterations() {
return iterations;
}
public Run setJobClusters(Collection jobClusters) {
this.jobClusters = jobClusters;
return this;
}
public Collection getJobClusters() {
return jobClusters;
}
public Run setJobId(Long jobId) {
this.jobId = jobId;
return this;
}
public Long getJobId() {
return jobId;
}
public Run setJobParameters(Collection jobParameters) {
this.jobParameters = jobParameters;
return this;
}
public Collection getJobParameters() {
return jobParameters;
}
public Run setJobRunId(Long jobRunId) {
this.jobRunId = jobRunId;
return this;
}
public Long getJobRunId() {
return jobRunId;
}
public Run setNextPageToken(String nextPageToken) {
this.nextPageToken = nextPageToken;
return this;
}
public String getNextPageToken() {
return nextPageToken;
}
public Run setNumberInJob(Long numberInJob) {
this.numberInJob = numberInJob;
return this;
}
public Long getNumberInJob() {
return numberInJob;
}
public Run setOriginalAttemptRunId(Long originalAttemptRunId) {
this.originalAttemptRunId = originalAttemptRunId;
return this;
}
public Long getOriginalAttemptRunId() {
return originalAttemptRunId;
}
public Run setOverridingParameters(RunParameters overridingParameters) {
this.overridingParameters = overridingParameters;
return this;
}
public RunParameters getOverridingParameters() {
return overridingParameters;
}
public Run setPrevPageToken(String prevPageToken) {
this.prevPageToken = prevPageToken;
return this;
}
public String getPrevPageToken() {
return prevPageToken;
}
public Run setQueueDuration(Long queueDuration) {
this.queueDuration = queueDuration;
return this;
}
public Long getQueueDuration() {
return queueDuration;
}
public Run setRepairHistory(Collection repairHistory) {
this.repairHistory = repairHistory;
return this;
}
public Collection getRepairHistory() {
return repairHistory;
}
public Run setRunDuration(Long runDuration) {
this.runDuration = runDuration;
return this;
}
public Long getRunDuration() {
return runDuration;
}
public Run setRunId(Long runId) {
this.runId = runId;
return this;
}
public Long getRunId() {
return runId;
}
public Run setRunName(String runName) {
this.runName = runName;
return this;
}
public String getRunName() {
return runName;
}
public Run setRunPageUrl(String runPageUrl) {
this.runPageUrl = runPageUrl;
return this;
}
public String getRunPageUrl() {
return runPageUrl;
}
public Run setRunType(RunType runType) {
this.runType = runType;
return this;
}
public RunType getRunType() {
return runType;
}
public Run setSchedule(CronSchedule schedule) {
this.schedule = schedule;
return this;
}
public CronSchedule getSchedule() {
return schedule;
}
public Run setSetupDuration(Long setupDuration) {
this.setupDuration = setupDuration;
return this;
}
public Long getSetupDuration() {
return setupDuration;
}
public Run setStartTime(Long startTime) {
this.startTime = startTime;
return this;
}
public Long getStartTime() {
return startTime;
}
public Run setState(RunState state) {
this.state = state;
return this;
}
public RunState getState() {
return state;
}
public Run setStatus(RunStatus status) {
this.status = status;
return this;
}
public RunStatus getStatus() {
return status;
}
public Run setTasks(Collection tasks) {
this.tasks = tasks;
return this;
}
public Collection getTasks() {
return tasks;
}
public Run setTrigger(TriggerType trigger) {
this.trigger = trigger;
return this;
}
public TriggerType getTrigger() {
return trigger;
}
public Run setTriggerInfo(TriggerInfo triggerInfo) {
this.triggerInfo = triggerInfo;
return this;
}
public TriggerInfo getTriggerInfo() {
return triggerInfo;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Run that = (Run) o;
return Objects.equals(attemptNumber, that.attemptNumber)
&& Objects.equals(cleanupDuration, that.cleanupDuration)
&& Objects.equals(clusterInstance, that.clusterInstance)
&& Objects.equals(clusterSpec, that.clusterSpec)
&& Objects.equals(creatorUserName, that.creatorUserName)
&& Objects.equals(description, that.description)
&& Objects.equals(endTime, that.endTime)
&& Objects.equals(executionDuration, that.executionDuration)
&& Objects.equals(gitSource, that.gitSource)
&& Objects.equals(iterations, that.iterations)
&& Objects.equals(jobClusters, that.jobClusters)
&& Objects.equals(jobId, that.jobId)
&& Objects.equals(jobParameters, that.jobParameters)
&& Objects.equals(jobRunId, that.jobRunId)
&& Objects.equals(nextPageToken, that.nextPageToken)
&& Objects.equals(numberInJob, that.numberInJob)
&& Objects.equals(originalAttemptRunId, that.originalAttemptRunId)
&& Objects.equals(overridingParameters, that.overridingParameters)
&& Objects.equals(prevPageToken, that.prevPageToken)
&& Objects.equals(queueDuration, that.queueDuration)
&& Objects.equals(repairHistory, that.repairHistory)
&& Objects.equals(runDuration, that.runDuration)
&& Objects.equals(runId, that.runId)
&& Objects.equals(runName, that.runName)
&& Objects.equals(runPageUrl, that.runPageUrl)
&& Objects.equals(runType, that.runType)
&& Objects.equals(schedule, that.schedule)
&& Objects.equals(setupDuration, that.setupDuration)
&& Objects.equals(startTime, that.startTime)
&& Objects.equals(state, that.state)
&& Objects.equals(status, that.status)
&& Objects.equals(tasks, that.tasks)
&& Objects.equals(trigger, that.trigger)
&& Objects.equals(triggerInfo, that.triggerInfo);
}
@Override
public int hashCode() {
return Objects.hash(
attemptNumber,
cleanupDuration,
clusterInstance,
clusterSpec,
creatorUserName,
description,
endTime,
executionDuration,
gitSource,
iterations,
jobClusters,
jobId,
jobParameters,
jobRunId,
nextPageToken,
numberInJob,
originalAttemptRunId,
overridingParameters,
prevPageToken,
queueDuration,
repairHistory,
runDuration,
runId,
runName,
runPageUrl,
runType,
schedule,
setupDuration,
startTime,
state,
status,
tasks,
trigger,
triggerInfo);
}
@Override
public String toString() {
return new ToStringer(Run.class)
.add("attemptNumber", attemptNumber)
.add("cleanupDuration", cleanupDuration)
.add("clusterInstance", clusterInstance)
.add("clusterSpec", clusterSpec)
.add("creatorUserName", creatorUserName)
.add("description", description)
.add("endTime", endTime)
.add("executionDuration", executionDuration)
.add("gitSource", gitSource)
.add("iterations", iterations)
.add("jobClusters", jobClusters)
.add("jobId", jobId)
.add("jobParameters", jobParameters)
.add("jobRunId", jobRunId)
.add("nextPageToken", nextPageToken)
.add("numberInJob", numberInJob)
.add("originalAttemptRunId", originalAttemptRunId)
.add("overridingParameters", overridingParameters)
.add("prevPageToken", prevPageToken)
.add("queueDuration", queueDuration)
.add("repairHistory", repairHistory)
.add("runDuration", runDuration)
.add("runId", runId)
.add("runName", runName)
.add("runPageUrl", runPageUrl)
.add("runType", runType)
.add("schedule", schedule)
.add("setupDuration", setupDuration)
.add("startTime", startTime)
.add("state", state)
.add("status", status)
.add("tasks", tasks)
.add("trigger", trigger)
.add("triggerInfo", triggerInfo)
.toString();
}
}