Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ public enum TimeoutPolicy {
@ProtoField(id = 21)
private boolean enforceSchema = true;

@ProtoField(id = 22)
private Map<String, Object> metadata = new HashMap<>();

public boolean isEnforceSchema() {
return enforceSchema;
}
Expand Down Expand Up @@ -366,6 +369,14 @@ public void setOutputSchema(SchemaDef outputSchema) {
this.outputSchema = outputSchema;
}

public Map<String, Object> getMetadata() {
return metadata;
}

public void setMetadata(Map<String, Object> metadata) {
this.metadata = metadata;
}

public boolean containsType(String taskType) {
return collectTasks().stream().anyMatch(t -> t.getType().equals(taskType));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1339,6 +1339,9 @@ public WorkflowDefPb.WorkflowDef toProto(WorkflowDef from) {
to.setOutputSchema( toProto( from.getOutputSchema() ) );
}
to.setEnforceSchema( from.isEnforceSchema() );
for (Map.Entry<String, Object> pair : from.getMetadata().entrySet()) {
to.putMetadata( pair.getKey(), toProto( pair.getValue() ) );
}
return to.build();
}

Expand Down Expand Up @@ -1382,6 +1385,11 @@ public WorkflowDef fromProto(WorkflowDefPb.WorkflowDef from) {
to.setOutputSchema( fromProto( from.getOutputSchema() ) );
}
to.setEnforceSchema( from.getEnforceSchema() );
Map<String, Object> metadataMap = new HashMap<String, Object>();
for (Map.Entry<String, Value> pair : from.getMetadataMap().entrySet()) {
metadataMap.put( pair.getKey(), fromProto( pair.getValue() ) );
}
to.setMetadata(metadataMap);
return to;
}

Expand Down
1 change: 1 addition & 0 deletions grpc/src/main/proto/model/workflowdef.proto
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ message WorkflowDef {
SchemaDef input_schema = 19;
SchemaDef output_schema = 20;
bool enforce_schema = 21;
map<string, google.protobuf.Value> metadata = 22;
}
Loading