Skip to content

Commit d67cf58

Browse files
authored
feat: Update IDL (#1050)
* feat: Apply task list rate limiting to sticky polls * feat: Update IDL
1 parent 24583db commit d67cf58

55 files changed

Lines changed: 678 additions & 22 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

build.gradle

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,37 @@ clean {
181181
delete protobuf.generatedFilesBaseDir
182182
}
183183

184+
// This is to suppress the deprecation warning in the generated file, because it uses a deprecated proto message.
185+
// Remove this once the deprecated proto message is deleted.
186+
task replaceGeneratedSources {
187+
dependsOn 'generateProto'
188+
doLast {
189+
def file = file("$buildDir/generated-sources/proto/main/java/com/uber/cadence/api/v1/ActiveClusterSelectionPolicy.java")
190+
191+
if (!file.exists()) {
192+
return
193+
}
194+
195+
def content = file.text
196+
197+
def updated = content.replaceFirst(
198+
/public\s+.*class\s+ActiveClusterSelectionPolicy/,
199+
'@SuppressWarnings("deprecation")\n$0'
200+
)
201+
202+
if (content == updated) {
203+
println("❌ Pattern did NOT match")
204+
} else {
205+
file.text = updated
206+
println("✅ Replacement applied")
207+
}
208+
209+
}
210+
}
211+
184212
compileJava {
185213
dependsOn 'googleJavaFormat'
214+
dependsOn 'replaceGeneratedSources'
186215
options.encoding = 'UTF-8'
187216
options.compilerArgs << '-Xlint:none' << '-Xlint:deprecation' << '-Werror'
188217
options.errorprone.excludedPaths = '.*/generated-sources/.*'
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package com.uber.cadence;
2+
3+
import java.util.*;
4+
import lombok.Data;
5+
import lombok.experimental.Accessors;
6+
7+
@Data
8+
@Accessors(chain = true)
9+
public class ActiveClusterInfo {
10+
private String activeClusterName;
11+
private long failoverVersion;
12+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package com.uber.cadence;
2+
3+
import java.util.*;
4+
import lombok.Data;
5+
import lombok.experimental.Accessors;
6+
7+
@Data
8+
@Accessors(chain = true)
9+
public class ActiveClusterSelectionPolicy {
10+
private ClusterAttribute clusterAttribute;
11+
private ActiveClusterSelectionStrategy strategy;
12+
private String stickyRegion;
13+
private String externalEntityType;
14+
private String externalEntityKey;
15+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package com.uber.cadence;
2+
3+
public enum ActiveClusterSelectionStrategy {
4+
REGION_STICKY,
5+
EXTERNAL_ENTITY,
6+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package com.uber.cadence;
2+
3+
import java.util.*;
4+
import lombok.Data;
5+
import lombok.experimental.Accessors;
6+
7+
@Data
8+
@Accessors(chain = true)
9+
public class ActiveClusters {
10+
private Map<String, ActiveClusterInfo> activeClustersByRegion = new HashMap<>();;
11+
private Map<String, ClusterAttributeScope> activeClustersByClusterAttribute = new HashMap<>();;
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package com.uber.cadence;
2+
3+
import java.util.*;
4+
import lombok.Data;
5+
import lombok.experimental.Accessors;
6+
7+
@Data
8+
@Accessors(chain = true)
9+
public class ClusterAttribute {
10+
private String scope;
11+
private String name;
12+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package com.uber.cadence;
2+
3+
import java.util.*;
4+
import lombok.Data;
5+
import lombok.experimental.Accessors;
6+
7+
@Data
8+
@Accessors(chain = true)
9+
public class ClusterAttributeScope {
10+
private Map<String, ActiveClusterInfo> clusterAttributes = new HashMap<>();;
11+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.uber.cadence;
2+
3+
import java.util.*;
4+
import lombok.Data;
5+
import lombok.experimental.Accessors;
6+
7+
@Data
8+
@Accessors(chain = true)
9+
public class ClusterFailover {
10+
private ActiveClusterInfo fromCluster;
11+
private ActiveClusterInfo toCluster;
12+
private ClusterAttribute clusterAttribute;
13+
}

src/gen/java/com/uber/cadence/ContinueAsNewWorkflowExecutionDecisionAttributes.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,6 @@ public class ContinueAsNewWorkflowExecutionDecisionAttributes {
2323
private Memo memo;
2424
private SearchAttributes searchAttributes;
2525
private int jitterStartSeconds;
26+
private CronOverlapPolicy cronOverlapPolicy;
27+
private ActiveClusterSelectionPolicy activeClusterSelectionPolicy;
2628
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package com.uber.cadence;
2+
3+
public enum CronOverlapPolicy {
4+
SKIPPED,
5+
BUFFERONE,
6+
}

0 commit comments

Comments
 (0)