Skip to content
Open
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
16 changes: 0 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,6 @@ jobs:
java-version: '11'
distribution: 'temurin'
cache: 'gradle'
- name: Install necessary tooling
env:
APACHE_THRIFT_VERSION: 0.9.3
run: |
apt-get update && apt-get install -y wget gcc make build-essential git

wget https://archive.apache.org/dist/thrift/${APACHE_THRIFT_VERSION}/thrift-${APACHE_THRIFT_VERSION}.tar.gz && \
tar -xvf thrift-${APACHE_THRIFT_VERSION}.tar.gz && \
rm thrift-${APACHE_THRIFT_VERSION}.tar.gz && \
cd thrift-${APACHE_THRIFT_VERSION}/ && \
./configure --enable-libs=no --enable-tests=no --enable-tutorial=no --with-cpp=no --with-c_glib=no --with-java=yes --with-ruby=no --with-erlang=no --with-go=no --with-nodejs=no --with-python=no && \
make && \
make install && \
cd .. && \
rm -rf thrift-${APACHE_THRIFT_VERSION}

- name: Determine release version
id: vars
run: |
Expand Down
16 changes: 6 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
buildscript {
dependencies {
classpath "gradle.plugin.org.jruyi.gradle:thrift-gradle-plugin:0.4.1"
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.11'
}
}
Expand Down Expand Up @@ -34,7 +33,6 @@ repositories {
apply plugin: 'com.google.protobuf'
apply plugin: 'idea' // IntelliJ plugin to see files generated from protos
apply plugin: 'maven'
apply plugin: 'org.jruyi.thrift'
apply plugin: 'maven-publish'
apply plugin: 'com.github.sherter.google-java-format'

Expand All @@ -44,7 +42,7 @@ googleJavaFormat {
exclude '**/generated-sources/*'
}

tasks.googleJavaFormat.dependsOn 'license'
tasks.googleJavaFormat.dependsOn 'licenseFormat'

group = 'com.uber.cadence'

Expand Down Expand Up @@ -77,7 +75,6 @@ dependencies {

compile group: 'com.uber.tchannel', name: 'tchannel-core', version: '0.8.30'
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.36'
compile group: 'org.apache.thrift', name: 'libthrift', version: '0.9.3'
compile group: 'com.google.code.gson', name: 'gson', version: '2.10'
compile group: 'com.uber.m3', name: 'tally-core', version: '0.11.1'
compile group: 'com.google.guava', name: 'guava', version: '31.1-jre'
Expand All @@ -89,6 +86,10 @@ dependencies {
compile group: 'com.google.api.grpc', name: 'proto-google-common-protos', version: '2.10.0'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't comment on the specific line (github won't let me), but we should remove the tchannel and libthrift dependencies that are above here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also fine if that's a followup PR to remove the lingering references. It seems like thrift library types are still used here and there.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've cleaned up all thrift related logic.

compile group: 'com.google.protobuf', name: 'protobuf-java-util', version: '3.21.9'
compile group: 'com.google.oauth-client', name: 'google-oauth-client', version: '1.35.0'
compileOnly 'org.projectlombok:lombok:1.18.30'
annotationProcessor 'org.projectlombok:lombok:1.18.30'
testCompileOnly 'org.projectlombok:lombok:1.18.30'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.30'

implementation 'io.grpc:grpc-netty-shaded:1.54.2'
implementation 'io.grpc:grpc-protobuf:1.54.2'
Expand Down Expand Up @@ -126,19 +127,14 @@ task updateDlsSubmodule(type: Exec) {
commandLine 'git', 'submodule', 'update'
}

compileThrift {
dependsOn updateDlsSubmodule
verbose true
sourceItems "${projectDir}/src/main/idls/thrift/cadence.thrift","${projectDir}/src/main/idls/thrift/shared.thrift","${projectDir}/src/main/idls/thrift/shadower.thrift"
}

sourceSets {
main {
proto {
srcDir 'src/main/idls/proto'
}
java {
srcDir 'src/main'
srcDir 'src/gen/java'
}
}
}
Expand Down
20 changes: 1 addition & 19 deletions docker/github_actions/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,10 @@
# commits to that branch and one of them can break the build
FROM adoptopenjdk/openjdk11:jdk-11.0.10_9-alpine

# Apache Thrift version
ENV APACHE_THRIFT_VERSION=0.9.3

# Install dependencies using apk
RUN apk update && apk add --virtual wget ca-certificates wget && apk add --virtual build-dependencies build-base gcc
RUN apk update && apk add --virtual wget ca-certificates wget
# Git is needed in order to update the dls submodule
RUN apk add git libstdc++ bash curl

# Compile source
RUN set -ex ;\
wget https://archive.apache.org/dist/thrift/${APACHE_THRIFT_VERSION}/thrift-${APACHE_THRIFT_VERSION}.tar.gz && \
tar -xvf thrift-${APACHE_THRIFT_VERSION}.tar.gz && \
rm thrift-${APACHE_THRIFT_VERSION}.tar.gz && \
cd thrift-${APACHE_THRIFT_VERSION}/ && \
./configure --enable-libs=no --enable-tests=no --enable-tutorial=no --with-cpp=no --with-c_glib=no --with-java=yes --with-ruby=no --with-erlang=no --with-go=no --with-nodejs=no --with-python=no && \
make && \
make install && \
cd .. && \
rm -rf thrift-${APACHE_THRIFT_VERSION}

# Cleanup packages and remove cache
RUN apk del build-dependencies wget && rm -rf /var/cache/apk/*

RUN mkdir /cadence-java-client
WORKDIR /cadence-java-client
39 changes: 0 additions & 39 deletions scripts/install-thrift-locally-osx.sh

This file was deleted.

14 changes: 14 additions & 0 deletions scripts/v4_entity_generator/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const (
type Field struct {
Name string
Type string
Initializer string
}

type TemplateEntity struct {
Expand Down Expand Up @@ -119,9 +120,22 @@ func (g *Generator) generateStruct(v *ast.Struct, outputDir string, packageName
return fmt.Errorf("failed to map field type: %w", err)
}

initializer := ""
switch field.Type.(type) {
case ast.SetType:
initializer = " = new HashSet<>();"
case ast.ListType:
initializer = " = new ArrayList<>();"
case ast.MapType:
initializer = " = new HashMap<>();"
}

fmt.Println(field.Name, initializer, typeStr)

fields = append(fields, Field{
Name: field.Name,
Type: typeStr,
Initializer: initializer,
})
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/v4_entity_generator/template/java_struct.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ import {{.}};
@Accessors(chain = true)
public class {{.ClassName}} {
{{- range .Fields}}
private {{.Type}} {{.Name}};
private {{.Type}} {{.Name}}{{.Initializer}};
{{- end}}
}
2 changes: 1 addition & 1 deletion src/gen/java/com/uber/cadence/BadBinaries.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
@Data
@Accessors(chain = true)
public class BadBinaries {
private Map<String, BadBinaryInfo> binaries;
private Map<String, BadBinaryInfo> binaries = new HashMap<>();;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
@Data
@Accessors(chain = true)
public class CrossClusterApplyParentClosePolicyRequestAttributes {
private List<ApplyParentClosePolicyRequest> children;
private List<ApplyParentClosePolicyRequest> children = new ArrayList<>();;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
@Data
@Accessors(chain = true)
public class CrossClusterApplyParentClosePolicyResponseAttributes {
private List<ApplyParentClosePolicyResult> childrenStatus;
private List<ApplyParentClosePolicyResult> childrenStatus = new ArrayList<>();;
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ public class CrossClusterStartChildExecutionRequestAttributes {
private long initiatedEventID;
private StartChildWorkflowExecutionInitiatedEventAttributes initiatedEventAttributes;
private String targetRunID;
private Map<String, String> partitionConfig;
private Map<String, String> partitionConfig = new HashMap<>();;
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
@Accessors(chain = true)
public class DescribeHistoryHostResponse {
private int numberOfShards;
private List<Integer> shardIDs;
private List<Integer> shardIDs = new ArrayList<>();;
private DomainCacheInfo domainCache;
private String shardControllerStatus;
private String address;
Expand Down
2 changes: 1 addition & 1 deletion src/gen/java/com/uber/cadence/DescribeQueueResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
@Data
@Accessors(chain = true)
public class DescribeQueueResponse {
private List<String> processingQueueStates;
private List<String> processingQueueStates = new ArrayList<>();;
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
@Accessors(chain = true)
public class DescribeShardDistributionResponse {
private int numberOfShards;
private Map<Integer, String> shards;
private Map<Integer, String> shards = new HashMap<>();;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
@Data
@Accessors(chain = true)
public class DescribeTaskListResponse {
private List<PollerInfo> pollers;
private List<PollerInfo> pollers = new ArrayList<>();;
private TaskListStatus taskListStatus;
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
public class DescribeWorkflowExecutionResponse {
private WorkflowExecutionConfiguration executionConfiguration;
private WorkflowExecutionInfo workflowExecutionInfo;
private List<PendingActivityInfo> pendingActivities;
private List<PendingChildExecutionInfo> pendingChildren;
private List<PendingActivityInfo> pendingActivities = new ArrayList<>();;
private List<PendingChildExecutionInfo> pendingChildren = new ArrayList<>();;
private PendingDecisionInfo pendingDecision;
}
2 changes: 1 addition & 1 deletion src/gen/java/com/uber/cadence/DomainInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ public class DomainInfo {
private DomainStatus status;
private String description;
private String ownerEmail;
private Map<String, String> data;
private Map<String, String> data = new HashMap<>();;
private String uuid;
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
@Accessors(chain = true)
public class DomainReplicationConfiguration {
private String activeClusterName;
private List<ClusterReplicationConfiguration> clusters;
private List<ClusterReplicationConfiguration> clusters = new ArrayList<>();;
}
2 changes: 1 addition & 1 deletion src/gen/java/com/uber/cadence/FailoverInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ public class FailoverInfo {
private long failoverStartTimestamp;
private long failoverExpireTimestamp;
private int completedShardCount;
private List<Integer> pendingShards;
private List<Integer> pendingShards = new ArrayList<>();;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
@Data
@Accessors(chain = true)
public class GetCrossClusterTasksRequest {
private List<Integer> shardIDs;
private List<Integer> shardIDs = new ArrayList<>();;
private String targetCluster;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
@Data
@Accessors(chain = true)
public class GetCrossClusterTasksResponse {
private Map<Integer, List<CrossClusterTaskRequest>> tasksByShard;
private Map<Integer, GetTaskFailedCause> failedCauseByShard;
private Map<Integer, List<CrossClusterTaskRequest>> tasksByShard = new HashMap<>();;
private Map<Integer, GetTaskFailedCause> failedCauseByShard = new HashMap<>();;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
@Data
@Accessors(chain = true)
public class GetSearchAttributesResponse {
private Map<String, IndexedValueType> keys;
private Map<String, IndexedValueType> keys = new HashMap<>();;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
@Data
@Accessors(chain = true)
public class GetTaskListsByDomainResponse {
private Map<String, DescribeTaskListResponse> decisionTaskListMap;
private Map<String, DescribeTaskListResponse> activityTaskListMap;
private Map<String, DescribeTaskListResponse> decisionTaskListMap = new HashMap<>();;
private Map<String, DescribeTaskListResponse> activityTaskListMap = new HashMap<>();;
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
@Accessors(chain = true)
public class GetWorkflowExecutionHistoryResponse {
private History history;
private List<DataBlob> rawHistory;
private List<DataBlob> rawHistory = new ArrayList<>();;
private byte[] nextPageToken;
private boolean archived;
}
2 changes: 1 addition & 1 deletion src/gen/java/com/uber/cadence/Header.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
@Data
@Accessors(chain = true)
public class Header {
private Map<String, byte[]> fields;
private Map<String, byte[]> fields = new HashMap<>();;
}
2 changes: 1 addition & 1 deletion src/gen/java/com/uber/cadence/History.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
@Data
@Accessors(chain = true)
public class History {
private List<HistoryEvent> events;
private List<HistoryEvent> events = new ArrayList<>();;
}
2 changes: 1 addition & 1 deletion src/gen/java/com/uber/cadence/HistoryBranch.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
public class HistoryBranch {
private String treeID;
private String branchID;
private List<HistoryBranchRange> ancestors;
private List<HistoryBranchRange> ancestors = new ArrayList<>();;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
@Data
@Accessors(chain = true)
public class IsolationGroupConfiguration {
private List<IsolationGroupPartition> isolationGroups;
private List<IsolationGroupPartition> isolationGroups = new ArrayList<>();;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
@Data
@Accessors(chain = true)
public class ListArchivedWorkflowExecutionsResponse {
private List<WorkflowExecutionInfo> executions;
private List<WorkflowExecutionInfo> executions = new ArrayList<>();;
private byte[] nextPageToken;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
@Data
@Accessors(chain = true)
public class ListClosedWorkflowExecutionsResponse {
private List<WorkflowExecutionInfo> executions;
private List<WorkflowExecutionInfo> executions = new ArrayList<>();;
private byte[] nextPageToken;
}
2 changes: 1 addition & 1 deletion src/gen/java/com/uber/cadence/ListDomainsResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
@Data
@Accessors(chain = true)
public class ListDomainsResponse {
private List<DescribeDomainResponse> domains;
private List<DescribeDomainResponse> domains = new ArrayList<>();;
private byte[] nextPageToken;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
@Data
@Accessors(chain = true)
public class ListOpenWorkflowExecutionsResponse {
private List<WorkflowExecutionInfo> executions;
private List<WorkflowExecutionInfo> executions = new ArrayList<>();;
private byte[] nextPageToken;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
@Data
@Accessors(chain = true)
public class ListTaskListPartitionsResponse {
private List<TaskListPartitionMetadata> activityTaskListPartitions;
private List<TaskListPartitionMetadata> decisionTaskListPartitions;
private List<TaskListPartitionMetadata> activityTaskListPartitions = new ArrayList<>();;
private List<TaskListPartitionMetadata> decisionTaskListPartitions = new ArrayList<>();;
}
Loading