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
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "src/main/idls"]
path = src/main/idls
url = [email protected]:uber/cadence-idl.git
branch = master
8 changes: 7 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
buildscript {
dependencies {
classpath 'gradle.plugin.org.jruyi.gradle:thrift-gradle-plugin:0.4.1'
classpath "gradle.plugin.org.jruyi.gradle:thrift-gradle-plugin:0.4.1"
}
}

Expand Down Expand Up @@ -69,6 +69,12 @@ license {
exclude 'com/uber/cadence/*.java' // generated code
}

compileThrift {
sourceItems "src/main/idls/thrift/cadence.thrift","src/main/idls/thrift/shared.thrift"

nowarn true
}

compileJava {
dependsOn 'googleJavaFormat'
options.encoding = 'UTF-8'
Expand Down
1 change: 1 addition & 0 deletions src/main/idls
Submodule idls added at 56ca0b
25 changes: 0 additions & 25 deletions src/main/java/com/uber/cadence/client/WorkflowOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import com.cronutils.model.definition.CronDefinitionBuilder;
import com.cronutils.parser.CronParser;
import com.google.common.base.Strings;
import com.uber.cadence.ChildPolicy;
import com.uber.cadence.WorkflowIdReusePolicy;
import com.uber.cadence.common.CronSchedule;
import com.uber.cadence.common.MethodRetry;
Expand Down Expand Up @@ -60,7 +59,6 @@ public static WorkflowOptions merge(
OptionsUtils.merge(
a.executionStartToCloseTimeoutSeconds(), o.getExecutionStartToCloseTimeout()))
.setTaskList(OptionsUtils.merge(a.taskList(), o.getTaskList(), String.class))
.setChildPolicy(o.getChildPolicy())
.setRetryOptions(RetryOptions.merge(methodRetry, o.getRetryOptions()))
.setCronSchedule(OptionsUtils.merge(cronAnnotation, o.getCronSchedule(), String.class))
.setMemo(o.getMemo())
Expand All @@ -80,8 +78,6 @@ public static final class Builder {

private String taskList;

private ChildPolicy childPolicy;

private RetryOptions retryOptions;

private String cronSchedule;
Expand All @@ -101,7 +97,6 @@ public Builder(WorkflowOptions o) {
this.taskStartToCloseTimeout = o.taskStartToCloseTimeout;
this.executionStartToCloseTimeout = o.executionStartToCloseTimeout;
this.taskList = o.taskList;
this.childPolicy = o.childPolicy;
this.retryOptions = o.retryOptions;
this.cronSchedule = o.cronSchedule;
this.memo = o.memo;
Expand Down Expand Up @@ -174,12 +169,6 @@ public Builder setTaskList(String taskList) {
return this;
}

/** Specifies how children of this workflow react to this workflow death. */
public Builder setChildPolicy(ChildPolicy childPolicy) {
this.childPolicy = childPolicy;
return this;
}

public Builder setRetryOptions(RetryOptions retryOptions) {
this.retryOptions = retryOptions;
return this;
Expand Down Expand Up @@ -215,7 +204,6 @@ public WorkflowOptions build() {
executionStartToCloseTimeout,
taskStartToCloseTimeout,
taskList,
childPolicy,
retryOptions,
cronSchedule,
memo,
Expand Down Expand Up @@ -262,7 +250,6 @@ public WorkflowOptions validateBuildWithDefaults() {
roundUpToSeconds(
taskStartToCloseTimeout, OptionsUtils.DEFAULT_TASK_START_TO_CLOSE_TIMEOUT),
taskList,
childPolicy,
retryOptions,
cronSchedule,
memo,
Expand All @@ -280,8 +267,6 @@ public WorkflowOptions validateBuildWithDefaults() {

private final String taskList;

private final ChildPolicy childPolicy;

private RetryOptions retryOptions;

private String cronSchedule;
Expand All @@ -296,7 +281,6 @@ private WorkflowOptions(
Duration executionStartToCloseTimeout,
Duration taskStartToCloseTimeout,
String taskList,
ChildPolicy childPolicy,
RetryOptions retryOptions,
String cronSchedule,
Map<String, Object> memo,
Expand All @@ -306,7 +290,6 @@ private WorkflowOptions(
this.executionStartToCloseTimeout = executionStartToCloseTimeout;
this.taskStartToCloseTimeout = taskStartToCloseTimeout;
this.taskList = taskList;
this.childPolicy = childPolicy;
this.retryOptions = retryOptions;
this.cronSchedule = cronSchedule;
this.memo = memo;
Expand All @@ -333,10 +316,6 @@ public String getTaskList() {
return taskList;
}

public ChildPolicy getChildPolicy() {
return childPolicy;
}

public RetryOptions getRetryOptions() {
return retryOptions;
}
Expand All @@ -363,7 +342,6 @@ public boolean equals(Object o) {
&& Objects.equals(executionStartToCloseTimeout, that.executionStartToCloseTimeout)
&& Objects.equals(taskStartToCloseTimeout, that.taskStartToCloseTimeout)
&& Objects.equals(taskList, that.taskList)
&& childPolicy == that.childPolicy
&& Objects.equals(retryOptions, that.retryOptions)
&& Objects.equals(cronSchedule, that.cronSchedule)
&& Objects.equals(memo, that.memo)
Expand All @@ -378,7 +356,6 @@ public int hashCode() {
executionStartToCloseTimeout,
taskStartToCloseTimeout,
taskList,
childPolicy,
retryOptions,
cronSchedule,
memo,
Expand All @@ -400,8 +377,6 @@ public String toString() {
+ ", taskList='"
+ taskList
+ '\''
+ ", childPolicy="
+ childPolicy
+ ", retryOptions="
+ retryOptions
+ ", cronSchedule='"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

package com.uber.cadence.internal.common;

import com.uber.cadence.ChildPolicy;
import com.uber.cadence.WorkflowIdReusePolicy;
import com.uber.cadence.WorkflowType;
import com.uber.cadence.client.WorkflowOptions;
Expand All @@ -43,8 +42,6 @@ public final class StartWorkflowExecutionParameters {

private long taskStartToCloseTimeoutSeconds;

private ChildPolicy childPolicy;

private WorkflowIdReusePolicy workflowIdReusePolicy;

private RetryParameters retryParameters;
Expand Down Expand Up @@ -268,19 +265,6 @@ public StartWorkflowExecutionParameters withTaskStartToCloseTimeoutSeconds(
return this;
}

public ChildPolicy getChildPolicy() {
return childPolicy;
}

public void setChildPolicy(ChildPolicy childPolicy) {
this.childPolicy = childPolicy;
}

public StartWorkflowExecutionParameters withChildPolicy(ChildPolicy childPolicy) {
this.childPolicy = childPolicy;
return this;
}

public RetryParameters getRetryParameters() {
return retryParameters;
}
Expand Down Expand Up @@ -324,7 +308,6 @@ public static StartWorkflowExecutionParameters fromWorkflowOptions(WorkflowOptio
getSeconds(options.getExecutionStartToCloseTimeout()));
parameters.setTaskStartToCloseTimeoutSeconds(getSeconds(options.getTaskStartToCloseTimeout()));
parameters.setTaskList(options.getTaskList());
parameters.setChildPolicy(options.getChildPolicy());
parameters.setWorkflowIdReusePolicy(options.getWorkflowIdReusePolicy());
RetryOptions retryOptions = options.getRetryOptions();
if (retryOptions != null) {
Expand Down Expand Up @@ -376,8 +359,6 @@ public String toString() {
+ executionStartToCloseTimeoutSeconds
+ ", taskStartToCloseTimeoutSeconds="
+ taskStartToCloseTimeoutSeconds
+ ", childPolicy="
+ childPolicy
+ ", workflowIdReusePolicy="
+ workflowIdReusePolicy
+ ", retryParameters="
Expand Down Expand Up @@ -405,7 +386,6 @@ public boolean equals(Object o) {
&& Objects.equals(workflowType, that.workflowType)
&& Objects.equals(taskList, that.taskList)
&& Arrays.equals(input, that.input)
&& childPolicy == that.childPolicy
&& workflowIdReusePolicy == that.workflowIdReusePolicy
&& Objects.equals(retryParameters, that.retryParameters)
&& Objects.equals(cronSchedule, that.cronSchedule)
Expand All @@ -422,7 +402,6 @@ public int hashCode() {
taskList,
executionStartToCloseTimeoutSeconds,
taskStartToCloseTimeoutSeconds,
childPolicy,
workflowIdReusePolicy,
retryParameters,
cronSchedule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,21 @@

package com.uber.cadence.internal.common;

import com.uber.cadence.ChildPolicy;
import com.uber.cadence.WorkflowExecution;

public class TerminateWorkflowExecutionParameters {

private WorkflowExecution workflowExecution;

private ChildPolicy childPolicy;

private String reason;

private byte[] details;

public TerminateWorkflowExecutionParameters() {}

public TerminateWorkflowExecutionParameters(
WorkflowExecution workflowExecution, ChildPolicy childPolicy, String reason, byte[] details) {
WorkflowExecution workflowExecution, String reason, byte[] details) {
this.workflowExecution = workflowExecution;
this.childPolicy = childPolicy;
this.reason = reason;
this.details = details;
}
Expand All @@ -54,19 +50,6 @@ public TerminateWorkflowExecutionParameters withWorkflowExecution(
return this;
}

public ChildPolicy getChildPolicy() {
return childPolicy;
}

public void setChildPolicy(ChildPolicy childPolicy) {
this.childPolicy = childPolicy;
}

public TerminateWorkflowExecutionParameters withChildPolicy(ChildPolicy childPolicy) {
this.childPolicy = childPolicy;
return this;
}

public String getReason() {
return reason;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ public class ServiceMethod {
MetricsType.CADENCE_METRICS_PREFIX + "ListOpenWorkflowExecutions";
public static final String LIST_WORKFLOW_EXECUTIONS =
MetricsType.CADENCE_METRICS_PREFIX + "ListWorkflowExecutions";
public static final String LIST_ARCHIVED_WORKFLOW_EXECUTIONS =
MetricsType.CADENCE_METRICS_PREFIX + "ListArchivedWorkflowExecutions";
public static final String LIST_TASK_LIST_PARTITIONS =
MetricsType.CADENCE_METRICS_PREFIX + "ListTaskListPartitions";
public static final String SCAN_WORKFLOW_EXECUTIONS =
MetricsType.CADENCE_METRICS_PREFIX + "ScanWorkflowExecutions";
public static final String COUNT_WORKFLOW_EXECUTIONS =
Expand Down Expand Up @@ -77,6 +81,8 @@ public class ServiceMethod {
public static final String QUERY_WORKFLOW = MetricsType.CADENCE_METRICS_PREFIX + "QueryWorkflow";
public static final String DESCRIBE_TASK_LIST =
MetricsType.CADENCE_METRICS_PREFIX + "DescribeTaskList";
public static final String GET_CLUSTER_INFO =
MetricsType.CADENCE_METRICS_PREFIX + "GetClusterInfo";
public static final String RESPOND_QUERY_TASK_COMPLETED =
MetricsType.CADENCE_METRICS_PREFIX + "RespondQueryTaskCompleted";
public static final String DESCRIBE_WORKFLOW_EXECUTION =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

package com.uber.cadence.internal.replay;

import com.uber.cadence.ChildPolicy;
import com.uber.cadence.SearchAttributes;
import com.uber.cadence.WorkflowExecution;
import com.uber.cadence.WorkflowType;
Expand Down Expand Up @@ -70,8 +69,6 @@ public interface DecisionContext extends ReplayAware {

Duration getDecisionTaskTimeout();

ChildPolicy getChildPolicy();

/**
* Used to retrieve search attributes.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

package com.uber.cadence.internal.replay;

import com.uber.cadence.ChildPolicy;
import com.uber.cadence.DecisionTaskFailedCause;
import com.uber.cadence.DecisionTaskFailedEventAttributes;
import com.uber.cadence.HistoryEvent;
Expand Down Expand Up @@ -137,11 +136,6 @@ public Duration getDecisionTaskTimeout() {
return Duration.ofSeconds(workflowContext.getDecisionTaskTimeoutSeconds());
}

@Override
public ChildPolicy getChildPolicy() {
return workflowContext.getChildPolicy();
}

@Override
public String getTaskList() {
return workflowContext.getTaskList();
Expand Down
Loading