All Downloads are FREE. Search and download functionalities are using the official Maven repository.

marquez.service.models.JobData Maven / Gradle / Ivy

There is a newer version: 0.49.0
Show newest version
/*
 * Copyright 2018-2023 contributors to the Marquez project
 * SPDX-License-Identifier: Apache-2.0
 */

package marquez.service.models;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.google.common.collect.ImmutableSet;
import java.net.URL;
import java.time.Instant;
import java.util.Optional;
import java.util.Set;
import java.util.UUID;
import javax.annotation.Nullable;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NonNull;
import lombok.Setter;
import lombok.ToString;
import marquez.common.models.DatasetId;
import marquez.common.models.JobId;
import marquez.common.models.JobName;
import marquez.common.models.JobType;
import marquez.common.models.NamespaceName;

@Getter
@AllArgsConstructor
@ToString(of = {"namespace", "name", "type"})
public class JobData implements NodeData {
  UUID uuid;
  @NonNull JobId id;
  @NonNull JobType type;
  @NonNull JobName name;
  @NonNull String simpleName;
  @Nullable String parentJobName;
  @NonNull Instant createdAt;
  @NonNull Instant updatedAt;
  @NonNull NamespaceName namespace;
  @Setter ImmutableSet inputs = ImmutableSet.of();
  @Setter ImmutableSet inputUuids = ImmutableSet.of();
  @Setter ImmutableSet outputs = ImmutableSet.of();
  @Setter ImmutableSet outputUuids = ImmutableSet.of();
  @Nullable URL location;
  @Nullable String description;
  @Nullable @Setter Run latestRun;

  public Optional getLocation() {
    return Optional.ofNullable(location);
  }

  public Optional getDescription() {
    return Optional.ofNullable(description);
  }

  public Optional getLatestRun() {
    return Optional.ofNullable(latestRun);
  }

  @JsonIgnore
  public UUID getUuid() {
    return uuid;
  }

  @JsonIgnore
  public Set getInputUuids() {
    return inputUuids;
  }

  @JsonIgnore
  public Set getOutputUuids() {
    return outputUuids;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy