Skip to content

Commit

Permalink
Scaffold the implementation of admin UpdateTaskListPartitionConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaddoll committed Nov 12, 2024
1 parent d2d1d47 commit d9b30a5
Show file tree
Hide file tree
Showing 34 changed files with 788 additions and 465 deletions.
408 changes: 207 additions & 201 deletions .gen/proto/history/v1/service.pb.yarpc.go

Large diffs are not rendered by default.

408 changes: 207 additions & 201 deletions .gen/proto/matching/v1/service.pb.yarpc.go

Large diffs are not rendered by default.

99 changes: 52 additions & 47 deletions .gen/proto/shared/v1/history.pb.yarpc.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions client/admin/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,5 @@ type Client interface {
UpdateDomainIsolationGroups(ctx context.Context, request *types.UpdateDomainIsolationGroupsRequest, opts ...yarpc.CallOption) (*types.UpdateDomainIsolationGroupsResponse, error)
GetDomainAsyncWorkflowConfiguraton(ctx context.Context, request *types.GetDomainAsyncWorkflowConfiguratonRequest, opts ...yarpc.CallOption) (*types.GetDomainAsyncWorkflowConfiguratonResponse, error)
UpdateDomainAsyncWorkflowConfiguraton(ctx context.Context, request *types.UpdateDomainAsyncWorkflowConfiguratonRequest, opts ...yarpc.CallOption) (*types.UpdateDomainAsyncWorkflowConfiguratonResponse, error)
UpdateTaskListPartitionConfig(ctx context.Context, request *types.UpdateTaskListPartitionConfigRequest, opts ...yarpc.CallOption) (*types.UpdateTaskListPartitionConfigResponse, error)
}
20 changes: 20 additions & 0 deletions client/admin/interface_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion client/templates/thrift.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import (
"github.com/uber/cadence/common/types/mapper/thrift"
)

{{$unsupportedMethods := list "CountDLQMessages" "UpdateTaskListPartitionConfig" "RefreshTaskListPartitionConfig"}}

{{$interfaceName := .Interface.Name}}
{{$clientName := (index .Vars "client")}}
{{ $decorator := (printf "%s%s" (down $clientName) .Interface.Name) }}
Expand All @@ -16,7 +18,7 @@ import (
{{$Request := printf "%sRequest" $method.Name}}
{{$Response := printf "%sResponse" $method.Name}}
func (g {{$decorator}}) {{$method.Declaration}} {
{{- if eq $method.Name "CountDLQMessages"}}
{{- if has $method.Name $unsupportedMethods}}
return nil, thrift.ToError(&types.BadRequestError{Message: "Feature not supported on TChannel"})
{{- else if or (eq $method.Name "AddDecisionTask") (eq $method.Name "AddActivityTask")}}
{{(index $method.Results 1).Name}} = g.c.{{$method.Name}}({{(index $method.Params 0).Name}}, thrift.From{{$prefix}}{{$Request}}({{(index $method.Params 1).Name}}), {{(index $method.Params 2).Pass}})
Expand Down
20 changes: 20 additions & 0 deletions client/wrappers/errorinjectors/admin_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions client/wrappers/grpc/admin_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions client/wrappers/metered/admin_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions client/wrappers/retryable/admin_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions client/wrappers/thrift/admin_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions client/wrappers/timeout/admin_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions common/log/tag/values.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ var (
AdminClientOperationUpdateDomainAsyncWorkflowConfiguraton = clientOperation("admin-update-domain-async-workflow-configuration")
AdminDeleteWorkflow = clientOperation("admin-delete-workflow")
MaintainCorruptWorkflow = clientOperation("maintain-corrupt-workflow")
AdminClientOperationUpdateTaskListPartitionConfig = clientOperation("admin-update-task-list-partition-config")

FrontendClientOperationDeprecateDomain = clientOperation("frontend-deprecate-domain")
FrontendClientOperationDescribeDomain = clientOperation("frontend-describe-domain")
Expand Down
3 changes: 3 additions & 0 deletions common/metrics/defs.go
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,8 @@ const (
AdminClientGetDomainAsyncWorkflowConfiguratonScope
// AdminClientGetWorkflowExecutionRawHistoryScope is the metric scope for admin.UpdateDomainAsyncWorkflowConfiguration
AdminClientUpdateDomainAsyncWorkflowConfiguratonScope
// AdminClientUpdateTaskListPartitionConfigScope is the metrics scope for admin.UpdateTaskListPartitionConfig
AdminClientUpdateTaskListPartitionConfigScope

// DCRedirectionDeprecateDomainScope tracks RPC calls for dc redirection
DCRedirectionDeprecateDomainScope
Expand Down Expand Up @@ -1627,6 +1629,7 @@ var ScopeDefs = map[ServiceIdx]map[int]scopeDefinition{
AdminClientGetReplicationMessagesScope: {operation: "AdminClientGetReplicationMessages", tags: map[string]string{CadenceRoleTagName: AdminClientRoleTagValue}},
AdminClientGetDomainAsyncWorkflowConfiguratonScope: {operation: "AdminClientGetDomainAsyncWorkflowConfiguraton", tags: map[string]string{CadenceRoleTagName: AdminClientRoleTagValue}},
AdminClientUpdateDomainAsyncWorkflowConfiguratonScope: {operation: "AdminClientUpdateDomainAsyncWorkflowConfiguraton", tags: map[string]string{CadenceRoleTagName: AdminClientRoleTagValue}},
AdminClientUpdateTaskListPartitionConfigScope: {operation: "AdminClientUpdateTaskListPartitionConfig", tags: map[string]string{CadenceRoleTagName: AdminClientRoleTagValue}},

DCRedirectionDeprecateDomainScope: {operation: "DCRedirectionDeprecateDomain", tags: map[string]string{CadenceRoleTagName: DCRedirectionRoleTagValue}},
DCRedirectionDescribeDomainScope: {operation: "DCRedirectionDescribeDomain", tags: map[string]string{CadenceRoleTagName: DCRedirectionRoleTagValue}},
Expand Down
9 changes: 9 additions & 0 deletions common/types/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -429,3 +429,12 @@ type UpdateDomainAsyncWorkflowConfiguratonRequest struct {

type UpdateDomainAsyncWorkflowConfiguratonResponse struct {
}

type UpdateTaskListPartitionConfigRequest struct {
Domain string
TaskList *TaskList
TaskListType *TaskListType
PartitionConfig *TaskListPartitionConfig
}

type UpdateTaskListPartitionConfigResponse struct{}
Loading

0 comments on commit d9b30a5

Please sign in to comment.