Skip to content

Commit

Permalink
add task domain to the index (Netflix#3188)
Browse files Browse the repository at this point in the history
  • Loading branch information
apanicker-nflx authored Aug 19, 2022
1 parent ed3f5da commit ae10047
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ public class TaskSummary {
@ProtoField(id = 19)
private int workflowPriority;

@ProtoField(id = 20)
private String domain;

public TaskSummary() {}

public TaskSummary(Task task) {
Expand All @@ -109,6 +112,7 @@ public TaskSummary(Task task) {
this.status = task.getStatus();
this.reasonForIncompletion = task.getReasonForIncompletion();
this.queueWaitTime = task.getQueueWaitTime();
this.domain = task.getDomain();
if (task.getInputData() != null) {
this.input = SummaryUtil.serializeInputOutput(task.getInputData());
}
Expand Down Expand Up @@ -397,6 +401,20 @@ public void setWorkflowPriority(int workflowPriority) {
this.workflowPriority = workflowPriority;
}

/**
* @return the domain that the task was scheduled in
*/
public String getDomain() {
return domain;
}

/**
* @param domain The domain that the task was scheduled in
*/
public void setDomain(String domain) {
this.domain = domain;
}

@Override
public boolean equals(Object o) {
if (this == o) {
Expand All @@ -420,7 +438,8 @@ && getStatus() == that.getStatus()
&& Objects.equals(getReasonForIncompletion(), that.getReasonForIncompletion())
&& Objects.equals(getTaskDefName(), that.getTaskDefName())
&& getTaskType().equals(that.getTaskType())
&& getTaskId().equals(that.getTaskId());
&& getTaskId().equals(that.getTaskId())
&& getDomain().equals(that.getDomain());
}

@Override
Expand All @@ -440,6 +459,7 @@ public int hashCode() {
getTaskDefName(),
getTaskType(),
getTaskId(),
getWorkflowPriority());
getWorkflowPriority(),
getDomain());
}
}
4 changes: 4 additions & 0 deletions es6-persistence/src/main/resources/mappings_docType_task.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@
"workflowType": {
"type": "keyword",
"index": true
},
"domain": {
"type": "keyword",
"index": true
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -934,6 +934,9 @@ public TaskSummaryPb.TaskSummary toProto(TaskSummary from) {
to.setExternalOutputPayloadStoragePath( from.getExternalOutputPayloadStoragePath() );
}
to.setWorkflowPriority( from.getWorkflowPriority() );
if (from.getDomain() != null) {
to.setDomain( from.getDomain() );
}
return to.build();
}

Expand All @@ -958,6 +961,7 @@ public TaskSummary fromProto(TaskSummaryPb.TaskSummary from) {
to.setExternalInputPayloadStoragePath( from.getExternalInputPayloadStoragePath() );
to.setExternalOutputPayloadStoragePath( from.getExternalOutputPayloadStoragePath() );
to.setWorkflowPriority( from.getWorkflowPriority() );
to.setDomain( from.getDomain() );
return to;
}

Expand Down
1 change: 1 addition & 0 deletions grpc/src/main/proto/model/tasksummary.proto
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ message TaskSummary {
string external_input_payload_storage_path = 17;
string external_output_payload_storage_path = 18;
int32 workflow_priority = 19;
string domain = 20;
}

0 comments on commit ae10047

Please sign in to comment.