-
Notifications
You must be signed in to change notification settings - Fork 114
Add CronoverlapPolicy support to java client #1018
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,6 +64,7 @@ public static WorkflowOptions merge( | |
.setRetryOptions(RetryOptions.merge(methodRetry, o.getRetryOptions())) | ||
.setCronSchedule(OptionsUtils.merge(cronAnnotation, o.getCronSchedule(), String.class)) | ||
.setMemo(o.getMemo()) | ||
.setCronOverlapPolicy(o.cronOverlapPolicy) | ||
.setSearchAttributes(o.getSearchAttributes()) | ||
.setContextPropagators(o.getContextPropagators()) | ||
.setDelayStart(o.delayStart) | ||
|
@@ -86,6 +87,8 @@ public static final class Builder { | |
|
||
private String cronSchedule; | ||
|
||
private int cronOverlapPolicy; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use thrift entity similar to |
||
|
||
private Map<String, Object> memo; | ||
|
||
private Map<String, Object> searchAttributes; | ||
|
@@ -107,6 +110,7 @@ public Builder(WorkflowOptions o) { | |
this.taskList = o.taskList; | ||
this.retryOptions = o.retryOptions; | ||
this.cronSchedule = o.cronSchedule; | ||
this.cronOverlapPolicy = o.cronOverlapPolicy; | ||
this.memo = o.memo; | ||
this.searchAttributes = o.searchAttributes; | ||
this.contextPropagators = o.contextPropagators; | ||
|
@@ -194,6 +198,11 @@ public Builder setCronSchedule(String cronSchedule) { | |
return this; | ||
} | ||
|
||
public Builder setCronOverlapPolicy(int cronOverlapPolicy) { | ||
this.cronOverlapPolicy = cronOverlapPolicy; | ||
return this; | ||
} | ||
|
||
/** | ||
* Specifies additional non-indexed information in result of list workflow. The type of value | ||
* can be any object that are serializable by {@link com.uber.cadence.converter.DataConverter} | ||
|
@@ -235,7 +244,8 @@ public WorkflowOptions build() { | |
memo, | ||
searchAttributes, | ||
contextPropagators, | ||
delayStart); | ||
delayStart, | ||
cronOverlapPolicy); | ||
} | ||
|
||
/** | ||
|
@@ -290,7 +300,8 @@ public WorkflowOptions validateBuildWithDefaults() { | |
memo, | ||
searchAttributes, | ||
contextPropagators, | ||
delayStart); | ||
delayStart, | ||
cronOverlapPolicy); | ||
} | ||
} | ||
|
||
|
@@ -308,6 +319,8 @@ public WorkflowOptions validateBuildWithDefaults() { | |
|
||
private String cronSchedule; | ||
|
||
private int cronOverlapPolicy; | ||
|
||
private Map<String, Object> memo; | ||
|
||
private Map<String, Object> searchAttributes; | ||
|
@@ -327,7 +340,8 @@ private WorkflowOptions( | |
Map<String, Object> memo, | ||
Map<String, Object> searchAttributes, | ||
List<ContextPropagator> contextPropagators, | ||
Duration delayStart) { | ||
Duration delayStart, | ||
int cronOverlapPolicy) { | ||
this.workflowId = workflowId; | ||
this.workflowIdReusePolicy = workflowIdReusePolicy; | ||
this.executionStartToCloseTimeout = executionStartToCloseTimeout; | ||
|
@@ -339,6 +353,7 @@ private WorkflowOptions( | |
this.searchAttributes = searchAttributes; | ||
this.contextPropagators = contextPropagators; | ||
this.delayStart = delayStart; | ||
this.cronOverlapPolicy = cronOverlapPolicy; | ||
} | ||
|
||
public String getWorkflowId() { | ||
|
@@ -369,6 +384,10 @@ public String getCronSchedule() { | |
return cronSchedule; | ||
} | ||
|
||
public int getCronOverlapPolicy() { | ||
return cronOverlapPolicy; | ||
} | ||
|
||
public Map<String, Object> getMemo() { | ||
return memo; | ||
} | ||
|
@@ -397,6 +416,7 @@ public boolean equals(Object o) { | |
&& Objects.equals(taskList, that.taskList) | ||
&& Objects.equals(retryOptions, that.retryOptions) | ||
&& Objects.equals(cronSchedule, that.cronSchedule) | ||
&& cronOverlapPolicy == that.cronOverlapPolicy | ||
&& Objects.equals(memo, that.memo) | ||
&& Objects.equals(searchAttributes, that.searchAttributes) | ||
&& Objects.equals(contextPropagators, that.contextPropagators) | ||
|
@@ -413,6 +433,7 @@ public int hashCode() { | |
taskList, | ||
retryOptions, | ||
cronSchedule, | ||
cronOverlapPolicy, | ||
memo, | ||
searchAttributes, | ||
contextPropagators, | ||
|
@@ -439,6 +460,8 @@ public String toString() { | |
+ ", cronSchedule='" | ||
+ cronSchedule | ||
+ '\'' | ||
+ ", cronOverlapPolicy=" | ||
+ cronOverlapPolicy | ||
+ ", memo='" | ||
+ memo | ||
+ '\'' | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,6 +56,8 @@ public final class StartWorkflowExecutionParameters { | |
|
||
private Duration delayStart; | ||
|
||
private int cronOverlapPolicy; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use thrift entity |
||
|
||
/** | ||
* Returns the value of the WorkflowId property for this object. | ||
* | ||
|
@@ -317,6 +319,14 @@ public Duration getDelayStart() { | |
return delayStart; | ||
} | ||
|
||
public int getCronOverlapPolicy() { | ||
return cronOverlapPolicy; | ||
} | ||
|
||
public void setCronOverlapPolicy(int cronOverlapPolicy) { | ||
this.cronOverlapPolicy = cronOverlapPolicy; | ||
} | ||
|
||
public StartWorkflowExecutionParameters withRetryParameters(RetryParameters retryParameters) { | ||
this.retryParameters = retryParameters; | ||
return this; | ||
|
@@ -352,6 +362,7 @@ public static StartWorkflowExecutionParameters fromWorkflowOptions(WorkflowOptio | |
if (options.getCronSchedule() != null) { | ||
parameters.setCronSchedule(options.getCronSchedule()); | ||
} | ||
parameters.setCronOverlapPolicy(options.getCronOverlapPolicy()); | ||
return parameters; | ||
} | ||
|
||
|
@@ -386,6 +397,8 @@ public String toString() { | |
+ ", cronSchedule='" | ||
+ cronSchedule | ||
+ '\'' | ||
+ ", cronOverlapPolicy=" | ||
+ cronOverlapPolicy | ||
+ ", memo='" | ||
+ memo | ||
+ '\'' | ||
|
@@ -413,6 +426,7 @@ public boolean equals(Object o) { | |
&& workflowIdReusePolicy == that.workflowIdReusePolicy | ||
&& Objects.equals(retryParameters, that.retryParameters) | ||
&& Objects.equals(cronSchedule, that.cronSchedule) | ||
&& cronOverlapPolicy == that.cronOverlapPolicy | ||
&& Objects.equals(memo, that.memo) | ||
&& Objects.equals(searchAttributes, that.searchAttributes) | ||
&& Objects.equals(context, that.context) | ||
|
@@ -431,6 +445,7 @@ public int hashCode() { | |
workflowIdReusePolicy, | ||
retryParameters, | ||
cronSchedule, | ||
cronOverlapPolicy, | ||
memo, | ||
searchAttributes, | ||
context, | ||
|
@@ -452,6 +467,7 @@ public StartWorkflowExecutionParameters copy() { | |
result.setRetryParameters(retryParameters.copy()); | ||
} | ||
result.setCronSchedule(cronSchedule); | ||
result.setCronOverlapPolicy(cronOverlapPolicy); | ||
result.setMemo(memo); | ||
result.setSearchAttributes(searchAttributes); | ||
result.setContext(context); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,6 +51,8 @@ public static final class Builder { | |
|
||
private String cronSchedule; | ||
|
||
private int cronOverlapPolicy; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use thrift entity |
||
|
||
private Map<String, Object> memo; | ||
|
||
private Map<String, Object> searchAttributes; | ||
|
@@ -115,6 +117,11 @@ public Builder setCronSchedule(String cronSchedule) { | |
return this; | ||
} | ||
|
||
public Builder setCronOverlapPolicy(int cronOverlapPolicy) { | ||
this.cronOverlapPolicy = cronOverlapPolicy; | ||
return this; | ||
} | ||
|
||
public Builder setMemo(Map<String, Object> memo) { | ||
this.memo = memo; | ||
return this; | ||
|
@@ -148,6 +155,7 @@ public StartChildWorkflowExecutionParameters build() { | |
workflowIdReusePolicy, | ||
retryParameters, | ||
cronSchedule, | ||
cronOverlapPolicy, | ||
memo, | ||
searchAttributes, | ||
context, | ||
|
@@ -177,6 +185,8 @@ public StartChildWorkflowExecutionParameters build() { | |
|
||
private final String cronSchedule; | ||
|
||
private final int cronOverlapPolicy; | ||
|
||
private Map<String, Object> memo; | ||
|
||
private Map<String, Object> searchAttributes; | ||
|
@@ -197,6 +207,7 @@ private StartChildWorkflowExecutionParameters( | |
WorkflowIdReusePolicy workflowIdReusePolicy, | ||
RetryParameters retryParameters, | ||
String cronSchedule, | ||
int cronOverlapPolicy, | ||
Map<String, Object> memo, | ||
Map<String, Object> searchAttributes, | ||
Map<String, byte[]> context, | ||
|
@@ -212,6 +223,7 @@ private StartChildWorkflowExecutionParameters( | |
this.workflowIdReusePolicy = workflowIdReusePolicy; | ||
this.retryParameters = retryParameters; | ||
this.cronSchedule = cronSchedule; | ||
this.cronOverlapPolicy = cronOverlapPolicy; | ||
this.memo = memo; | ||
this.searchAttributes = searchAttributes; | ||
this.context = context; | ||
|
@@ -262,6 +274,10 @@ public String getCronSchedule() { | |
return cronSchedule; | ||
} | ||
|
||
public int getCronOverlapPolicy() { | ||
return cronOverlapPolicy; | ||
} | ||
|
||
public Map<String, Object> getMemo() { | ||
return memo; | ||
} | ||
|
@@ -278,6 +294,28 @@ public ParentClosePolicy getParentClosePolicy() { | |
return parentClosePolicy; | ||
} | ||
|
||
public StartChildWorkflowExecutionParameters copy() { | ||
StartChildWorkflowExecutionParameters result = | ||
new StartChildWorkflowExecutionParameters( | ||
domain, | ||
input, | ||
control, | ||
executionStartToCloseTimeoutSeconds, | ||
taskList, | ||
taskStartToCloseTimeoutSeconds, | ||
workflowId, | ||
workflowType, | ||
workflowIdReusePolicy, | ||
retryParameters, | ||
cronSchedule, | ||
cronOverlapPolicy, | ||
memo, | ||
searchAttributes, | ||
context, | ||
parentClosePolicy); | ||
return result; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
|
@@ -286,18 +324,19 @@ public boolean equals(Object o) { | |
return executionStartToCloseTimeoutSeconds == that.executionStartToCloseTimeoutSeconds | ||
&& taskStartToCloseTimeoutSeconds == that.taskStartToCloseTimeoutSeconds | ||
&& Objects.equals(domain, that.domain) | ||
&& Objects.equals(control, that.control) | ||
&& Arrays.equals(input, that.input) | ||
&& Objects.equals(control, that.control) | ||
&& Objects.equals(taskList, that.taskList) | ||
&& Objects.equals(workflowId, that.workflowId) | ||
&& Objects.equals(workflowType, that.workflowType) | ||
&& workflowIdReusePolicy == that.workflowIdReusePolicy | ||
&& Objects.equals(retryParameters, that.retryParameters) | ||
&& Objects.equals(cronSchedule, that.cronSchedule) | ||
&& cronOverlapPolicy == that.cronOverlapPolicy | ||
&& Objects.equals(memo, that.memo) | ||
&& Objects.equals(searchAttributes, that.searchAttributes) | ||
&& Objects.equals(context, that.context) | ||
&& Objects.equals(parentClosePolicy, that.parentClosePolicy); | ||
&& parentClosePolicy == that.parentClosePolicy; | ||
} | ||
|
||
@Override | ||
|
@@ -314,6 +353,7 @@ public int hashCode() { | |
workflowIdReusePolicy, | ||
retryParameters, | ||
cronSchedule, | ||
cronOverlapPolicy, | ||
memo, | ||
searchAttributes, | ||
context, | ||
|
@@ -349,13 +389,16 @@ public String toString() { | |
+ workflowIdReusePolicy | ||
+ ", retryParameters=" | ||
+ retryParameters | ||
+ ", cronSchedule=" | ||
+ ", cronSchedule='" | ||
+ cronSchedule | ||
+ '\'' | ||
+ ", cronOverlapPolicy=" | ||
+ cronOverlapPolicy | ||
+ ", memo=" | ||
+ memo | ||
+ ", searchAttributes=" | ||
+ searchAttributes | ||
+ ", context='" | ||
+ ", context=" | ||
+ context | ||
+ ", parentClosePolicy=" | ||
+ parentClosePolicy | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use getter