Skip to content

Commit 15e5b5b

Browse files
wxing1292meiliang86
andcommitted
Use cadence-idl repo IDL storage (#427)
* Use cadence-idl repo IDL storage * Delete thrift dir Co-authored-by: Liang Mei <[email protected]>
1 parent 5653e4c commit 15e5b5b

25 files changed

+255
-2530
lines changed

.gitmodules

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[submodule "src/main/idls"]
2+
path = src/main/idls
3+
url = [email protected]:uber/cadence-idl.git
4+
branch = master

build.gradle

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
buildscript {
22
dependencies {
3-
classpath 'gradle.plugin.org.jruyi.gradle:thrift-gradle-plugin:0.4.1'
3+
classpath "gradle.plugin.org.jruyi.gradle:thrift-gradle-plugin:0.4.1"
44
}
55
}
66

@@ -69,6 +69,12 @@ license {
6969
exclude 'com/uber/cadence/*.java' // generated code
7070
}
7171

72+
compileThrift {
73+
sourceItems "src/main/idls/thrift/cadence.thrift","src/main/idls/thrift/shared.thrift"
74+
75+
nowarn true
76+
}
77+
7278
compileJava {
7379
dependsOn 'googleJavaFormat'
7480
options.encoding = 'UTF-8'

src/main/idls

Submodule idls added at 56ca0b5

src/main/java/com/uber/cadence/client/WorkflowOptions.java

-25
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import com.cronutils.model.definition.CronDefinitionBuilder;
2626
import com.cronutils.parser.CronParser;
2727
import com.google.common.base.Strings;
28-
import com.uber.cadence.ChildPolicy;
2928
import com.uber.cadence.WorkflowIdReusePolicy;
3029
import com.uber.cadence.common.CronSchedule;
3130
import com.uber.cadence.common.MethodRetry;
@@ -60,7 +59,6 @@ public static WorkflowOptions merge(
6059
OptionsUtils.merge(
6160
a.executionStartToCloseTimeoutSeconds(), o.getExecutionStartToCloseTimeout()))
6261
.setTaskList(OptionsUtils.merge(a.taskList(), o.getTaskList(), String.class))
63-
.setChildPolicy(o.getChildPolicy())
6462
.setRetryOptions(RetryOptions.merge(methodRetry, o.getRetryOptions()))
6563
.setCronSchedule(OptionsUtils.merge(cronAnnotation, o.getCronSchedule(), String.class))
6664
.setMemo(o.getMemo())
@@ -80,8 +78,6 @@ public static final class Builder {
8078

8179
private String taskList;
8280

83-
private ChildPolicy childPolicy;
84-
8581
private RetryOptions retryOptions;
8682

8783
private String cronSchedule;
@@ -101,7 +97,6 @@ public Builder(WorkflowOptions o) {
10197
this.taskStartToCloseTimeout = o.taskStartToCloseTimeout;
10298
this.executionStartToCloseTimeout = o.executionStartToCloseTimeout;
10399
this.taskList = o.taskList;
104-
this.childPolicy = o.childPolicy;
105100
this.retryOptions = o.retryOptions;
106101
this.cronSchedule = o.cronSchedule;
107102
this.memo = o.memo;
@@ -174,12 +169,6 @@ public Builder setTaskList(String taskList) {
174169
return this;
175170
}
176171

177-
/** Specifies how children of this workflow react to this workflow death. */
178-
public Builder setChildPolicy(ChildPolicy childPolicy) {
179-
this.childPolicy = childPolicy;
180-
return this;
181-
}
182-
183172
public Builder setRetryOptions(RetryOptions retryOptions) {
184173
this.retryOptions = retryOptions;
185174
return this;
@@ -215,7 +204,6 @@ public WorkflowOptions build() {
215204
executionStartToCloseTimeout,
216205
taskStartToCloseTimeout,
217206
taskList,
218-
childPolicy,
219207
retryOptions,
220208
cronSchedule,
221209
memo,
@@ -262,7 +250,6 @@ public WorkflowOptions validateBuildWithDefaults() {
262250
roundUpToSeconds(
263251
taskStartToCloseTimeout, OptionsUtils.DEFAULT_TASK_START_TO_CLOSE_TIMEOUT),
264252
taskList,
265-
childPolicy,
266253
retryOptions,
267254
cronSchedule,
268255
memo,
@@ -280,8 +267,6 @@ public WorkflowOptions validateBuildWithDefaults() {
280267

281268
private final String taskList;
282269

283-
private final ChildPolicy childPolicy;
284-
285270
private RetryOptions retryOptions;
286271

287272
private String cronSchedule;
@@ -296,7 +281,6 @@ private WorkflowOptions(
296281
Duration executionStartToCloseTimeout,
297282
Duration taskStartToCloseTimeout,
298283
String taskList,
299-
ChildPolicy childPolicy,
300284
RetryOptions retryOptions,
301285
String cronSchedule,
302286
Map<String, Object> memo,
@@ -306,7 +290,6 @@ private WorkflowOptions(
306290
this.executionStartToCloseTimeout = executionStartToCloseTimeout;
307291
this.taskStartToCloseTimeout = taskStartToCloseTimeout;
308292
this.taskList = taskList;
309-
this.childPolicy = childPolicy;
310293
this.retryOptions = retryOptions;
311294
this.cronSchedule = cronSchedule;
312295
this.memo = memo;
@@ -333,10 +316,6 @@ public String getTaskList() {
333316
return taskList;
334317
}
335318

336-
public ChildPolicy getChildPolicy() {
337-
return childPolicy;
338-
}
339-
340319
public RetryOptions getRetryOptions() {
341320
return retryOptions;
342321
}
@@ -363,7 +342,6 @@ public boolean equals(Object o) {
363342
&& Objects.equals(executionStartToCloseTimeout, that.executionStartToCloseTimeout)
364343
&& Objects.equals(taskStartToCloseTimeout, that.taskStartToCloseTimeout)
365344
&& Objects.equals(taskList, that.taskList)
366-
&& childPolicy == that.childPolicy
367345
&& Objects.equals(retryOptions, that.retryOptions)
368346
&& Objects.equals(cronSchedule, that.cronSchedule)
369347
&& Objects.equals(memo, that.memo)
@@ -378,7 +356,6 @@ public int hashCode() {
378356
executionStartToCloseTimeout,
379357
taskStartToCloseTimeout,
380358
taskList,
381-
childPolicy,
382359
retryOptions,
383360
cronSchedule,
384361
memo,
@@ -400,8 +377,6 @@ public String toString() {
400377
+ ", taskList='"
401378
+ taskList
402379
+ '\''
403-
+ ", childPolicy="
404-
+ childPolicy
405380
+ ", retryOptions="
406381
+ retryOptions
407382
+ ", cronSchedule='"

src/main/java/com/uber/cadence/internal/common/StartWorkflowExecutionParameters.java

-21
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
package com.uber.cadence.internal.common;
1919

20-
import com.uber.cadence.ChildPolicy;
2120
import com.uber.cadence.WorkflowIdReusePolicy;
2221
import com.uber.cadence.WorkflowType;
2322
import com.uber.cadence.client.WorkflowOptions;
@@ -43,8 +42,6 @@ public final class StartWorkflowExecutionParameters {
4342

4443
private long taskStartToCloseTimeoutSeconds;
4544

46-
private ChildPolicy childPolicy;
47-
4845
private WorkflowIdReusePolicy workflowIdReusePolicy;
4946

5047
private RetryParameters retryParameters;
@@ -268,19 +265,6 @@ public StartWorkflowExecutionParameters withTaskStartToCloseTimeoutSeconds(
268265
return this;
269266
}
270267

271-
public ChildPolicy getChildPolicy() {
272-
return childPolicy;
273-
}
274-
275-
public void setChildPolicy(ChildPolicy childPolicy) {
276-
this.childPolicy = childPolicy;
277-
}
278-
279-
public StartWorkflowExecutionParameters withChildPolicy(ChildPolicy childPolicy) {
280-
this.childPolicy = childPolicy;
281-
return this;
282-
}
283-
284268
public RetryParameters getRetryParameters() {
285269
return retryParameters;
286270
}
@@ -324,7 +308,6 @@ public static StartWorkflowExecutionParameters fromWorkflowOptions(WorkflowOptio
324308
getSeconds(options.getExecutionStartToCloseTimeout()));
325309
parameters.setTaskStartToCloseTimeoutSeconds(getSeconds(options.getTaskStartToCloseTimeout()));
326310
parameters.setTaskList(options.getTaskList());
327-
parameters.setChildPolicy(options.getChildPolicy());
328311
parameters.setWorkflowIdReusePolicy(options.getWorkflowIdReusePolicy());
329312
RetryOptions retryOptions = options.getRetryOptions();
330313
if (retryOptions != null) {
@@ -376,8 +359,6 @@ public String toString() {
376359
+ executionStartToCloseTimeoutSeconds
377360
+ ", taskStartToCloseTimeoutSeconds="
378361
+ taskStartToCloseTimeoutSeconds
379-
+ ", childPolicy="
380-
+ childPolicy
381362
+ ", workflowIdReusePolicy="
382363
+ workflowIdReusePolicy
383364
+ ", retryParameters="
@@ -405,7 +386,6 @@ public boolean equals(Object o) {
405386
&& Objects.equals(workflowType, that.workflowType)
406387
&& Objects.equals(taskList, that.taskList)
407388
&& Arrays.equals(input, that.input)
408-
&& childPolicy == that.childPolicy
409389
&& workflowIdReusePolicy == that.workflowIdReusePolicy
410390
&& Objects.equals(retryParameters, that.retryParameters)
411391
&& Objects.equals(cronSchedule, that.cronSchedule)
@@ -422,7 +402,6 @@ public int hashCode() {
422402
taskList,
423403
executionStartToCloseTimeoutSeconds,
424404
taskStartToCloseTimeoutSeconds,
425-
childPolicy,
426405
workflowIdReusePolicy,
427406
retryParameters,
428407
cronSchedule,

src/main/java/com/uber/cadence/internal/common/TerminateWorkflowExecutionParameters.java

+1-18
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,21 @@
1717

1818
package com.uber.cadence.internal.common;
1919

20-
import com.uber.cadence.ChildPolicy;
2120
import com.uber.cadence.WorkflowExecution;
2221

2322
public class TerminateWorkflowExecutionParameters {
2423

2524
private WorkflowExecution workflowExecution;
2625

27-
private ChildPolicy childPolicy;
28-
2926
private String reason;
3027

3128
private byte[] details;
3229

3330
public TerminateWorkflowExecutionParameters() {}
3431

3532
public TerminateWorkflowExecutionParameters(
36-
WorkflowExecution workflowExecution, ChildPolicy childPolicy, String reason, byte[] details) {
33+
WorkflowExecution workflowExecution, String reason, byte[] details) {
3734
this.workflowExecution = workflowExecution;
38-
this.childPolicy = childPolicy;
3935
this.reason = reason;
4036
this.details = details;
4137
}
@@ -54,19 +50,6 @@ public TerminateWorkflowExecutionParameters withWorkflowExecution(
5450
return this;
5551
}
5652

57-
public ChildPolicy getChildPolicy() {
58-
return childPolicy;
59-
}
60-
61-
public void setChildPolicy(ChildPolicy childPolicy) {
62-
this.childPolicy = childPolicy;
63-
}
64-
65-
public TerminateWorkflowExecutionParameters withChildPolicy(ChildPolicy childPolicy) {
66-
this.childPolicy = childPolicy;
67-
return this;
68-
}
69-
7053
public String getReason() {
7154
return reason;
7255
}

src/main/java/com/uber/cadence/internal/metrics/ServiceMethod.java

+6
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ public class ServiceMethod {
3131
MetricsType.CADENCE_METRICS_PREFIX + "ListOpenWorkflowExecutions";
3232
public static final String LIST_WORKFLOW_EXECUTIONS =
3333
MetricsType.CADENCE_METRICS_PREFIX + "ListWorkflowExecutions";
34+
public static final String LIST_ARCHIVED_WORKFLOW_EXECUTIONS =
35+
MetricsType.CADENCE_METRICS_PREFIX + "ListArchivedWorkflowExecutions";
36+
public static final String LIST_TASK_LIST_PARTITIONS =
37+
MetricsType.CADENCE_METRICS_PREFIX + "ListTaskListPartitions";
3438
public static final String SCAN_WORKFLOW_EXECUTIONS =
3539
MetricsType.CADENCE_METRICS_PREFIX + "ScanWorkflowExecutions";
3640
public static final String COUNT_WORKFLOW_EXECUTIONS =
@@ -77,6 +81,8 @@ public class ServiceMethod {
7781
public static final String QUERY_WORKFLOW = MetricsType.CADENCE_METRICS_PREFIX + "QueryWorkflow";
7882
public static final String DESCRIBE_TASK_LIST =
7983
MetricsType.CADENCE_METRICS_PREFIX + "DescribeTaskList";
84+
public static final String GET_CLUSTER_INFO =
85+
MetricsType.CADENCE_METRICS_PREFIX + "GetClusterInfo";
8086
public static final String RESPOND_QUERY_TASK_COMPLETED =
8187
MetricsType.CADENCE_METRICS_PREFIX + "RespondQueryTaskCompleted";
8288
public static final String DESCRIBE_WORKFLOW_EXECUTION =

src/main/java/com/uber/cadence/internal/replay/DecisionContext.java

-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
package com.uber.cadence.internal.replay;
1919

20-
import com.uber.cadence.ChildPolicy;
2120
import com.uber.cadence.SearchAttributes;
2221
import com.uber.cadence.WorkflowExecution;
2322
import com.uber.cadence.WorkflowType;
@@ -70,8 +69,6 @@ public interface DecisionContext extends ReplayAware {
7069

7170
Duration getDecisionTaskTimeout();
7271

73-
ChildPolicy getChildPolicy();
74-
7572
/**
7673
* Used to retrieve search attributes.
7774
*

src/main/java/com/uber/cadence/internal/replay/DecisionContextImpl.java

-6
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
package com.uber.cadence.internal.replay;
1919

20-
import com.uber.cadence.ChildPolicy;
2120
import com.uber.cadence.DecisionTaskFailedCause;
2221
import com.uber.cadence.DecisionTaskFailedEventAttributes;
2322
import com.uber.cadence.HistoryEvent;
@@ -137,11 +136,6 @@ public Duration getDecisionTaskTimeout() {
137136
return Duration.ofSeconds(workflowContext.getDecisionTaskTimeoutSeconds());
138137
}
139138

140-
@Override
141-
public ChildPolicy getChildPolicy() {
142-
return workflowContext.getChildPolicy();
143-
}
144-
145139
@Override
146140
public String getTaskList() {
147141
return workflowContext.getTaskList();

0 commit comments

Comments
 (0)