| 25 | import marquez.common.models.NamespaceName; |
| 26 | |
| 27 | @Getter |
| 28 | @AllArgsConstructor |
| 29 | @ToString(of = {"namespace", "name", "type"}) |
| 30 | public class JobData implements NodeData { |
| 31 | UUID uuid; |
| 32 | @NonNull JobId id; |
| 33 | @NonNull JobType type; |
| 34 | @NonNull JobName name; |
| 35 | @NonNull String simpleName; |
| 36 | @Nullable String parentJobName; |
| 37 | @Nullable UUID parentJobUuid; |
| 38 | @Getter @Nullable UUID currentRunUuid; |
| 39 | @NonNull Instant createdAt; |
| 40 | @NonNull Instant updatedAt; |
| 41 | @NonNull NamespaceName namespace; |
| 42 | @Setter ImmutableSet<DatasetId> inputs = ImmutableSet.of(); |
| 43 | @Setter ImmutableSet<UUID> inputUuids = ImmutableSet.of(); |
| 44 | @Setter ImmutableSet<DatasetId> outputs = ImmutableSet.of(); |
| 45 | @Setter ImmutableSet<UUID> outputUuids = ImmutableSet.of(); |
| 46 | @Nullable URL location; |
| 47 | @Nullable String description; |
| 48 | @Nullable @Setter Run latestRun; |
| 49 | |
| 50 | public Optional<URL> getLocation() { |
| 51 | return Optional.ofNullable(location); |
| 52 | } |
| 53 | |
| 54 | public Optional<String> getDescription() { |
| 55 | return Optional.ofNullable(description); |
| 56 | } |
| 57 | |
| 58 | public Optional<Run> getLatestRun() { |
| 59 | return Optional.ofNullable(latestRun); |
| 60 | } |
| 61 | |
| 62 | @JsonIgnore |
| 63 | public UUID getUuid() { |
| 64 | return uuid; |
| 65 | } |
| 66 | |
| 67 | @JsonIgnore |
| 68 | public Set<UUID> getInputUuids() { |
| 69 | return inputUuids; |
| 70 | } |
| 71 | |
| 72 | @JsonIgnore |
| 73 | public Set<UUID> getOutputUuids() { |
| 74 | return outputUuids; |
| 75 | } |
| 76 | |
| 77 | public UUID getParentJobUuid() { |
| 78 | return parentJobUuid; |
| 79 | } |
| 80 | } |