From 2cb47c1bbc554e8701c167c0df6d20cfa1f7ca85 Mon Sep 17 00:00:00 2001 From: Vytautas Date: Fri, 6 Nov 2020 14:48:04 +0200 Subject: [PATCH] Frontend client internal types (#3711) --- client/frontend/client.go | 124 +-- client/frontend/interface.go | 80 +- client/frontend/interface_mock.go | 807 ++++++++++++++++++ client/frontend/metricClient.go | 124 +-- client/frontend/retryableClient.go | 174 ++-- client/frontend/thriftClient.go | 193 +++-- common/resource/resourceTest.go | 9 +- service/frontend/dcRedirectionHandler.go | 114 ++- service/frontend/dcRedirectionHandler_test.go | 68 +- service/frontend/workflowHandler.go | 4 +- service/worker/batcher/workflow.go | 58 +- service/worker/failovermanager/workflow.go | 16 +- .../worker/failovermanager/workflow_test.go | 52 +- 13 files changed, 1362 insertions(+), 461 deletions(-) create mode 100644 client/frontend/interface_mock.go diff --git a/client/frontend/client.go b/client/frontend/client.go index a53c258fb76..485b9a1f936 100644 --- a/client/frontend/client.go +++ b/client/frontend/client.go @@ -27,8 +27,8 @@ import ( "github.com/pborman/uuid" "go.uber.org/yarpc" - "github.com/uber/cadence/.gen/go/shared" "github.com/uber/cadence/common" + "github.com/uber/cadence/common/types" ) var _ Client = (*clientImpl)(nil) @@ -61,7 +61,7 @@ func NewClient( func (c *clientImpl) DeprecateDomain( ctx context.Context, - request *shared.DeprecateDomainRequest, + request *types.DeprecateDomainRequest, opts ...yarpc.CallOption, ) error { @@ -77,9 +77,9 @@ func (c *clientImpl) DeprecateDomain( func (c *clientImpl) DescribeDomain( ctx context.Context, - request *shared.DescribeDomainRequest, + request *types.DescribeDomainRequest, opts ...yarpc.CallOption, -) (*shared.DescribeDomainResponse, error) { +) (*types.DescribeDomainResponse, error) { opts = common.AggregateYarpcOptions(ctx, opts...) client, err := c.getRandomClient() @@ -93,9 +93,9 @@ func (c *clientImpl) DescribeDomain( func (c *clientImpl) DescribeTaskList( ctx context.Context, - request *shared.DescribeTaskListRequest, + request *types.DescribeTaskListRequest, opts ...yarpc.CallOption, -) (*shared.DescribeTaskListResponse, error) { +) (*types.DescribeTaskListResponse, error) { opts = common.AggregateYarpcOptions(ctx, opts...) client, err := c.getRandomClient() @@ -109,9 +109,9 @@ func (c *clientImpl) DescribeTaskList( func (c *clientImpl) DescribeWorkflowExecution( ctx context.Context, - request *shared.DescribeWorkflowExecutionRequest, + request *types.DescribeWorkflowExecutionRequest, opts ...yarpc.CallOption, -) (*shared.DescribeWorkflowExecutionResponse, error) { +) (*types.DescribeWorkflowExecutionResponse, error) { opts = common.AggregateYarpcOptions(ctx, opts...) client, err := c.getRandomClient() @@ -125,9 +125,9 @@ func (c *clientImpl) DescribeWorkflowExecution( func (c *clientImpl) GetWorkflowExecutionHistory( ctx context.Context, - request *shared.GetWorkflowExecutionHistoryRequest, + request *types.GetWorkflowExecutionHistoryRequest, opts ...yarpc.CallOption, -) (*shared.GetWorkflowExecutionHistoryResponse, error) { +) (*types.GetWorkflowExecutionHistoryResponse, error) { opts = common.AggregateYarpcOptions(ctx, opts...) client, err := c.getRandomClient() @@ -141,9 +141,9 @@ func (c *clientImpl) GetWorkflowExecutionHistory( func (c *clientImpl) ListArchivedWorkflowExecutions( ctx context.Context, - request *shared.ListArchivedWorkflowExecutionsRequest, + request *types.ListArchivedWorkflowExecutionsRequest, opts ...yarpc.CallOption, -) (*shared.ListArchivedWorkflowExecutionsResponse, error) { +) (*types.ListArchivedWorkflowExecutionsResponse, error) { opts = common.AggregateYarpcOptions(ctx, opts...) client, err := c.getRandomClient() @@ -157,9 +157,9 @@ func (c *clientImpl) ListArchivedWorkflowExecutions( func (c *clientImpl) ListClosedWorkflowExecutions( ctx context.Context, - request *shared.ListClosedWorkflowExecutionsRequest, + request *types.ListClosedWorkflowExecutionsRequest, opts ...yarpc.CallOption, -) (*shared.ListClosedWorkflowExecutionsResponse, error) { +) (*types.ListClosedWorkflowExecutionsResponse, error) { opts = common.AggregateYarpcOptions(ctx, opts...) client, err := c.getRandomClient() @@ -173,9 +173,9 @@ func (c *clientImpl) ListClosedWorkflowExecutions( func (c *clientImpl) ListDomains( ctx context.Context, - request *shared.ListDomainsRequest, + request *types.ListDomainsRequest, opts ...yarpc.CallOption, -) (*shared.ListDomainsResponse, error) { +) (*types.ListDomainsResponse, error) { opts = common.AggregateYarpcOptions(ctx, opts...) client, err := c.getRandomClient() @@ -189,9 +189,9 @@ func (c *clientImpl) ListDomains( func (c *clientImpl) ListOpenWorkflowExecutions( ctx context.Context, - request *shared.ListOpenWorkflowExecutionsRequest, + request *types.ListOpenWorkflowExecutionsRequest, opts ...yarpc.CallOption, -) (*shared.ListOpenWorkflowExecutionsResponse, error) { +) (*types.ListOpenWorkflowExecutionsResponse, error) { opts = common.AggregateYarpcOptions(ctx, opts...) client, err := c.getRandomClient() @@ -205,9 +205,9 @@ func (c *clientImpl) ListOpenWorkflowExecutions( func (c *clientImpl) ListWorkflowExecutions( ctx context.Context, - request *shared.ListWorkflowExecutionsRequest, + request *types.ListWorkflowExecutionsRequest, opts ...yarpc.CallOption, -) (*shared.ListWorkflowExecutionsResponse, error) { +) (*types.ListWorkflowExecutionsResponse, error) { opts = common.AggregateYarpcOptions(ctx, opts...) client, err := c.getRandomClient() @@ -221,9 +221,9 @@ func (c *clientImpl) ListWorkflowExecutions( func (c *clientImpl) ScanWorkflowExecutions( ctx context.Context, - request *shared.ListWorkflowExecutionsRequest, + request *types.ListWorkflowExecutionsRequest, opts ...yarpc.CallOption, -) (*shared.ListWorkflowExecutionsResponse, error) { +) (*types.ListWorkflowExecutionsResponse, error) { opts = common.AggregateYarpcOptions(ctx, opts...) client, err := c.getRandomClient() @@ -237,9 +237,9 @@ func (c *clientImpl) ScanWorkflowExecutions( func (c *clientImpl) CountWorkflowExecutions( ctx context.Context, - request *shared.CountWorkflowExecutionsRequest, + request *types.CountWorkflowExecutionsRequest, opts ...yarpc.CallOption, -) (*shared.CountWorkflowExecutionsResponse, error) { +) (*types.CountWorkflowExecutionsResponse, error) { opts = common.AggregateYarpcOptions(ctx, opts...) client, err := c.getRandomClient() @@ -254,7 +254,7 @@ func (c *clientImpl) CountWorkflowExecutions( func (c *clientImpl) GetSearchAttributes( ctx context.Context, opts ...yarpc.CallOption, -) (*shared.GetSearchAttributesResponse, error) { +) (*types.GetSearchAttributesResponse, error) { opts = common.AggregateYarpcOptions(ctx, opts...) client, err := c.getRandomClient() @@ -268,9 +268,9 @@ func (c *clientImpl) GetSearchAttributes( func (c *clientImpl) PollForActivityTask( ctx context.Context, - request *shared.PollForActivityTaskRequest, + request *types.PollForActivityTaskRequest, opts ...yarpc.CallOption, -) (*shared.PollForActivityTaskResponse, error) { +) (*types.PollForActivityTaskResponse, error) { opts = common.AggregateYarpcOptions(ctx, opts...) client, err := c.getRandomClient() @@ -284,9 +284,9 @@ func (c *clientImpl) PollForActivityTask( func (c *clientImpl) PollForDecisionTask( ctx context.Context, - request *shared.PollForDecisionTaskRequest, + request *types.PollForDecisionTaskRequest, opts ...yarpc.CallOption, -) (*shared.PollForDecisionTaskResponse, error) { +) (*types.PollForDecisionTaskResponse, error) { opts = common.AggregateYarpcOptions(ctx, opts...) client, err := c.getRandomClient() @@ -300,9 +300,9 @@ func (c *clientImpl) PollForDecisionTask( func (c *clientImpl) QueryWorkflow( ctx context.Context, - request *shared.QueryWorkflowRequest, + request *types.QueryWorkflowRequest, opts ...yarpc.CallOption, -) (*shared.QueryWorkflowResponse, error) { +) (*types.QueryWorkflowResponse, error) { opts = common.AggregateYarpcOptions(ctx, opts...) client, err := c.getRandomClient() @@ -316,9 +316,9 @@ func (c *clientImpl) QueryWorkflow( func (c *clientImpl) RecordActivityTaskHeartbeat( ctx context.Context, - request *shared.RecordActivityTaskHeartbeatRequest, + request *types.RecordActivityTaskHeartbeatRequest, opts ...yarpc.CallOption, -) (*shared.RecordActivityTaskHeartbeatResponse, error) { +) (*types.RecordActivityTaskHeartbeatResponse, error) { opts = common.AggregateYarpcOptions(ctx, opts...) client, err := c.getRandomClient() @@ -332,9 +332,9 @@ func (c *clientImpl) RecordActivityTaskHeartbeat( func (c *clientImpl) RecordActivityTaskHeartbeatByID( ctx context.Context, - request *shared.RecordActivityTaskHeartbeatByIDRequest, + request *types.RecordActivityTaskHeartbeatByIDRequest, opts ...yarpc.CallOption, -) (*shared.RecordActivityTaskHeartbeatResponse, error) { +) (*types.RecordActivityTaskHeartbeatResponse, error) { opts = common.AggregateYarpcOptions(ctx, opts...) client, err := c.getRandomClient() @@ -348,7 +348,7 @@ func (c *clientImpl) RecordActivityTaskHeartbeatByID( func (c *clientImpl) RegisterDomain( ctx context.Context, - request *shared.RegisterDomainRequest, + request *types.RegisterDomainRequest, opts ...yarpc.CallOption, ) error { @@ -364,7 +364,7 @@ func (c *clientImpl) RegisterDomain( func (c *clientImpl) RequestCancelWorkflowExecution( ctx context.Context, - request *shared.RequestCancelWorkflowExecutionRequest, + request *types.RequestCancelWorkflowExecutionRequest, opts ...yarpc.CallOption, ) error { @@ -380,9 +380,9 @@ func (c *clientImpl) RequestCancelWorkflowExecution( func (c *clientImpl) ResetStickyTaskList( ctx context.Context, - request *shared.ResetStickyTaskListRequest, + request *types.ResetStickyTaskListRequest, opts ...yarpc.CallOption, -) (*shared.ResetStickyTaskListResponse, error) { +) (*types.ResetStickyTaskListResponse, error) { opts = common.AggregateYarpcOptions(ctx, opts...) client, err := c.getRandomClient() @@ -396,9 +396,9 @@ func (c *clientImpl) ResetStickyTaskList( func (c *clientImpl) ResetWorkflowExecution( ctx context.Context, - request *shared.ResetWorkflowExecutionRequest, + request *types.ResetWorkflowExecutionRequest, opts ...yarpc.CallOption, -) (*shared.ResetWorkflowExecutionResponse, error) { +) (*types.ResetWorkflowExecutionResponse, error) { opts = common.AggregateYarpcOptions(ctx, opts...) client, err := c.getRandomClient() @@ -412,7 +412,7 @@ func (c *clientImpl) ResetWorkflowExecution( func (c *clientImpl) RespondActivityTaskCanceled( ctx context.Context, - request *shared.RespondActivityTaskCanceledRequest, + request *types.RespondActivityTaskCanceledRequest, opts ...yarpc.CallOption, ) error { @@ -428,7 +428,7 @@ func (c *clientImpl) RespondActivityTaskCanceled( func (c *clientImpl) RespondActivityTaskCanceledByID( ctx context.Context, - request *shared.RespondActivityTaskCanceledByIDRequest, + request *types.RespondActivityTaskCanceledByIDRequest, opts ...yarpc.CallOption, ) error { @@ -444,7 +444,7 @@ func (c *clientImpl) RespondActivityTaskCanceledByID( func (c *clientImpl) RespondActivityTaskCompleted( ctx context.Context, - request *shared.RespondActivityTaskCompletedRequest, + request *types.RespondActivityTaskCompletedRequest, opts ...yarpc.CallOption, ) error { @@ -460,7 +460,7 @@ func (c *clientImpl) RespondActivityTaskCompleted( func (c *clientImpl) RespondActivityTaskCompletedByID( ctx context.Context, - request *shared.RespondActivityTaskCompletedByIDRequest, + request *types.RespondActivityTaskCompletedByIDRequest, opts ...yarpc.CallOption, ) error { @@ -476,7 +476,7 @@ func (c *clientImpl) RespondActivityTaskCompletedByID( func (c *clientImpl) RespondActivityTaskFailed( ctx context.Context, - request *shared.RespondActivityTaskFailedRequest, + request *types.RespondActivityTaskFailedRequest, opts ...yarpc.CallOption, ) error { @@ -492,7 +492,7 @@ func (c *clientImpl) RespondActivityTaskFailed( func (c *clientImpl) RespondActivityTaskFailedByID( ctx context.Context, - request *shared.RespondActivityTaskFailedByIDRequest, + request *types.RespondActivityTaskFailedByIDRequest, opts ...yarpc.CallOption, ) error { @@ -508,9 +508,9 @@ func (c *clientImpl) RespondActivityTaskFailedByID( func (c *clientImpl) RespondDecisionTaskCompleted( ctx context.Context, - request *shared.RespondDecisionTaskCompletedRequest, + request *types.RespondDecisionTaskCompletedRequest, opts ...yarpc.CallOption, -) (*shared.RespondDecisionTaskCompletedResponse, error) { +) (*types.RespondDecisionTaskCompletedResponse, error) { opts = common.AggregateYarpcOptions(ctx, opts...) client, err := c.getRandomClient() @@ -524,7 +524,7 @@ func (c *clientImpl) RespondDecisionTaskCompleted( func (c *clientImpl) RespondDecisionTaskFailed( ctx context.Context, - request *shared.RespondDecisionTaskFailedRequest, + request *types.RespondDecisionTaskFailedRequest, opts ...yarpc.CallOption, ) error { @@ -540,7 +540,7 @@ func (c *clientImpl) RespondDecisionTaskFailed( func (c *clientImpl) RespondQueryTaskCompleted( ctx context.Context, - request *shared.RespondQueryTaskCompletedRequest, + request *types.RespondQueryTaskCompletedRequest, opts ...yarpc.CallOption, ) error { @@ -556,9 +556,9 @@ func (c *clientImpl) RespondQueryTaskCompleted( func (c *clientImpl) SignalWithStartWorkflowExecution( ctx context.Context, - request *shared.SignalWithStartWorkflowExecutionRequest, + request *types.SignalWithStartWorkflowExecutionRequest, opts ...yarpc.CallOption, -) (*shared.StartWorkflowExecutionResponse, error) { +) (*types.StartWorkflowExecutionResponse, error) { opts = common.AggregateYarpcOptions(ctx, opts...) client, err := c.getRandomClient() @@ -572,7 +572,7 @@ func (c *clientImpl) SignalWithStartWorkflowExecution( func (c *clientImpl) SignalWorkflowExecution( ctx context.Context, - request *shared.SignalWorkflowExecutionRequest, + request *types.SignalWorkflowExecutionRequest, opts ...yarpc.CallOption, ) error { @@ -588,9 +588,9 @@ func (c *clientImpl) SignalWorkflowExecution( func (c *clientImpl) StartWorkflowExecution( ctx context.Context, - request *shared.StartWorkflowExecutionRequest, + request *types.StartWorkflowExecutionRequest, opts ...yarpc.CallOption, -) (*shared.StartWorkflowExecutionResponse, error) { +) (*types.StartWorkflowExecutionResponse, error) { opts = common.AggregateYarpcOptions(ctx, opts...) client, err := c.getRandomClient() @@ -604,7 +604,7 @@ func (c *clientImpl) StartWorkflowExecution( func (c *clientImpl) TerminateWorkflowExecution( ctx context.Context, - request *shared.TerminateWorkflowExecutionRequest, + request *types.TerminateWorkflowExecutionRequest, opts ...yarpc.CallOption, ) error { @@ -620,9 +620,9 @@ func (c *clientImpl) TerminateWorkflowExecution( func (c *clientImpl) UpdateDomain( ctx context.Context, - request *shared.UpdateDomainRequest, + request *types.UpdateDomainRequest, opts ...yarpc.CallOption, -) (*shared.UpdateDomainResponse, error) { +) (*types.UpdateDomainResponse, error) { opts = common.AggregateYarpcOptions(ctx, opts...) client, err := c.getRandomClient() @@ -662,7 +662,7 @@ func (c *clientImpl) getRandomClient() (Client, error) { func (c *clientImpl) GetClusterInfo( ctx context.Context, opts ...yarpc.CallOption, -) (*shared.ClusterInfo, error) { +) (*types.ClusterInfo, error) { opts = common.AggregateYarpcOptions(ctx, opts...) client, err := c.getRandomClient() @@ -676,9 +676,9 @@ func (c *clientImpl) GetClusterInfo( func (c *clientImpl) ListTaskListPartitions( ctx context.Context, - request *shared.ListTaskListPartitionsRequest, + request *types.ListTaskListPartitionsRequest, opts ...yarpc.CallOption, -) (*shared.ListTaskListPartitionsResponse, error) { +) (*types.ListTaskListPartitionsResponse, error) { opts = common.AggregateYarpcOptions(ctx, opts...) client, err := c.getRandomClient() diff --git a/client/frontend/interface.go b/client/frontend/interface.go index fc8db23c5da..ead9d3747e7 100644 --- a/client/frontend/interface.go +++ b/client/frontend/interface.go @@ -25,47 +25,49 @@ import ( "go.uber.org/yarpc" - "github.com/uber/cadence/.gen/go/shared" + "github.com/uber/cadence/common/types" ) +//go:generate mockgen -package $GOPACKAGE -source $GOFILE -destination interface_mock.go -self_package github.com/uber/cadence/client/frontend + // Client is the interface exposed by frontend service client type Client interface { - CountWorkflowExecutions(context.Context, *shared.CountWorkflowExecutionsRequest, ...yarpc.CallOption) (*shared.CountWorkflowExecutionsResponse, error) - DeprecateDomain(context.Context, *shared.DeprecateDomainRequest, ...yarpc.CallOption) error - DescribeDomain(context.Context, *shared.DescribeDomainRequest, ...yarpc.CallOption) (*shared.DescribeDomainResponse, error) - DescribeTaskList(context.Context, *shared.DescribeTaskListRequest, ...yarpc.CallOption) (*shared.DescribeTaskListResponse, error) - DescribeWorkflowExecution(context.Context, *shared.DescribeWorkflowExecutionRequest, ...yarpc.CallOption) (*shared.DescribeWorkflowExecutionResponse, error) - GetClusterInfo(context.Context, ...yarpc.CallOption) (*shared.ClusterInfo, error) - GetSearchAttributes(context.Context, ...yarpc.CallOption) (*shared.GetSearchAttributesResponse, error) - GetWorkflowExecutionHistory(context.Context, *shared.GetWorkflowExecutionHistoryRequest, ...yarpc.CallOption) (*shared.GetWorkflowExecutionHistoryResponse, error) - ListArchivedWorkflowExecutions(context.Context, *shared.ListArchivedWorkflowExecutionsRequest, ...yarpc.CallOption) (*shared.ListArchivedWorkflowExecutionsResponse, error) - ListClosedWorkflowExecutions(context.Context, *shared.ListClosedWorkflowExecutionsRequest, ...yarpc.CallOption) (*shared.ListClosedWorkflowExecutionsResponse, error) - ListDomains(context.Context, *shared.ListDomainsRequest, ...yarpc.CallOption) (*shared.ListDomainsResponse, error) - ListOpenWorkflowExecutions(context.Context, *shared.ListOpenWorkflowExecutionsRequest, ...yarpc.CallOption) (*shared.ListOpenWorkflowExecutionsResponse, error) - ListTaskListPartitions(context.Context, *shared.ListTaskListPartitionsRequest, ...yarpc.CallOption) (*shared.ListTaskListPartitionsResponse, error) - ListWorkflowExecutions(context.Context, *shared.ListWorkflowExecutionsRequest, ...yarpc.CallOption) (*shared.ListWorkflowExecutionsResponse, error) - PollForActivityTask(context.Context, *shared.PollForActivityTaskRequest, ...yarpc.CallOption) (*shared.PollForActivityTaskResponse, error) - PollForDecisionTask(context.Context, *shared.PollForDecisionTaskRequest, ...yarpc.CallOption) (*shared.PollForDecisionTaskResponse, error) - QueryWorkflow(context.Context, *shared.QueryWorkflowRequest, ...yarpc.CallOption) (*shared.QueryWorkflowResponse, error) - RecordActivityTaskHeartbeat(context.Context, *shared.RecordActivityTaskHeartbeatRequest, ...yarpc.CallOption) (*shared.RecordActivityTaskHeartbeatResponse, error) - RecordActivityTaskHeartbeatByID(context.Context, *shared.RecordActivityTaskHeartbeatByIDRequest, ...yarpc.CallOption) (*shared.RecordActivityTaskHeartbeatResponse, error) - RegisterDomain(context.Context, *shared.RegisterDomainRequest, ...yarpc.CallOption) error - RequestCancelWorkflowExecution(context.Context, *shared.RequestCancelWorkflowExecutionRequest, ...yarpc.CallOption) error - ResetStickyTaskList(context.Context, *shared.ResetStickyTaskListRequest, ...yarpc.CallOption) (*shared.ResetStickyTaskListResponse, error) - ResetWorkflowExecution(context.Context, *shared.ResetWorkflowExecutionRequest, ...yarpc.CallOption) (*shared.ResetWorkflowExecutionResponse, error) - RespondActivityTaskCanceled(context.Context, *shared.RespondActivityTaskCanceledRequest, ...yarpc.CallOption) error - RespondActivityTaskCanceledByID(context.Context, *shared.RespondActivityTaskCanceledByIDRequest, ...yarpc.CallOption) error - RespondActivityTaskCompleted(context.Context, *shared.RespondActivityTaskCompletedRequest, ...yarpc.CallOption) error - RespondActivityTaskCompletedByID(context.Context, *shared.RespondActivityTaskCompletedByIDRequest, ...yarpc.CallOption) error - RespondActivityTaskFailed(context.Context, *shared.RespondActivityTaskFailedRequest, ...yarpc.CallOption) error - RespondActivityTaskFailedByID(context.Context, *shared.RespondActivityTaskFailedByIDRequest, ...yarpc.CallOption) error - RespondDecisionTaskCompleted(context.Context, *shared.RespondDecisionTaskCompletedRequest, ...yarpc.CallOption) (*shared.RespondDecisionTaskCompletedResponse, error) - RespondDecisionTaskFailed(context.Context, *shared.RespondDecisionTaskFailedRequest, ...yarpc.CallOption) error - RespondQueryTaskCompleted(context.Context, *shared.RespondQueryTaskCompletedRequest, ...yarpc.CallOption) error - ScanWorkflowExecutions(context.Context, *shared.ListWorkflowExecutionsRequest, ...yarpc.CallOption) (*shared.ListWorkflowExecutionsResponse, error) - SignalWithStartWorkflowExecution(context.Context, *shared.SignalWithStartWorkflowExecutionRequest, ...yarpc.CallOption) (*shared.StartWorkflowExecutionResponse, error) - SignalWorkflowExecution(context.Context, *shared.SignalWorkflowExecutionRequest, ...yarpc.CallOption) error - StartWorkflowExecution(context.Context, *shared.StartWorkflowExecutionRequest, ...yarpc.CallOption) (*shared.StartWorkflowExecutionResponse, error) - TerminateWorkflowExecution(context.Context, *shared.TerminateWorkflowExecutionRequest, ...yarpc.CallOption) error - UpdateDomain(context.Context, *shared.UpdateDomainRequest, ...yarpc.CallOption) (*shared.UpdateDomainResponse, error) + CountWorkflowExecutions(context.Context, *types.CountWorkflowExecutionsRequest, ...yarpc.CallOption) (*types.CountWorkflowExecutionsResponse, error) + DeprecateDomain(context.Context, *types.DeprecateDomainRequest, ...yarpc.CallOption) error + DescribeDomain(context.Context, *types.DescribeDomainRequest, ...yarpc.CallOption) (*types.DescribeDomainResponse, error) + DescribeTaskList(context.Context, *types.DescribeTaskListRequest, ...yarpc.CallOption) (*types.DescribeTaskListResponse, error) + DescribeWorkflowExecution(context.Context, *types.DescribeWorkflowExecutionRequest, ...yarpc.CallOption) (*types.DescribeWorkflowExecutionResponse, error) + GetClusterInfo(context.Context, ...yarpc.CallOption) (*types.ClusterInfo, error) + GetSearchAttributes(context.Context, ...yarpc.CallOption) (*types.GetSearchAttributesResponse, error) + GetWorkflowExecutionHistory(context.Context, *types.GetWorkflowExecutionHistoryRequest, ...yarpc.CallOption) (*types.GetWorkflowExecutionHistoryResponse, error) + ListArchivedWorkflowExecutions(context.Context, *types.ListArchivedWorkflowExecutionsRequest, ...yarpc.CallOption) (*types.ListArchivedWorkflowExecutionsResponse, error) + ListClosedWorkflowExecutions(context.Context, *types.ListClosedWorkflowExecutionsRequest, ...yarpc.CallOption) (*types.ListClosedWorkflowExecutionsResponse, error) + ListDomains(context.Context, *types.ListDomainsRequest, ...yarpc.CallOption) (*types.ListDomainsResponse, error) + ListOpenWorkflowExecutions(context.Context, *types.ListOpenWorkflowExecutionsRequest, ...yarpc.CallOption) (*types.ListOpenWorkflowExecutionsResponse, error) + ListTaskListPartitions(context.Context, *types.ListTaskListPartitionsRequest, ...yarpc.CallOption) (*types.ListTaskListPartitionsResponse, error) + ListWorkflowExecutions(context.Context, *types.ListWorkflowExecutionsRequest, ...yarpc.CallOption) (*types.ListWorkflowExecutionsResponse, error) + PollForActivityTask(context.Context, *types.PollForActivityTaskRequest, ...yarpc.CallOption) (*types.PollForActivityTaskResponse, error) + PollForDecisionTask(context.Context, *types.PollForDecisionTaskRequest, ...yarpc.CallOption) (*types.PollForDecisionTaskResponse, error) + QueryWorkflow(context.Context, *types.QueryWorkflowRequest, ...yarpc.CallOption) (*types.QueryWorkflowResponse, error) + RecordActivityTaskHeartbeat(context.Context, *types.RecordActivityTaskHeartbeatRequest, ...yarpc.CallOption) (*types.RecordActivityTaskHeartbeatResponse, error) + RecordActivityTaskHeartbeatByID(context.Context, *types.RecordActivityTaskHeartbeatByIDRequest, ...yarpc.CallOption) (*types.RecordActivityTaskHeartbeatResponse, error) + RegisterDomain(context.Context, *types.RegisterDomainRequest, ...yarpc.CallOption) error + RequestCancelWorkflowExecution(context.Context, *types.RequestCancelWorkflowExecutionRequest, ...yarpc.CallOption) error + ResetStickyTaskList(context.Context, *types.ResetStickyTaskListRequest, ...yarpc.CallOption) (*types.ResetStickyTaskListResponse, error) + ResetWorkflowExecution(context.Context, *types.ResetWorkflowExecutionRequest, ...yarpc.CallOption) (*types.ResetWorkflowExecutionResponse, error) + RespondActivityTaskCanceled(context.Context, *types.RespondActivityTaskCanceledRequest, ...yarpc.CallOption) error + RespondActivityTaskCanceledByID(context.Context, *types.RespondActivityTaskCanceledByIDRequest, ...yarpc.CallOption) error + RespondActivityTaskCompleted(context.Context, *types.RespondActivityTaskCompletedRequest, ...yarpc.CallOption) error + RespondActivityTaskCompletedByID(context.Context, *types.RespondActivityTaskCompletedByIDRequest, ...yarpc.CallOption) error + RespondActivityTaskFailed(context.Context, *types.RespondActivityTaskFailedRequest, ...yarpc.CallOption) error + RespondActivityTaskFailedByID(context.Context, *types.RespondActivityTaskFailedByIDRequest, ...yarpc.CallOption) error + RespondDecisionTaskCompleted(context.Context, *types.RespondDecisionTaskCompletedRequest, ...yarpc.CallOption) (*types.RespondDecisionTaskCompletedResponse, error) + RespondDecisionTaskFailed(context.Context, *types.RespondDecisionTaskFailedRequest, ...yarpc.CallOption) error + RespondQueryTaskCompleted(context.Context, *types.RespondQueryTaskCompletedRequest, ...yarpc.CallOption) error + ScanWorkflowExecutions(context.Context, *types.ListWorkflowExecutionsRequest, ...yarpc.CallOption) (*types.ListWorkflowExecutionsResponse, error) + SignalWithStartWorkflowExecution(context.Context, *types.SignalWithStartWorkflowExecutionRequest, ...yarpc.CallOption) (*types.StartWorkflowExecutionResponse, error) + SignalWorkflowExecution(context.Context, *types.SignalWorkflowExecutionRequest, ...yarpc.CallOption) error + StartWorkflowExecution(context.Context, *types.StartWorkflowExecutionRequest, ...yarpc.CallOption) (*types.StartWorkflowExecutionResponse, error) + TerminateWorkflowExecution(context.Context, *types.TerminateWorkflowExecutionRequest, ...yarpc.CallOption) error + UpdateDomain(context.Context, *types.UpdateDomainRequest, ...yarpc.CallOption) (*types.UpdateDomainResponse, error) } diff --git a/client/frontend/interface_mock.go b/client/frontend/interface_mock.go new file mode 100644 index 00000000000..1aec844762e --- /dev/null +++ b/client/frontend/interface_mock.go @@ -0,0 +1,807 @@ +// The MIT License (MIT) + +// Copyright (c) 2017-2020 Uber Technologies Inc. + +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +// Code generated by MockGen. DO NOT EDIT. +// Source: interface.go + +// Package frontend is a generated GoMock package. +package frontend + +import ( + context "context" + reflect "reflect" + + gomock "github.com/golang/mock/gomock" + yarpc "go.uber.org/yarpc" + + types "github.com/uber/cadence/common/types" +) + +// MockClient is a mock of Client interface +type MockClient struct { + ctrl *gomock.Controller + recorder *MockClientMockRecorder +} + +// MockClientMockRecorder is the mock recorder for MockClient +type MockClientMockRecorder struct { + mock *MockClient +} + +// NewMockClient creates a new mock instance +func NewMockClient(ctrl *gomock.Controller) *MockClient { + mock := &MockClient{ctrl: ctrl} + mock.recorder = &MockClientMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use +func (m *MockClient) EXPECT() *MockClientMockRecorder { + return m.recorder +} + +// CountWorkflowExecutions mocks base method +func (m *MockClient) CountWorkflowExecutions(arg0 context.Context, arg1 *types.CountWorkflowExecutionsRequest, arg2 ...yarpc.CallOption) (*types.CountWorkflowExecutionsResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "CountWorkflowExecutions", varargs...) + ret0, _ := ret[0].(*types.CountWorkflowExecutionsResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CountWorkflowExecutions indicates an expected call of CountWorkflowExecutions +func (mr *MockClientMockRecorder) CountWorkflowExecutions(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CountWorkflowExecutions", reflect.TypeOf((*MockClient)(nil).CountWorkflowExecutions), varargs...) +} + +// DeprecateDomain mocks base method +func (m *MockClient) DeprecateDomain(arg0 context.Context, arg1 *types.DeprecateDomainRequest, arg2 ...yarpc.CallOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeprecateDomain", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeprecateDomain indicates an expected call of DeprecateDomain +func (mr *MockClientMockRecorder) DeprecateDomain(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeprecateDomain", reflect.TypeOf((*MockClient)(nil).DeprecateDomain), varargs...) +} + +// DescribeDomain mocks base method +func (m *MockClient) DescribeDomain(arg0 context.Context, arg1 *types.DescribeDomainRequest, arg2 ...yarpc.CallOption) (*types.DescribeDomainResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribeDomain", varargs...) + ret0, _ := ret[0].(*types.DescribeDomainResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DescribeDomain indicates an expected call of DescribeDomain +func (mr *MockClientMockRecorder) DescribeDomain(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeDomain", reflect.TypeOf((*MockClient)(nil).DescribeDomain), varargs...) +} + +// DescribeTaskList mocks base method +func (m *MockClient) DescribeTaskList(arg0 context.Context, arg1 *types.DescribeTaskListRequest, arg2 ...yarpc.CallOption) (*types.DescribeTaskListResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribeTaskList", varargs...) + ret0, _ := ret[0].(*types.DescribeTaskListResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DescribeTaskList indicates an expected call of DescribeTaskList +func (mr *MockClientMockRecorder) DescribeTaskList(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeTaskList", reflect.TypeOf((*MockClient)(nil).DescribeTaskList), varargs...) +} + +// DescribeWorkflowExecution mocks base method +func (m *MockClient) DescribeWorkflowExecution(arg0 context.Context, arg1 *types.DescribeWorkflowExecutionRequest, arg2 ...yarpc.CallOption) (*types.DescribeWorkflowExecutionResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribeWorkflowExecution", varargs...) + ret0, _ := ret[0].(*types.DescribeWorkflowExecutionResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DescribeWorkflowExecution indicates an expected call of DescribeWorkflowExecution +func (mr *MockClientMockRecorder) DescribeWorkflowExecution(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeWorkflowExecution", reflect.TypeOf((*MockClient)(nil).DescribeWorkflowExecution), varargs...) +} + +// GetClusterInfo mocks base method +func (m *MockClient) GetClusterInfo(arg0 context.Context, arg1 ...yarpc.CallOption) (*types.ClusterInfo, error) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0} + for _, a := range arg1 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "GetClusterInfo", varargs...) + ret0, _ := ret[0].(*types.ClusterInfo) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetClusterInfo indicates an expected call of GetClusterInfo +func (mr *MockClientMockRecorder) GetClusterInfo(arg0 interface{}, arg1 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0}, arg1...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetClusterInfo", reflect.TypeOf((*MockClient)(nil).GetClusterInfo), varargs...) +} + +// GetSearchAttributes mocks base method +func (m *MockClient) GetSearchAttributes(arg0 context.Context, arg1 ...yarpc.CallOption) (*types.GetSearchAttributesResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0} + for _, a := range arg1 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "GetSearchAttributes", varargs...) + ret0, _ := ret[0].(*types.GetSearchAttributesResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetSearchAttributes indicates an expected call of GetSearchAttributes +func (mr *MockClientMockRecorder) GetSearchAttributes(arg0 interface{}, arg1 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0}, arg1...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSearchAttributes", reflect.TypeOf((*MockClient)(nil).GetSearchAttributes), varargs...) +} + +// GetWorkflowExecutionHistory mocks base method +func (m *MockClient) GetWorkflowExecutionHistory(arg0 context.Context, arg1 *types.GetWorkflowExecutionHistoryRequest, arg2 ...yarpc.CallOption) (*types.GetWorkflowExecutionHistoryResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "GetWorkflowExecutionHistory", varargs...) + ret0, _ := ret[0].(*types.GetWorkflowExecutionHistoryResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetWorkflowExecutionHistory indicates an expected call of GetWorkflowExecutionHistory +func (mr *MockClientMockRecorder) GetWorkflowExecutionHistory(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetWorkflowExecutionHistory", reflect.TypeOf((*MockClient)(nil).GetWorkflowExecutionHistory), varargs...) +} + +// ListArchivedWorkflowExecutions mocks base method +func (m *MockClient) ListArchivedWorkflowExecutions(arg0 context.Context, arg1 *types.ListArchivedWorkflowExecutionsRequest, arg2 ...yarpc.CallOption) (*types.ListArchivedWorkflowExecutionsResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ListArchivedWorkflowExecutions", varargs...) + ret0, _ := ret[0].(*types.ListArchivedWorkflowExecutionsResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListArchivedWorkflowExecutions indicates an expected call of ListArchivedWorkflowExecutions +func (mr *MockClientMockRecorder) ListArchivedWorkflowExecutions(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListArchivedWorkflowExecutions", reflect.TypeOf((*MockClient)(nil).ListArchivedWorkflowExecutions), varargs...) +} + +// ListClosedWorkflowExecutions mocks base method +func (m *MockClient) ListClosedWorkflowExecutions(arg0 context.Context, arg1 *types.ListClosedWorkflowExecutionsRequest, arg2 ...yarpc.CallOption) (*types.ListClosedWorkflowExecutionsResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ListClosedWorkflowExecutions", varargs...) + ret0, _ := ret[0].(*types.ListClosedWorkflowExecutionsResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListClosedWorkflowExecutions indicates an expected call of ListClosedWorkflowExecutions +func (mr *MockClientMockRecorder) ListClosedWorkflowExecutions(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListClosedWorkflowExecutions", reflect.TypeOf((*MockClient)(nil).ListClosedWorkflowExecutions), varargs...) +} + +// ListDomains mocks base method +func (m *MockClient) ListDomains(arg0 context.Context, arg1 *types.ListDomainsRequest, arg2 ...yarpc.CallOption) (*types.ListDomainsResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ListDomains", varargs...) + ret0, _ := ret[0].(*types.ListDomainsResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListDomains indicates an expected call of ListDomains +func (mr *MockClientMockRecorder) ListDomains(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListDomains", reflect.TypeOf((*MockClient)(nil).ListDomains), varargs...) +} + +// ListOpenWorkflowExecutions mocks base method +func (m *MockClient) ListOpenWorkflowExecutions(arg0 context.Context, arg1 *types.ListOpenWorkflowExecutionsRequest, arg2 ...yarpc.CallOption) (*types.ListOpenWorkflowExecutionsResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ListOpenWorkflowExecutions", varargs...) + ret0, _ := ret[0].(*types.ListOpenWorkflowExecutionsResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListOpenWorkflowExecutions indicates an expected call of ListOpenWorkflowExecutions +func (mr *MockClientMockRecorder) ListOpenWorkflowExecutions(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListOpenWorkflowExecutions", reflect.TypeOf((*MockClient)(nil).ListOpenWorkflowExecutions), varargs...) +} + +// ListTaskListPartitions mocks base method +func (m *MockClient) ListTaskListPartitions(arg0 context.Context, arg1 *types.ListTaskListPartitionsRequest, arg2 ...yarpc.CallOption) (*types.ListTaskListPartitionsResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ListTaskListPartitions", varargs...) + ret0, _ := ret[0].(*types.ListTaskListPartitionsResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListTaskListPartitions indicates an expected call of ListTaskListPartitions +func (mr *MockClientMockRecorder) ListTaskListPartitions(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListTaskListPartitions", reflect.TypeOf((*MockClient)(nil).ListTaskListPartitions), varargs...) +} + +// ListWorkflowExecutions mocks base method +func (m *MockClient) ListWorkflowExecutions(arg0 context.Context, arg1 *types.ListWorkflowExecutionsRequest, arg2 ...yarpc.CallOption) (*types.ListWorkflowExecutionsResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ListWorkflowExecutions", varargs...) + ret0, _ := ret[0].(*types.ListWorkflowExecutionsResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListWorkflowExecutions indicates an expected call of ListWorkflowExecutions +func (mr *MockClientMockRecorder) ListWorkflowExecutions(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListWorkflowExecutions", reflect.TypeOf((*MockClient)(nil).ListWorkflowExecutions), varargs...) +} + +// PollForActivityTask mocks base method +func (m *MockClient) PollForActivityTask(arg0 context.Context, arg1 *types.PollForActivityTaskRequest, arg2 ...yarpc.CallOption) (*types.PollForActivityTaskResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PollForActivityTask", varargs...) + ret0, _ := ret[0].(*types.PollForActivityTaskResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// PollForActivityTask indicates an expected call of PollForActivityTask +func (mr *MockClientMockRecorder) PollForActivityTask(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PollForActivityTask", reflect.TypeOf((*MockClient)(nil).PollForActivityTask), varargs...) +} + +// PollForDecisionTask mocks base method +func (m *MockClient) PollForDecisionTask(arg0 context.Context, arg1 *types.PollForDecisionTaskRequest, arg2 ...yarpc.CallOption) (*types.PollForDecisionTaskResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PollForDecisionTask", varargs...) + ret0, _ := ret[0].(*types.PollForDecisionTaskResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// PollForDecisionTask indicates an expected call of PollForDecisionTask +func (mr *MockClientMockRecorder) PollForDecisionTask(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PollForDecisionTask", reflect.TypeOf((*MockClient)(nil).PollForDecisionTask), varargs...) +} + +// QueryWorkflow mocks base method +func (m *MockClient) QueryWorkflow(arg0 context.Context, arg1 *types.QueryWorkflowRequest, arg2 ...yarpc.CallOption) (*types.QueryWorkflowResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "QueryWorkflow", varargs...) + ret0, _ := ret[0].(*types.QueryWorkflowResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// QueryWorkflow indicates an expected call of QueryWorkflow +func (mr *MockClientMockRecorder) QueryWorkflow(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "QueryWorkflow", reflect.TypeOf((*MockClient)(nil).QueryWorkflow), varargs...) +} + +// RecordActivityTaskHeartbeat mocks base method +func (m *MockClient) RecordActivityTaskHeartbeat(arg0 context.Context, arg1 *types.RecordActivityTaskHeartbeatRequest, arg2 ...yarpc.CallOption) (*types.RecordActivityTaskHeartbeatResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "RecordActivityTaskHeartbeat", varargs...) + ret0, _ := ret[0].(*types.RecordActivityTaskHeartbeatResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// RecordActivityTaskHeartbeat indicates an expected call of RecordActivityTaskHeartbeat +func (mr *MockClientMockRecorder) RecordActivityTaskHeartbeat(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecordActivityTaskHeartbeat", reflect.TypeOf((*MockClient)(nil).RecordActivityTaskHeartbeat), varargs...) +} + +// RecordActivityTaskHeartbeatByID mocks base method +func (m *MockClient) RecordActivityTaskHeartbeatByID(arg0 context.Context, arg1 *types.RecordActivityTaskHeartbeatByIDRequest, arg2 ...yarpc.CallOption) (*types.RecordActivityTaskHeartbeatResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "RecordActivityTaskHeartbeatByID", varargs...) + ret0, _ := ret[0].(*types.RecordActivityTaskHeartbeatResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// RecordActivityTaskHeartbeatByID indicates an expected call of RecordActivityTaskHeartbeatByID +func (mr *MockClientMockRecorder) RecordActivityTaskHeartbeatByID(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecordActivityTaskHeartbeatByID", reflect.TypeOf((*MockClient)(nil).RecordActivityTaskHeartbeatByID), varargs...) +} + +// RegisterDomain mocks base method +func (m *MockClient) RegisterDomain(arg0 context.Context, arg1 *types.RegisterDomainRequest, arg2 ...yarpc.CallOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "RegisterDomain", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// RegisterDomain indicates an expected call of RegisterDomain +func (mr *MockClientMockRecorder) RegisterDomain(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterDomain", reflect.TypeOf((*MockClient)(nil).RegisterDomain), varargs...) +} + +// RequestCancelWorkflowExecution mocks base method +func (m *MockClient) RequestCancelWorkflowExecution(arg0 context.Context, arg1 *types.RequestCancelWorkflowExecutionRequest, arg2 ...yarpc.CallOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "RequestCancelWorkflowExecution", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// RequestCancelWorkflowExecution indicates an expected call of RequestCancelWorkflowExecution +func (mr *MockClientMockRecorder) RequestCancelWorkflowExecution(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RequestCancelWorkflowExecution", reflect.TypeOf((*MockClient)(nil).RequestCancelWorkflowExecution), varargs...) +} + +// ResetStickyTaskList mocks base method +func (m *MockClient) ResetStickyTaskList(arg0 context.Context, arg1 *types.ResetStickyTaskListRequest, arg2 ...yarpc.CallOption) (*types.ResetStickyTaskListResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ResetStickyTaskList", varargs...) + ret0, _ := ret[0].(*types.ResetStickyTaskListResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ResetStickyTaskList indicates an expected call of ResetStickyTaskList +func (mr *MockClientMockRecorder) ResetStickyTaskList(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ResetStickyTaskList", reflect.TypeOf((*MockClient)(nil).ResetStickyTaskList), varargs...) +} + +// ResetWorkflowExecution mocks base method +func (m *MockClient) ResetWorkflowExecution(arg0 context.Context, arg1 *types.ResetWorkflowExecutionRequest, arg2 ...yarpc.CallOption) (*types.ResetWorkflowExecutionResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ResetWorkflowExecution", varargs...) + ret0, _ := ret[0].(*types.ResetWorkflowExecutionResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ResetWorkflowExecution indicates an expected call of ResetWorkflowExecution +func (mr *MockClientMockRecorder) ResetWorkflowExecution(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ResetWorkflowExecution", reflect.TypeOf((*MockClient)(nil).ResetWorkflowExecution), varargs...) +} + +// RespondActivityTaskCanceled mocks base method +func (m *MockClient) RespondActivityTaskCanceled(arg0 context.Context, arg1 *types.RespondActivityTaskCanceledRequest, arg2 ...yarpc.CallOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "RespondActivityTaskCanceled", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// RespondActivityTaskCanceled indicates an expected call of RespondActivityTaskCanceled +func (mr *MockClientMockRecorder) RespondActivityTaskCanceled(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RespondActivityTaskCanceled", reflect.TypeOf((*MockClient)(nil).RespondActivityTaskCanceled), varargs...) +} + +// RespondActivityTaskCanceledByID mocks base method +func (m *MockClient) RespondActivityTaskCanceledByID(arg0 context.Context, arg1 *types.RespondActivityTaskCanceledByIDRequest, arg2 ...yarpc.CallOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "RespondActivityTaskCanceledByID", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// RespondActivityTaskCanceledByID indicates an expected call of RespondActivityTaskCanceledByID +func (mr *MockClientMockRecorder) RespondActivityTaskCanceledByID(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RespondActivityTaskCanceledByID", reflect.TypeOf((*MockClient)(nil).RespondActivityTaskCanceledByID), varargs...) +} + +// RespondActivityTaskCompleted mocks base method +func (m *MockClient) RespondActivityTaskCompleted(arg0 context.Context, arg1 *types.RespondActivityTaskCompletedRequest, arg2 ...yarpc.CallOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "RespondActivityTaskCompleted", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// RespondActivityTaskCompleted indicates an expected call of RespondActivityTaskCompleted +func (mr *MockClientMockRecorder) RespondActivityTaskCompleted(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RespondActivityTaskCompleted", reflect.TypeOf((*MockClient)(nil).RespondActivityTaskCompleted), varargs...) +} + +// RespondActivityTaskCompletedByID mocks base method +func (m *MockClient) RespondActivityTaskCompletedByID(arg0 context.Context, arg1 *types.RespondActivityTaskCompletedByIDRequest, arg2 ...yarpc.CallOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "RespondActivityTaskCompletedByID", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// RespondActivityTaskCompletedByID indicates an expected call of RespondActivityTaskCompletedByID +func (mr *MockClientMockRecorder) RespondActivityTaskCompletedByID(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RespondActivityTaskCompletedByID", reflect.TypeOf((*MockClient)(nil).RespondActivityTaskCompletedByID), varargs...) +} + +// RespondActivityTaskFailed mocks base method +func (m *MockClient) RespondActivityTaskFailed(arg0 context.Context, arg1 *types.RespondActivityTaskFailedRequest, arg2 ...yarpc.CallOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "RespondActivityTaskFailed", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// RespondActivityTaskFailed indicates an expected call of RespondActivityTaskFailed +func (mr *MockClientMockRecorder) RespondActivityTaskFailed(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RespondActivityTaskFailed", reflect.TypeOf((*MockClient)(nil).RespondActivityTaskFailed), varargs...) +} + +// RespondActivityTaskFailedByID mocks base method +func (m *MockClient) RespondActivityTaskFailedByID(arg0 context.Context, arg1 *types.RespondActivityTaskFailedByIDRequest, arg2 ...yarpc.CallOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "RespondActivityTaskFailedByID", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// RespondActivityTaskFailedByID indicates an expected call of RespondActivityTaskFailedByID +func (mr *MockClientMockRecorder) RespondActivityTaskFailedByID(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RespondActivityTaskFailedByID", reflect.TypeOf((*MockClient)(nil).RespondActivityTaskFailedByID), varargs...) +} + +// RespondDecisionTaskCompleted mocks base method +func (m *MockClient) RespondDecisionTaskCompleted(arg0 context.Context, arg1 *types.RespondDecisionTaskCompletedRequest, arg2 ...yarpc.CallOption) (*types.RespondDecisionTaskCompletedResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "RespondDecisionTaskCompleted", varargs...) + ret0, _ := ret[0].(*types.RespondDecisionTaskCompletedResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// RespondDecisionTaskCompleted indicates an expected call of RespondDecisionTaskCompleted +func (mr *MockClientMockRecorder) RespondDecisionTaskCompleted(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RespondDecisionTaskCompleted", reflect.TypeOf((*MockClient)(nil).RespondDecisionTaskCompleted), varargs...) +} + +// RespondDecisionTaskFailed mocks base method +func (m *MockClient) RespondDecisionTaskFailed(arg0 context.Context, arg1 *types.RespondDecisionTaskFailedRequest, arg2 ...yarpc.CallOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "RespondDecisionTaskFailed", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// RespondDecisionTaskFailed indicates an expected call of RespondDecisionTaskFailed +func (mr *MockClientMockRecorder) RespondDecisionTaskFailed(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RespondDecisionTaskFailed", reflect.TypeOf((*MockClient)(nil).RespondDecisionTaskFailed), varargs...) +} + +// RespondQueryTaskCompleted mocks base method +func (m *MockClient) RespondQueryTaskCompleted(arg0 context.Context, arg1 *types.RespondQueryTaskCompletedRequest, arg2 ...yarpc.CallOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "RespondQueryTaskCompleted", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// RespondQueryTaskCompleted indicates an expected call of RespondQueryTaskCompleted +func (mr *MockClientMockRecorder) RespondQueryTaskCompleted(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RespondQueryTaskCompleted", reflect.TypeOf((*MockClient)(nil).RespondQueryTaskCompleted), varargs...) +} + +// ScanWorkflowExecutions mocks base method +func (m *MockClient) ScanWorkflowExecutions(arg0 context.Context, arg1 *types.ListWorkflowExecutionsRequest, arg2 ...yarpc.CallOption) (*types.ListWorkflowExecutionsResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ScanWorkflowExecutions", varargs...) + ret0, _ := ret[0].(*types.ListWorkflowExecutionsResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ScanWorkflowExecutions indicates an expected call of ScanWorkflowExecutions +func (mr *MockClientMockRecorder) ScanWorkflowExecutions(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ScanWorkflowExecutions", reflect.TypeOf((*MockClient)(nil).ScanWorkflowExecutions), varargs...) +} + +// SignalWithStartWorkflowExecution mocks base method +func (m *MockClient) SignalWithStartWorkflowExecution(arg0 context.Context, arg1 *types.SignalWithStartWorkflowExecutionRequest, arg2 ...yarpc.CallOption) (*types.StartWorkflowExecutionResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "SignalWithStartWorkflowExecution", varargs...) + ret0, _ := ret[0].(*types.StartWorkflowExecutionResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// SignalWithStartWorkflowExecution indicates an expected call of SignalWithStartWorkflowExecution +func (mr *MockClientMockRecorder) SignalWithStartWorkflowExecution(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SignalWithStartWorkflowExecution", reflect.TypeOf((*MockClient)(nil).SignalWithStartWorkflowExecution), varargs...) +} + +// SignalWorkflowExecution mocks base method +func (m *MockClient) SignalWorkflowExecution(arg0 context.Context, arg1 *types.SignalWorkflowExecutionRequest, arg2 ...yarpc.CallOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "SignalWorkflowExecution", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// SignalWorkflowExecution indicates an expected call of SignalWorkflowExecution +func (mr *MockClientMockRecorder) SignalWorkflowExecution(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SignalWorkflowExecution", reflect.TypeOf((*MockClient)(nil).SignalWorkflowExecution), varargs...) +} + +// StartWorkflowExecution mocks base method +func (m *MockClient) StartWorkflowExecution(arg0 context.Context, arg1 *types.StartWorkflowExecutionRequest, arg2 ...yarpc.CallOption) (*types.StartWorkflowExecutionResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "StartWorkflowExecution", varargs...) + ret0, _ := ret[0].(*types.StartWorkflowExecutionResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// StartWorkflowExecution indicates an expected call of StartWorkflowExecution +func (mr *MockClientMockRecorder) StartWorkflowExecution(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StartWorkflowExecution", reflect.TypeOf((*MockClient)(nil).StartWorkflowExecution), varargs...) +} + +// TerminateWorkflowExecution mocks base method +func (m *MockClient) TerminateWorkflowExecution(arg0 context.Context, arg1 *types.TerminateWorkflowExecutionRequest, arg2 ...yarpc.CallOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "TerminateWorkflowExecution", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// TerminateWorkflowExecution indicates an expected call of TerminateWorkflowExecution +func (mr *MockClientMockRecorder) TerminateWorkflowExecution(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TerminateWorkflowExecution", reflect.TypeOf((*MockClient)(nil).TerminateWorkflowExecution), varargs...) +} + +// UpdateDomain mocks base method +func (m *MockClient) UpdateDomain(arg0 context.Context, arg1 *types.UpdateDomainRequest, arg2 ...yarpc.CallOption) (*types.UpdateDomainResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateDomain", varargs...) + ret0, _ := ret[0].(*types.UpdateDomainResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateDomain indicates an expected call of UpdateDomain +func (mr *MockClientMockRecorder) UpdateDomain(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateDomain", reflect.TypeOf((*MockClient)(nil).UpdateDomain), varargs...) +} diff --git a/client/frontend/metricClient.go b/client/frontend/metricClient.go index 57fa189d171..88472e67f6e 100644 --- a/client/frontend/metricClient.go +++ b/client/frontend/metricClient.go @@ -25,8 +25,8 @@ import ( "go.uber.org/yarpc" - "github.com/uber/cadence/.gen/go/shared" "github.com/uber/cadence/common/metrics" + "github.com/uber/cadence/common/types" ) var _ Client = (*metricClient)(nil) @@ -46,7 +46,7 @@ func NewMetricClient(client Client, metricsClient metrics.Client) Client { func (c *metricClient) DeprecateDomain( ctx context.Context, - request *shared.DeprecateDomainRequest, + request *types.DeprecateDomainRequest, opts ...yarpc.CallOption, ) error { @@ -64,9 +64,9 @@ func (c *metricClient) DeprecateDomain( func (c *metricClient) DescribeDomain( ctx context.Context, - request *shared.DescribeDomainRequest, + request *types.DescribeDomainRequest, opts ...yarpc.CallOption, -) (*shared.DescribeDomainResponse, error) { +) (*types.DescribeDomainResponse, error) { c.metricsClient.IncCounter(metrics.FrontendClientDescribeDomainScope, metrics.CadenceClientRequests) @@ -82,9 +82,9 @@ func (c *metricClient) DescribeDomain( func (c *metricClient) DescribeTaskList( ctx context.Context, - request *shared.DescribeTaskListRequest, + request *types.DescribeTaskListRequest, opts ...yarpc.CallOption, -) (*shared.DescribeTaskListResponse, error) { +) (*types.DescribeTaskListResponse, error) { c.metricsClient.IncCounter(metrics.FrontendClientDescribeTaskListScope, metrics.CadenceClientRequests) @@ -100,9 +100,9 @@ func (c *metricClient) DescribeTaskList( func (c *metricClient) DescribeWorkflowExecution( ctx context.Context, - request *shared.DescribeWorkflowExecutionRequest, + request *types.DescribeWorkflowExecutionRequest, opts ...yarpc.CallOption, -) (*shared.DescribeWorkflowExecutionResponse, error) { +) (*types.DescribeWorkflowExecutionResponse, error) { c.metricsClient.IncCounter(metrics.FrontendClientDescribeWorkflowExecutionScope, metrics.CadenceClientRequests) @@ -118,9 +118,9 @@ func (c *metricClient) DescribeWorkflowExecution( func (c *metricClient) GetWorkflowExecutionHistory( ctx context.Context, - request *shared.GetWorkflowExecutionHistoryRequest, + request *types.GetWorkflowExecutionHistoryRequest, opts ...yarpc.CallOption, -) (*shared.GetWorkflowExecutionHistoryResponse, error) { +) (*types.GetWorkflowExecutionHistoryResponse, error) { c.metricsClient.IncCounter(metrics.FrontendClientGetWorkflowExecutionHistoryScope, metrics.CadenceClientRequests) @@ -136,9 +136,9 @@ func (c *metricClient) GetWorkflowExecutionHistory( func (c *metricClient) ListArchivedWorkflowExecutions( ctx context.Context, - request *shared.ListArchivedWorkflowExecutionsRequest, + request *types.ListArchivedWorkflowExecutionsRequest, opts ...yarpc.CallOption, -) (*shared.ListArchivedWorkflowExecutionsResponse, error) { +) (*types.ListArchivedWorkflowExecutionsResponse, error) { c.metricsClient.IncCounter(metrics.FrontendClientListArchivedWorkflowExecutionsScope, metrics.CadenceClientRequests) @@ -154,9 +154,9 @@ func (c *metricClient) ListArchivedWorkflowExecutions( func (c *metricClient) ListClosedWorkflowExecutions( ctx context.Context, - request *shared.ListClosedWorkflowExecutionsRequest, + request *types.ListClosedWorkflowExecutionsRequest, opts ...yarpc.CallOption, -) (*shared.ListClosedWorkflowExecutionsResponse, error) { +) (*types.ListClosedWorkflowExecutionsResponse, error) { c.metricsClient.IncCounter(metrics.FrontendClientListClosedWorkflowExecutionsScope, metrics.CadenceClientRequests) @@ -172,9 +172,9 @@ func (c *metricClient) ListClosedWorkflowExecutions( func (c *metricClient) ListDomains( ctx context.Context, - request *shared.ListDomainsRequest, + request *types.ListDomainsRequest, opts ...yarpc.CallOption, -) (*shared.ListDomainsResponse, error) { +) (*types.ListDomainsResponse, error) { c.metricsClient.IncCounter(metrics.FrontendClientListDomainsScope, metrics.CadenceClientRequests) @@ -190,9 +190,9 @@ func (c *metricClient) ListDomains( func (c *metricClient) ListOpenWorkflowExecutions( ctx context.Context, - request *shared.ListOpenWorkflowExecutionsRequest, + request *types.ListOpenWorkflowExecutionsRequest, opts ...yarpc.CallOption, -) (*shared.ListOpenWorkflowExecutionsResponse, error) { +) (*types.ListOpenWorkflowExecutionsResponse, error) { c.metricsClient.IncCounter(metrics.FrontendClientListOpenWorkflowExecutionsScope, metrics.CadenceClientRequests) @@ -208,9 +208,9 @@ func (c *metricClient) ListOpenWorkflowExecutions( func (c *metricClient) ListWorkflowExecutions( ctx context.Context, - request *shared.ListWorkflowExecutionsRequest, + request *types.ListWorkflowExecutionsRequest, opts ...yarpc.CallOption, -) (*shared.ListWorkflowExecutionsResponse, error) { +) (*types.ListWorkflowExecutionsResponse, error) { c.metricsClient.IncCounter(metrics.FrontendClientListWorkflowExecutionsScope, metrics.CadenceClientRequests) @@ -226,9 +226,9 @@ func (c *metricClient) ListWorkflowExecutions( func (c *metricClient) ScanWorkflowExecutions( ctx context.Context, - request *shared.ListWorkflowExecutionsRequest, + request *types.ListWorkflowExecutionsRequest, opts ...yarpc.CallOption, -) (*shared.ListWorkflowExecutionsResponse, error) { +) (*types.ListWorkflowExecutionsResponse, error) { c.metricsClient.IncCounter(metrics.FrontendClientScanWorkflowExecutionsScope, metrics.CadenceClientRequests) @@ -244,9 +244,9 @@ func (c *metricClient) ScanWorkflowExecutions( func (c *metricClient) CountWorkflowExecutions( ctx context.Context, - request *shared.CountWorkflowExecutionsRequest, + request *types.CountWorkflowExecutionsRequest, opts ...yarpc.CallOption, -) (*shared.CountWorkflowExecutionsResponse, error) { +) (*types.CountWorkflowExecutionsResponse, error) { c.metricsClient.IncCounter(metrics.FrontendClientCountWorkflowExecutionsScope, metrics.CadenceClientRequests) @@ -263,7 +263,7 @@ func (c *metricClient) CountWorkflowExecutions( func (c *metricClient) GetSearchAttributes( ctx context.Context, opts ...yarpc.CallOption, -) (*shared.GetSearchAttributesResponse, error) { +) (*types.GetSearchAttributesResponse, error) { c.metricsClient.IncCounter(metrics.FrontendClientGetSearchAttributesScope, metrics.CadenceClientRequests) @@ -279,9 +279,9 @@ func (c *metricClient) GetSearchAttributes( func (c *metricClient) PollForActivityTask( ctx context.Context, - request *shared.PollForActivityTaskRequest, + request *types.PollForActivityTaskRequest, opts ...yarpc.CallOption, -) (*shared.PollForActivityTaskResponse, error) { +) (*types.PollForActivityTaskResponse, error) { c.metricsClient.IncCounter(metrics.FrontendClientPollForActivityTaskScope, metrics.CadenceClientRequests) @@ -297,9 +297,9 @@ func (c *metricClient) PollForActivityTask( func (c *metricClient) PollForDecisionTask( ctx context.Context, - request *shared.PollForDecisionTaskRequest, + request *types.PollForDecisionTaskRequest, opts ...yarpc.CallOption, -) (*shared.PollForDecisionTaskResponse, error) { +) (*types.PollForDecisionTaskResponse, error) { c.metricsClient.IncCounter(metrics.FrontendClientPollForDecisionTaskScope, metrics.CadenceClientRequests) @@ -315,9 +315,9 @@ func (c *metricClient) PollForDecisionTask( func (c *metricClient) QueryWorkflow( ctx context.Context, - request *shared.QueryWorkflowRequest, + request *types.QueryWorkflowRequest, opts ...yarpc.CallOption, -) (*shared.QueryWorkflowResponse, error) { +) (*types.QueryWorkflowResponse, error) { c.metricsClient.IncCounter(metrics.FrontendClientQueryWorkflowScope, metrics.CadenceClientRequests) @@ -333,9 +333,9 @@ func (c *metricClient) QueryWorkflow( func (c *metricClient) RecordActivityTaskHeartbeat( ctx context.Context, - request *shared.RecordActivityTaskHeartbeatRequest, + request *types.RecordActivityTaskHeartbeatRequest, opts ...yarpc.CallOption, -) (*shared.RecordActivityTaskHeartbeatResponse, error) { +) (*types.RecordActivityTaskHeartbeatResponse, error) { c.metricsClient.IncCounter(metrics.FrontendClientRecordActivityTaskHeartbeatScope, metrics.CadenceClientRequests) @@ -351,9 +351,9 @@ func (c *metricClient) RecordActivityTaskHeartbeat( func (c *metricClient) RecordActivityTaskHeartbeatByID( ctx context.Context, - request *shared.RecordActivityTaskHeartbeatByIDRequest, + request *types.RecordActivityTaskHeartbeatByIDRequest, opts ...yarpc.CallOption, -) (*shared.RecordActivityTaskHeartbeatResponse, error) { +) (*types.RecordActivityTaskHeartbeatResponse, error) { c.metricsClient.IncCounter(metrics.FrontendClientRecordActivityTaskHeartbeatByIDScope, metrics.CadenceClientRequests) @@ -369,7 +369,7 @@ func (c *metricClient) RecordActivityTaskHeartbeatByID( func (c *metricClient) RegisterDomain( ctx context.Context, - request *shared.RegisterDomainRequest, + request *types.RegisterDomainRequest, opts ...yarpc.CallOption, ) error { @@ -387,7 +387,7 @@ func (c *metricClient) RegisterDomain( func (c *metricClient) RequestCancelWorkflowExecution( ctx context.Context, - request *shared.RequestCancelWorkflowExecutionRequest, + request *types.RequestCancelWorkflowExecutionRequest, opts ...yarpc.CallOption, ) error { @@ -405,9 +405,9 @@ func (c *metricClient) RequestCancelWorkflowExecution( func (c *metricClient) ResetStickyTaskList( ctx context.Context, - request *shared.ResetStickyTaskListRequest, + request *types.ResetStickyTaskListRequest, opts ...yarpc.CallOption, -) (*shared.ResetStickyTaskListResponse, error) { +) (*types.ResetStickyTaskListResponse, error) { c.metricsClient.IncCounter(metrics.FrontendClientResetStickyTaskListScope, metrics.CadenceClientRequests) @@ -423,9 +423,9 @@ func (c *metricClient) ResetStickyTaskList( func (c *metricClient) ResetWorkflowExecution( ctx context.Context, - request *shared.ResetWorkflowExecutionRequest, + request *types.ResetWorkflowExecutionRequest, opts ...yarpc.CallOption, -) (*shared.ResetWorkflowExecutionResponse, error) { +) (*types.ResetWorkflowExecutionResponse, error) { c.metricsClient.IncCounter(metrics.FrontendClientResetWorkflowExecutionScope, metrics.CadenceClientRequests) @@ -441,7 +441,7 @@ func (c *metricClient) ResetWorkflowExecution( func (c *metricClient) RespondActivityTaskCanceled( ctx context.Context, - request *shared.RespondActivityTaskCanceledRequest, + request *types.RespondActivityTaskCanceledRequest, opts ...yarpc.CallOption, ) error { @@ -459,7 +459,7 @@ func (c *metricClient) RespondActivityTaskCanceled( func (c *metricClient) RespondActivityTaskCanceledByID( ctx context.Context, - request *shared.RespondActivityTaskCanceledByIDRequest, + request *types.RespondActivityTaskCanceledByIDRequest, opts ...yarpc.CallOption, ) error { @@ -477,7 +477,7 @@ func (c *metricClient) RespondActivityTaskCanceledByID( func (c *metricClient) RespondActivityTaskCompleted( ctx context.Context, - request *shared.RespondActivityTaskCompletedRequest, + request *types.RespondActivityTaskCompletedRequest, opts ...yarpc.CallOption, ) error { @@ -495,7 +495,7 @@ func (c *metricClient) RespondActivityTaskCompleted( func (c *metricClient) RespondActivityTaskCompletedByID( ctx context.Context, - request *shared.RespondActivityTaskCompletedByIDRequest, + request *types.RespondActivityTaskCompletedByIDRequest, opts ...yarpc.CallOption, ) error { @@ -513,7 +513,7 @@ func (c *metricClient) RespondActivityTaskCompletedByID( func (c *metricClient) RespondActivityTaskFailed( ctx context.Context, - request *shared.RespondActivityTaskFailedRequest, + request *types.RespondActivityTaskFailedRequest, opts ...yarpc.CallOption, ) error { @@ -531,7 +531,7 @@ func (c *metricClient) RespondActivityTaskFailed( func (c *metricClient) RespondActivityTaskFailedByID( ctx context.Context, - request *shared.RespondActivityTaskFailedByIDRequest, + request *types.RespondActivityTaskFailedByIDRequest, opts ...yarpc.CallOption, ) error { @@ -549,9 +549,9 @@ func (c *metricClient) RespondActivityTaskFailedByID( func (c *metricClient) RespondDecisionTaskCompleted( ctx context.Context, - request *shared.RespondDecisionTaskCompletedRequest, + request *types.RespondDecisionTaskCompletedRequest, opts ...yarpc.CallOption, -) (*shared.RespondDecisionTaskCompletedResponse, error) { +) (*types.RespondDecisionTaskCompletedResponse, error) { c.metricsClient.IncCounter(metrics.FrontendClientRespondDecisionTaskCompletedScope, metrics.CadenceClientRequests) @@ -567,7 +567,7 @@ func (c *metricClient) RespondDecisionTaskCompleted( func (c *metricClient) RespondDecisionTaskFailed( ctx context.Context, - request *shared.RespondDecisionTaskFailedRequest, + request *types.RespondDecisionTaskFailedRequest, opts ...yarpc.CallOption, ) error { @@ -585,7 +585,7 @@ func (c *metricClient) RespondDecisionTaskFailed( func (c *metricClient) RespondQueryTaskCompleted( ctx context.Context, - request *shared.RespondQueryTaskCompletedRequest, + request *types.RespondQueryTaskCompletedRequest, opts ...yarpc.CallOption, ) error { @@ -603,9 +603,9 @@ func (c *metricClient) RespondQueryTaskCompleted( func (c *metricClient) SignalWithStartWorkflowExecution( ctx context.Context, - request *shared.SignalWithStartWorkflowExecutionRequest, + request *types.SignalWithStartWorkflowExecutionRequest, opts ...yarpc.CallOption, -) (*shared.StartWorkflowExecutionResponse, error) { +) (*types.StartWorkflowExecutionResponse, error) { c.metricsClient.IncCounter(metrics.FrontendClientSignalWithStartWorkflowExecutionScope, metrics.CadenceClientRequests) @@ -621,7 +621,7 @@ func (c *metricClient) SignalWithStartWorkflowExecution( func (c *metricClient) SignalWorkflowExecution( ctx context.Context, - request *shared.SignalWorkflowExecutionRequest, + request *types.SignalWorkflowExecutionRequest, opts ...yarpc.CallOption, ) error { @@ -639,9 +639,9 @@ func (c *metricClient) SignalWorkflowExecution( func (c *metricClient) StartWorkflowExecution( ctx context.Context, - request *shared.StartWorkflowExecutionRequest, + request *types.StartWorkflowExecutionRequest, opts ...yarpc.CallOption, -) (*shared.StartWorkflowExecutionResponse, error) { +) (*types.StartWorkflowExecutionResponse, error) { c.metricsClient.IncCounter(metrics.FrontendClientStartWorkflowExecutionScope, metrics.CadenceClientRequests) @@ -657,7 +657,7 @@ func (c *metricClient) StartWorkflowExecution( func (c *metricClient) TerminateWorkflowExecution( ctx context.Context, - request *shared.TerminateWorkflowExecutionRequest, + request *types.TerminateWorkflowExecutionRequest, opts ...yarpc.CallOption, ) error { @@ -675,9 +675,9 @@ func (c *metricClient) TerminateWorkflowExecution( func (c *metricClient) UpdateDomain( ctx context.Context, - request *shared.UpdateDomainRequest, + request *types.UpdateDomainRequest, opts ...yarpc.CallOption, -) (*shared.UpdateDomainResponse, error) { +) (*types.UpdateDomainResponse, error) { c.metricsClient.IncCounter(metrics.FrontendClientUpdateDomainScope, metrics.CadenceClientRequests) @@ -694,7 +694,7 @@ func (c *metricClient) UpdateDomain( func (c *metricClient) GetClusterInfo( ctx context.Context, opts ...yarpc.CallOption, -) (*shared.ClusterInfo, error) { +) (*types.ClusterInfo, error) { c.metricsClient.IncCounter(metrics.FrontendClientGetClusterInfoScope, metrics.CadenceClientRequests) sw := c.metricsClient.StartTimer(metrics.FrontendClientGetClusterInfoScope, metrics.CadenceClientLatency) @@ -709,9 +709,9 @@ func (c *metricClient) GetClusterInfo( func (c *metricClient) ListTaskListPartitions( ctx context.Context, - request *shared.ListTaskListPartitionsRequest, + request *types.ListTaskListPartitionsRequest, opts ...yarpc.CallOption, -) (*shared.ListTaskListPartitionsResponse, error) { +) (*types.ListTaskListPartitionsResponse, error) { c.metricsClient.IncCounter(metrics.FrontendClientListTaskListPartitionsScope, metrics.CadenceClientRequests) diff --git a/client/frontend/retryableClient.go b/client/frontend/retryableClient.go index 768afda813b..c06f594d497 100644 --- a/client/frontend/retryableClient.go +++ b/client/frontend/retryableClient.go @@ -25,8 +25,8 @@ import ( "go.uber.org/yarpc" - "github.com/uber/cadence/.gen/go/shared" "github.com/uber/cadence/common/backoff" + "github.com/uber/cadence/common/types" ) var _ Client = (*retryableClient)(nil) @@ -48,7 +48,7 @@ func NewRetryableClient(client Client, policy backoff.RetryPolicy, isRetryable b func (c *retryableClient) DeprecateDomain( ctx context.Context, - request *shared.DeprecateDomainRequest, + request *types.DeprecateDomainRequest, opts ...yarpc.CallOption, ) error { @@ -60,11 +60,11 @@ func (c *retryableClient) DeprecateDomain( func (c *retryableClient) DescribeDomain( ctx context.Context, - request *shared.DescribeDomainRequest, + request *types.DescribeDomainRequest, opts ...yarpc.CallOption, -) (*shared.DescribeDomainResponse, error) { +) (*types.DescribeDomainResponse, error) { - var resp *shared.DescribeDomainResponse + var resp *types.DescribeDomainResponse op := func() error { var err error resp, err = c.client.DescribeDomain(ctx, request, opts...) @@ -76,11 +76,11 @@ func (c *retryableClient) DescribeDomain( func (c *retryableClient) DescribeTaskList( ctx context.Context, - request *shared.DescribeTaskListRequest, + request *types.DescribeTaskListRequest, opts ...yarpc.CallOption, -) (*shared.DescribeTaskListResponse, error) { +) (*types.DescribeTaskListResponse, error) { - var resp *shared.DescribeTaskListResponse + var resp *types.DescribeTaskListResponse op := func() error { var err error resp, err = c.client.DescribeTaskList(ctx, request, opts...) @@ -92,11 +92,11 @@ func (c *retryableClient) DescribeTaskList( func (c *retryableClient) DescribeWorkflowExecution( ctx context.Context, - request *shared.DescribeWorkflowExecutionRequest, + request *types.DescribeWorkflowExecutionRequest, opts ...yarpc.CallOption, -) (*shared.DescribeWorkflowExecutionResponse, error) { +) (*types.DescribeWorkflowExecutionResponse, error) { - var resp *shared.DescribeWorkflowExecutionResponse + var resp *types.DescribeWorkflowExecutionResponse op := func() error { var err error resp, err = c.client.DescribeWorkflowExecution(ctx, request, opts...) @@ -108,11 +108,11 @@ func (c *retryableClient) DescribeWorkflowExecution( func (c *retryableClient) GetWorkflowExecutionHistory( ctx context.Context, - request *shared.GetWorkflowExecutionHistoryRequest, + request *types.GetWorkflowExecutionHistoryRequest, opts ...yarpc.CallOption, -) (*shared.GetWorkflowExecutionHistoryResponse, error) { +) (*types.GetWorkflowExecutionHistoryResponse, error) { - var resp *shared.GetWorkflowExecutionHistoryResponse + var resp *types.GetWorkflowExecutionHistoryResponse op := func() error { var err error resp, err = c.client.GetWorkflowExecutionHistory(ctx, request, opts...) @@ -124,11 +124,11 @@ func (c *retryableClient) GetWorkflowExecutionHistory( func (c *retryableClient) ListArchivedWorkflowExecutions( ctx context.Context, - request *shared.ListArchivedWorkflowExecutionsRequest, + request *types.ListArchivedWorkflowExecutionsRequest, opts ...yarpc.CallOption, -) (*shared.ListArchivedWorkflowExecutionsResponse, error) { +) (*types.ListArchivedWorkflowExecutionsResponse, error) { - var resp *shared.ListArchivedWorkflowExecutionsResponse + var resp *types.ListArchivedWorkflowExecutionsResponse op := func() error { var err error resp, err = c.client.ListArchivedWorkflowExecutions(ctx, request, opts...) @@ -140,11 +140,11 @@ func (c *retryableClient) ListArchivedWorkflowExecutions( func (c *retryableClient) ListClosedWorkflowExecutions( ctx context.Context, - request *shared.ListClosedWorkflowExecutionsRequest, + request *types.ListClosedWorkflowExecutionsRequest, opts ...yarpc.CallOption, -) (*shared.ListClosedWorkflowExecutionsResponse, error) { +) (*types.ListClosedWorkflowExecutionsResponse, error) { - var resp *shared.ListClosedWorkflowExecutionsResponse + var resp *types.ListClosedWorkflowExecutionsResponse op := func() error { var err error resp, err = c.client.ListClosedWorkflowExecutions(ctx, request, opts...) @@ -156,11 +156,11 @@ func (c *retryableClient) ListClosedWorkflowExecutions( func (c *retryableClient) ListDomains( ctx context.Context, - request *shared.ListDomainsRequest, + request *types.ListDomainsRequest, opts ...yarpc.CallOption, -) (*shared.ListDomainsResponse, error) { +) (*types.ListDomainsResponse, error) { - var resp *shared.ListDomainsResponse + var resp *types.ListDomainsResponse op := func() error { var err error resp, err = c.client.ListDomains(ctx, request, opts...) @@ -172,11 +172,11 @@ func (c *retryableClient) ListDomains( func (c *retryableClient) ListOpenWorkflowExecutions( ctx context.Context, - request *shared.ListOpenWorkflowExecutionsRequest, + request *types.ListOpenWorkflowExecutionsRequest, opts ...yarpc.CallOption, -) (*shared.ListOpenWorkflowExecutionsResponse, error) { +) (*types.ListOpenWorkflowExecutionsResponse, error) { - var resp *shared.ListOpenWorkflowExecutionsResponse + var resp *types.ListOpenWorkflowExecutionsResponse op := func() error { var err error resp, err = c.client.ListOpenWorkflowExecutions(ctx, request, opts...) @@ -188,11 +188,11 @@ func (c *retryableClient) ListOpenWorkflowExecutions( func (c *retryableClient) ListWorkflowExecutions( ctx context.Context, - request *shared.ListWorkflowExecutionsRequest, + request *types.ListWorkflowExecutionsRequest, opts ...yarpc.CallOption, -) (*shared.ListWorkflowExecutionsResponse, error) { +) (*types.ListWorkflowExecutionsResponse, error) { - var resp *shared.ListWorkflowExecutionsResponse + var resp *types.ListWorkflowExecutionsResponse op := func() error { var err error resp, err = c.client.ListWorkflowExecutions(ctx, request, opts...) @@ -204,11 +204,11 @@ func (c *retryableClient) ListWorkflowExecutions( func (c *retryableClient) ScanWorkflowExecutions( ctx context.Context, - request *shared.ListWorkflowExecutionsRequest, + request *types.ListWorkflowExecutionsRequest, opts ...yarpc.CallOption, -) (*shared.ListWorkflowExecutionsResponse, error) { +) (*types.ListWorkflowExecutionsResponse, error) { - var resp *shared.ListWorkflowExecutionsResponse + var resp *types.ListWorkflowExecutionsResponse op := func() error { var err error resp, err = c.client.ScanWorkflowExecutions(ctx, request, opts...) @@ -220,11 +220,11 @@ func (c *retryableClient) ScanWorkflowExecutions( func (c *retryableClient) CountWorkflowExecutions( ctx context.Context, - request *shared.CountWorkflowExecutionsRequest, + request *types.CountWorkflowExecutionsRequest, opts ...yarpc.CallOption, -) (*shared.CountWorkflowExecutionsResponse, error) { +) (*types.CountWorkflowExecutionsResponse, error) { - var resp *shared.CountWorkflowExecutionsResponse + var resp *types.CountWorkflowExecutionsResponse op := func() error { var err error resp, err = c.client.CountWorkflowExecutions(ctx, request, opts...) @@ -237,9 +237,9 @@ func (c *retryableClient) CountWorkflowExecutions( func (c *retryableClient) GetSearchAttributes( ctx context.Context, opts ...yarpc.CallOption, -) (*shared.GetSearchAttributesResponse, error) { +) (*types.GetSearchAttributesResponse, error) { - var resp *shared.GetSearchAttributesResponse + var resp *types.GetSearchAttributesResponse op := func() error { var err error resp, err = c.client.GetSearchAttributes(ctx, opts...) @@ -251,11 +251,11 @@ func (c *retryableClient) GetSearchAttributes( func (c *retryableClient) PollForActivityTask( ctx context.Context, - request *shared.PollForActivityTaskRequest, + request *types.PollForActivityTaskRequest, opts ...yarpc.CallOption, -) (*shared.PollForActivityTaskResponse, error) { +) (*types.PollForActivityTaskResponse, error) { - var resp *shared.PollForActivityTaskResponse + var resp *types.PollForActivityTaskResponse op := func() error { var err error resp, err = c.client.PollForActivityTask(ctx, request, opts...) @@ -267,11 +267,11 @@ func (c *retryableClient) PollForActivityTask( func (c *retryableClient) PollForDecisionTask( ctx context.Context, - request *shared.PollForDecisionTaskRequest, + request *types.PollForDecisionTaskRequest, opts ...yarpc.CallOption, -) (*shared.PollForDecisionTaskResponse, error) { +) (*types.PollForDecisionTaskResponse, error) { - var resp *shared.PollForDecisionTaskResponse + var resp *types.PollForDecisionTaskResponse op := func() error { var err error resp, err = c.client.PollForDecisionTask(ctx, request, opts...) @@ -283,11 +283,11 @@ func (c *retryableClient) PollForDecisionTask( func (c *retryableClient) QueryWorkflow( ctx context.Context, - request *shared.QueryWorkflowRequest, + request *types.QueryWorkflowRequest, opts ...yarpc.CallOption, -) (*shared.QueryWorkflowResponse, error) { +) (*types.QueryWorkflowResponse, error) { - var resp *shared.QueryWorkflowResponse + var resp *types.QueryWorkflowResponse op := func() error { var err error resp, err = c.client.QueryWorkflow(ctx, request, opts...) @@ -299,11 +299,11 @@ func (c *retryableClient) QueryWorkflow( func (c *retryableClient) RecordActivityTaskHeartbeat( ctx context.Context, - request *shared.RecordActivityTaskHeartbeatRequest, + request *types.RecordActivityTaskHeartbeatRequest, opts ...yarpc.CallOption, -) (*shared.RecordActivityTaskHeartbeatResponse, error) { +) (*types.RecordActivityTaskHeartbeatResponse, error) { - var resp *shared.RecordActivityTaskHeartbeatResponse + var resp *types.RecordActivityTaskHeartbeatResponse op := func() error { var err error resp, err = c.client.RecordActivityTaskHeartbeat(ctx, request, opts...) @@ -315,11 +315,11 @@ func (c *retryableClient) RecordActivityTaskHeartbeat( func (c *retryableClient) RecordActivityTaskHeartbeatByID( ctx context.Context, - request *shared.RecordActivityTaskHeartbeatByIDRequest, + request *types.RecordActivityTaskHeartbeatByIDRequest, opts ...yarpc.CallOption, -) (*shared.RecordActivityTaskHeartbeatResponse, error) { +) (*types.RecordActivityTaskHeartbeatResponse, error) { - var resp *shared.RecordActivityTaskHeartbeatResponse + var resp *types.RecordActivityTaskHeartbeatResponse op := func() error { var err error resp, err = c.client.RecordActivityTaskHeartbeatByID(ctx, request, opts...) @@ -331,7 +331,7 @@ func (c *retryableClient) RecordActivityTaskHeartbeatByID( func (c *retryableClient) RegisterDomain( ctx context.Context, - request *shared.RegisterDomainRequest, + request *types.RegisterDomainRequest, opts ...yarpc.CallOption, ) error { @@ -343,7 +343,7 @@ func (c *retryableClient) RegisterDomain( func (c *retryableClient) RequestCancelWorkflowExecution( ctx context.Context, - request *shared.RequestCancelWorkflowExecutionRequest, + request *types.RequestCancelWorkflowExecutionRequest, opts ...yarpc.CallOption, ) error { @@ -355,11 +355,11 @@ func (c *retryableClient) RequestCancelWorkflowExecution( func (c *retryableClient) ResetStickyTaskList( ctx context.Context, - request *shared.ResetStickyTaskListRequest, + request *types.ResetStickyTaskListRequest, opts ...yarpc.CallOption, -) (*shared.ResetStickyTaskListResponse, error) { +) (*types.ResetStickyTaskListResponse, error) { - var resp *shared.ResetStickyTaskListResponse + var resp *types.ResetStickyTaskListResponse op := func() error { var err error resp, err = c.client.ResetStickyTaskList(ctx, request, opts...) @@ -371,11 +371,11 @@ func (c *retryableClient) ResetStickyTaskList( func (c *retryableClient) ResetWorkflowExecution( ctx context.Context, - request *shared.ResetWorkflowExecutionRequest, + request *types.ResetWorkflowExecutionRequest, opts ...yarpc.CallOption, -) (*shared.ResetWorkflowExecutionResponse, error) { +) (*types.ResetWorkflowExecutionResponse, error) { - var resp *shared.ResetWorkflowExecutionResponse + var resp *types.ResetWorkflowExecutionResponse op := func() error { var err error resp, err = c.client.ResetWorkflowExecution(ctx, request, opts...) @@ -387,7 +387,7 @@ func (c *retryableClient) ResetWorkflowExecution( func (c *retryableClient) RespondActivityTaskCanceled( ctx context.Context, - request *shared.RespondActivityTaskCanceledRequest, + request *types.RespondActivityTaskCanceledRequest, opts ...yarpc.CallOption, ) error { @@ -399,7 +399,7 @@ func (c *retryableClient) RespondActivityTaskCanceled( func (c *retryableClient) RespondActivityTaskCanceledByID( ctx context.Context, - request *shared.RespondActivityTaskCanceledByIDRequest, + request *types.RespondActivityTaskCanceledByIDRequest, opts ...yarpc.CallOption, ) error { @@ -411,7 +411,7 @@ func (c *retryableClient) RespondActivityTaskCanceledByID( func (c *retryableClient) RespondActivityTaskCompleted( ctx context.Context, - request *shared.RespondActivityTaskCompletedRequest, + request *types.RespondActivityTaskCompletedRequest, opts ...yarpc.CallOption, ) error { @@ -423,7 +423,7 @@ func (c *retryableClient) RespondActivityTaskCompleted( func (c *retryableClient) RespondActivityTaskCompletedByID( ctx context.Context, - request *shared.RespondActivityTaskCompletedByIDRequest, + request *types.RespondActivityTaskCompletedByIDRequest, opts ...yarpc.CallOption, ) error { @@ -435,7 +435,7 @@ func (c *retryableClient) RespondActivityTaskCompletedByID( func (c *retryableClient) RespondActivityTaskFailed( ctx context.Context, - request *shared.RespondActivityTaskFailedRequest, + request *types.RespondActivityTaskFailedRequest, opts ...yarpc.CallOption, ) error { @@ -447,7 +447,7 @@ func (c *retryableClient) RespondActivityTaskFailed( func (c *retryableClient) RespondActivityTaskFailedByID( ctx context.Context, - request *shared.RespondActivityTaskFailedByIDRequest, + request *types.RespondActivityTaskFailedByIDRequest, opts ...yarpc.CallOption, ) error { @@ -459,11 +459,11 @@ func (c *retryableClient) RespondActivityTaskFailedByID( func (c *retryableClient) RespondDecisionTaskCompleted( ctx context.Context, - request *shared.RespondDecisionTaskCompletedRequest, + request *types.RespondDecisionTaskCompletedRequest, opts ...yarpc.CallOption, -) (*shared.RespondDecisionTaskCompletedResponse, error) { +) (*types.RespondDecisionTaskCompletedResponse, error) { - var resp *shared.RespondDecisionTaskCompletedResponse + var resp *types.RespondDecisionTaskCompletedResponse op := func() error { var err error resp, err = c.client.RespondDecisionTaskCompleted(ctx, request, opts...) @@ -475,7 +475,7 @@ func (c *retryableClient) RespondDecisionTaskCompleted( func (c *retryableClient) RespondDecisionTaskFailed( ctx context.Context, - request *shared.RespondDecisionTaskFailedRequest, + request *types.RespondDecisionTaskFailedRequest, opts ...yarpc.CallOption, ) error { @@ -487,7 +487,7 @@ func (c *retryableClient) RespondDecisionTaskFailed( func (c *retryableClient) RespondQueryTaskCompleted( ctx context.Context, - request *shared.RespondQueryTaskCompletedRequest, + request *types.RespondQueryTaskCompletedRequest, opts ...yarpc.CallOption, ) error { @@ -499,11 +499,11 @@ func (c *retryableClient) RespondQueryTaskCompleted( func (c *retryableClient) SignalWithStartWorkflowExecution( ctx context.Context, - request *shared.SignalWithStartWorkflowExecutionRequest, + request *types.SignalWithStartWorkflowExecutionRequest, opts ...yarpc.CallOption, -) (*shared.StartWorkflowExecutionResponse, error) { +) (*types.StartWorkflowExecutionResponse, error) { - var resp *shared.StartWorkflowExecutionResponse + var resp *types.StartWorkflowExecutionResponse op := func() error { var err error resp, err = c.client.SignalWithStartWorkflowExecution(ctx, request, opts...) @@ -515,7 +515,7 @@ func (c *retryableClient) SignalWithStartWorkflowExecution( func (c *retryableClient) SignalWorkflowExecution( ctx context.Context, - request *shared.SignalWorkflowExecutionRequest, + request *types.SignalWorkflowExecutionRequest, opts ...yarpc.CallOption, ) error { @@ -527,11 +527,11 @@ func (c *retryableClient) SignalWorkflowExecution( func (c *retryableClient) StartWorkflowExecution( ctx context.Context, - request *shared.StartWorkflowExecutionRequest, + request *types.StartWorkflowExecutionRequest, opts ...yarpc.CallOption, -) (*shared.StartWorkflowExecutionResponse, error) { +) (*types.StartWorkflowExecutionResponse, error) { - var resp *shared.StartWorkflowExecutionResponse + var resp *types.StartWorkflowExecutionResponse op := func() error { var err error resp, err = c.client.StartWorkflowExecution(ctx, request, opts...) @@ -543,7 +543,7 @@ func (c *retryableClient) StartWorkflowExecution( func (c *retryableClient) TerminateWorkflowExecution( ctx context.Context, - request *shared.TerminateWorkflowExecutionRequest, + request *types.TerminateWorkflowExecutionRequest, opts ...yarpc.CallOption, ) error { @@ -555,11 +555,11 @@ func (c *retryableClient) TerminateWorkflowExecution( func (c *retryableClient) UpdateDomain( ctx context.Context, - request *shared.UpdateDomainRequest, + request *types.UpdateDomainRequest, opts ...yarpc.CallOption, -) (*shared.UpdateDomainResponse, error) { +) (*types.UpdateDomainResponse, error) { - var resp *shared.UpdateDomainResponse + var resp *types.UpdateDomainResponse op := func() error { var err error resp, err = c.client.UpdateDomain(ctx, request, opts...) @@ -572,8 +572,8 @@ func (c *retryableClient) UpdateDomain( func (c *retryableClient) GetClusterInfo( ctx context.Context, opts ...yarpc.CallOption, -) (*shared.ClusterInfo, error) { - var resp *shared.ClusterInfo +) (*types.ClusterInfo, error) { + var resp *types.ClusterInfo op := func() error { var err error resp, err = c.client.GetClusterInfo(ctx, opts...) @@ -585,10 +585,10 @@ func (c *retryableClient) GetClusterInfo( func (c *retryableClient) ListTaskListPartitions( ctx context.Context, - request *shared.ListTaskListPartitionsRequest, + request *types.ListTaskListPartitionsRequest, opts ...yarpc.CallOption, -) (*shared.ListTaskListPartitionsResponse, error) { - var resp *shared.ListTaskListPartitionsResponse +) (*types.ListTaskListPartitionsResponse, error) { + var resp *types.ListTaskListPartitionsResponse op := func() error { var err error resp, err = c.client.ListTaskListPartitions(ctx, request, opts...) diff --git a/client/frontend/thriftClient.go b/client/frontend/thriftClient.go index 97df431ced4..1504ce87aa6 100644 --- a/client/frontend/thriftClient.go +++ b/client/frontend/thriftClient.go @@ -26,7 +26,8 @@ import ( "go.uber.org/yarpc" "github.com/uber/cadence/.gen/go/cadence/workflowserviceclient" - "github.com/uber/cadence/.gen/go/shared" + "github.com/uber/cadence/common/types" + "github.com/uber/cadence/common/types/mapper/thrift" ) type thriftClient struct { @@ -38,154 +39,192 @@ func NewThriftClient(c workflowserviceclient.Interface) Client { return thriftClient{c} } -func (t thriftClient) CountWorkflowExecutions(ctx context.Context, request *shared.CountWorkflowExecutionsRequest, opts ...yarpc.CallOption) (*shared.CountWorkflowExecutionsResponse, error) { - return t.c.CountWorkflowExecutions(ctx, request, opts...) +func (t thriftClient) CountWorkflowExecutions(ctx context.Context, request *types.CountWorkflowExecutionsRequest, opts ...yarpc.CallOption) (*types.CountWorkflowExecutionsResponse, error) { + response, err := t.c.CountWorkflowExecutions(ctx, thrift.FromCountWorkflowExecutionsRequest(request), opts...) + return thrift.ToCountWorkflowExecutionsResponse(response), thrift.ToError(err) } -func (t thriftClient) DeprecateDomain(ctx context.Context, request *shared.DeprecateDomainRequest, opts ...yarpc.CallOption) error { - return t.c.DeprecateDomain(ctx, request, opts...) +func (t thriftClient) DeprecateDomain(ctx context.Context, request *types.DeprecateDomainRequest, opts ...yarpc.CallOption) error { + err := t.c.DeprecateDomain(ctx, thrift.FromDeprecateDomainRequest(request), opts...) + return thrift.ToError(err) } -func (t thriftClient) DescribeDomain(ctx context.Context, request *shared.DescribeDomainRequest, opts ...yarpc.CallOption) (*shared.DescribeDomainResponse, error) { - return t.c.DescribeDomain(ctx, request, opts...) +func (t thriftClient) DescribeDomain(ctx context.Context, request *types.DescribeDomainRequest, opts ...yarpc.CallOption) (*types.DescribeDomainResponse, error) { + response, err := t.c.DescribeDomain(ctx, thrift.FromDescribeDomainRequest(request), opts...) + return thrift.ToDescribeDomainResponse(response), thrift.ToError(err) } -func (t thriftClient) DescribeTaskList(ctx context.Context, request *shared.DescribeTaskListRequest, opts ...yarpc.CallOption) (*shared.DescribeTaskListResponse, error) { - return t.c.DescribeTaskList(ctx, request, opts...) +func (t thriftClient) DescribeTaskList(ctx context.Context, request *types.DescribeTaskListRequest, opts ...yarpc.CallOption) (*types.DescribeTaskListResponse, error) { + response, err := t.c.DescribeTaskList(ctx, thrift.FromDescribeTaskListRequest(request), opts...) + return thrift.ToDescribeTaskListResponse(response), thrift.ToError(err) } -func (t thriftClient) DescribeWorkflowExecution(ctx context.Context, request *shared.DescribeWorkflowExecutionRequest, opts ...yarpc.CallOption) (*shared.DescribeWorkflowExecutionResponse, error) { - return t.c.DescribeWorkflowExecution(ctx, request, opts...) +func (t thriftClient) DescribeWorkflowExecution(ctx context.Context, request *types.DescribeWorkflowExecutionRequest, opts ...yarpc.CallOption) (*types.DescribeWorkflowExecutionResponse, error) { + response, err := t.c.DescribeWorkflowExecution(ctx, thrift.FromDescribeWorkflowExecutionRequest(request), opts...) + return thrift.ToDescribeWorkflowExecutionResponse(response), thrift.ToError(err) } -func (t thriftClient) GetClusterInfo(ctx context.Context, opts ...yarpc.CallOption) (*shared.ClusterInfo, error) { - return t.c.GetClusterInfo(ctx, opts...) +func (t thriftClient) GetClusterInfo(ctx context.Context, opts ...yarpc.CallOption) (*types.ClusterInfo, error) { + response, err := t.c.GetClusterInfo(ctx, opts...) + return thrift.ToClusterInfo(response), thrift.ToError(err) } -func (t thriftClient) GetSearchAttributes(ctx context.Context, opts ...yarpc.CallOption) (*shared.GetSearchAttributesResponse, error) { - return t.c.GetSearchAttributes(ctx, opts...) +func (t thriftClient) GetSearchAttributes(ctx context.Context, opts ...yarpc.CallOption) (*types.GetSearchAttributesResponse, error) { + response, err := t.c.GetSearchAttributes(ctx, opts...) + return thrift.ToGetSearchAttributesResponse(response), thrift.ToError(err) } -func (t thriftClient) GetWorkflowExecutionHistory(ctx context.Context, request *shared.GetWorkflowExecutionHistoryRequest, opts ...yarpc.CallOption) (*shared.GetWorkflowExecutionHistoryResponse, error) { - return t.c.GetWorkflowExecutionHistory(ctx, request, opts...) +func (t thriftClient) GetWorkflowExecutionHistory(ctx context.Context, request *types.GetWorkflowExecutionHistoryRequest, opts ...yarpc.CallOption) (*types.GetWorkflowExecutionHistoryResponse, error) { + response, err := t.c.GetWorkflowExecutionHistory(ctx, thrift.FromGetWorkflowExecutionHistoryRequest(request), opts...) + return thrift.ToGetWorkflowExecutionHistoryResponse(response), thrift.ToError(err) } -func (t thriftClient) ListArchivedWorkflowExecutions(ctx context.Context, request *shared.ListArchivedWorkflowExecutionsRequest, opts ...yarpc.CallOption) (*shared.ListArchivedWorkflowExecutionsResponse, error) { - return t.c.ListArchivedWorkflowExecutions(ctx, request, opts...) +func (t thriftClient) ListArchivedWorkflowExecutions(ctx context.Context, request *types.ListArchivedWorkflowExecutionsRequest, opts ...yarpc.CallOption) (*types.ListArchivedWorkflowExecutionsResponse, error) { + response, err := t.c.ListArchivedWorkflowExecutions(ctx, thrift.FromListArchivedWorkflowExecutionsRequest(request), opts...) + return thrift.ToListArchivedWorkflowExecutionsResponse(response), thrift.ToError(err) } -func (t thriftClient) ListClosedWorkflowExecutions(ctx context.Context, request *shared.ListClosedWorkflowExecutionsRequest, opts ...yarpc.CallOption) (*shared.ListClosedWorkflowExecutionsResponse, error) { - return t.c.ListClosedWorkflowExecutions(ctx, request, opts...) +func (t thriftClient) ListClosedWorkflowExecutions(ctx context.Context, request *types.ListClosedWorkflowExecutionsRequest, opts ...yarpc.CallOption) (*types.ListClosedWorkflowExecutionsResponse, error) { + response, err := t.c.ListClosedWorkflowExecutions(ctx, thrift.FromListClosedWorkflowExecutionsRequest(request), opts...) + return thrift.ToListClosedWorkflowExecutionsResponse(response), thrift.ToError(err) } -func (t thriftClient) ListDomains(ctx context.Context, request *shared.ListDomainsRequest, opts ...yarpc.CallOption) (*shared.ListDomainsResponse, error) { - return t.c.ListDomains(ctx, request, opts...) +func (t thriftClient) ListDomains(ctx context.Context, request *types.ListDomainsRequest, opts ...yarpc.CallOption) (*types.ListDomainsResponse, error) { + response, err := t.c.ListDomains(ctx, thrift.FromListDomainsRequest(request), opts...) + return thrift.ToListDomainsResponse(response), thrift.ToError(err) } -func (t thriftClient) ListOpenWorkflowExecutions(ctx context.Context, request *shared.ListOpenWorkflowExecutionsRequest, opts ...yarpc.CallOption) (*shared.ListOpenWorkflowExecutionsResponse, error) { - return t.c.ListOpenWorkflowExecutions(ctx, request, opts...) +func (t thriftClient) ListOpenWorkflowExecutions(ctx context.Context, request *types.ListOpenWorkflowExecutionsRequest, opts ...yarpc.CallOption) (*types.ListOpenWorkflowExecutionsResponse, error) { + response, err := t.c.ListOpenWorkflowExecutions(ctx, thrift.FromListOpenWorkflowExecutionsRequest(request), opts...) + return thrift.ToListOpenWorkflowExecutionsResponse(response), thrift.ToError(err) } -func (t thriftClient) ListTaskListPartitions(ctx context.Context, request *shared.ListTaskListPartitionsRequest, opts ...yarpc.CallOption) (*shared.ListTaskListPartitionsResponse, error) { - return t.c.ListTaskListPartitions(ctx, request, opts...) +func (t thriftClient) ListTaskListPartitions(ctx context.Context, request *types.ListTaskListPartitionsRequest, opts ...yarpc.CallOption) (*types.ListTaskListPartitionsResponse, error) { + response, err := t.c.ListTaskListPartitions(ctx, thrift.FromListTaskListPartitionsRequest(request), opts...) + return thrift.ToListTaskListPartitionsResponse(response), thrift.ToError(err) } -func (t thriftClient) ListWorkflowExecutions(ctx context.Context, request *shared.ListWorkflowExecutionsRequest, opts ...yarpc.CallOption) (*shared.ListWorkflowExecutionsResponse, error) { - return t.c.ListWorkflowExecutions(ctx, request, opts...) +func (t thriftClient) ListWorkflowExecutions(ctx context.Context, request *types.ListWorkflowExecutionsRequest, opts ...yarpc.CallOption) (*types.ListWorkflowExecutionsResponse, error) { + response, err := t.c.ListWorkflowExecutions(ctx, thrift.FromListWorkflowExecutionsRequest(request), opts...) + return thrift.ToListWorkflowExecutionsResponse(response), thrift.ToError(err) } -func (t thriftClient) PollForActivityTask(ctx context.Context, request *shared.PollForActivityTaskRequest, opts ...yarpc.CallOption) (*shared.PollForActivityTaskResponse, error) { - return t.c.PollForActivityTask(ctx, request, opts...) +func (t thriftClient) PollForActivityTask(ctx context.Context, request *types.PollForActivityTaskRequest, opts ...yarpc.CallOption) (*types.PollForActivityTaskResponse, error) { + response, err := t.c.PollForActivityTask(ctx, thrift.FromPollForActivityTaskRequest(request), opts...) + return thrift.ToPollForActivityTaskResponse(response), thrift.ToError(err) } -func (t thriftClient) PollForDecisionTask(ctx context.Context, request *shared.PollForDecisionTaskRequest, opts ...yarpc.CallOption) (*shared.PollForDecisionTaskResponse, error) { - return t.c.PollForDecisionTask(ctx, request, opts...) +func (t thriftClient) PollForDecisionTask(ctx context.Context, request *types.PollForDecisionTaskRequest, opts ...yarpc.CallOption) (*types.PollForDecisionTaskResponse, error) { + response, err := t.c.PollForDecisionTask(ctx, thrift.FromPollForDecisionTaskRequest(request), opts...) + return thrift.ToPollForDecisionTaskResponse(response), thrift.ToError(err) } -func (t thriftClient) QueryWorkflow(ctx context.Context, request *shared.QueryWorkflowRequest, opts ...yarpc.CallOption) (*shared.QueryWorkflowResponse, error) { - return t.c.QueryWorkflow(ctx, request, opts...) +func (t thriftClient) QueryWorkflow(ctx context.Context, request *types.QueryWorkflowRequest, opts ...yarpc.CallOption) (*types.QueryWorkflowResponse, error) { + response, err := t.c.QueryWorkflow(ctx, thrift.FromQueryWorkflowRequest(request), opts...) + return thrift.ToQueryWorkflowResponse(response), thrift.ToError(err) } -func (t thriftClient) RecordActivityTaskHeartbeat(ctx context.Context, request *shared.RecordActivityTaskHeartbeatRequest, opts ...yarpc.CallOption) (*shared.RecordActivityTaskHeartbeatResponse, error) { - return t.c.RecordActivityTaskHeartbeat(ctx, request, opts...) +func (t thriftClient) RecordActivityTaskHeartbeat(ctx context.Context, request *types.RecordActivityTaskHeartbeatRequest, opts ...yarpc.CallOption) (*types.RecordActivityTaskHeartbeatResponse, error) { + response, err := t.c.RecordActivityTaskHeartbeat(ctx, thrift.FromRecordActivityTaskHeartbeatRequest(request), opts...) + return thrift.ToRecordActivityTaskHeartbeatResponse(response), thrift.ToError(err) } -func (t thriftClient) RecordActivityTaskHeartbeatByID(ctx context.Context, request *shared.RecordActivityTaskHeartbeatByIDRequest, opts ...yarpc.CallOption) (*shared.RecordActivityTaskHeartbeatResponse, error) { - return t.c.RecordActivityTaskHeartbeatByID(ctx, request, opts...) +func (t thriftClient) RecordActivityTaskHeartbeatByID(ctx context.Context, request *types.RecordActivityTaskHeartbeatByIDRequest, opts ...yarpc.CallOption) (*types.RecordActivityTaskHeartbeatResponse, error) { + response, err := t.c.RecordActivityTaskHeartbeatByID(ctx, thrift.FromRecordActivityTaskHeartbeatByIDRequest(request), opts...) + return thrift.ToRecordActivityTaskHeartbeatResponse(response), thrift.ToError(err) } -func (t thriftClient) RegisterDomain(ctx context.Context, request *shared.RegisterDomainRequest, opts ...yarpc.CallOption) error { - return t.c.RegisterDomain(ctx, request, opts...) +func (t thriftClient) RegisterDomain(ctx context.Context, request *types.RegisterDomainRequest, opts ...yarpc.CallOption) error { + err := t.c.RegisterDomain(ctx, thrift.FromRegisterDomainRequest(request), opts...) + return thrift.ToError(err) } -func (t thriftClient) RequestCancelWorkflowExecution(ctx context.Context, request *shared.RequestCancelWorkflowExecutionRequest, opts ...yarpc.CallOption) error { - return t.c.RequestCancelWorkflowExecution(ctx, request, opts...) +func (t thriftClient) RequestCancelWorkflowExecution(ctx context.Context, request *types.RequestCancelWorkflowExecutionRequest, opts ...yarpc.CallOption) error { + err := t.c.RequestCancelWorkflowExecution(ctx, thrift.FromRequestCancelWorkflowExecutionRequest(request), opts...) + return thrift.ToError(err) } -func (t thriftClient) ResetStickyTaskList(ctx context.Context, request *shared.ResetStickyTaskListRequest, opts ...yarpc.CallOption) (*shared.ResetStickyTaskListResponse, error) { - return t.c.ResetStickyTaskList(ctx, request, opts...) +func (t thriftClient) ResetStickyTaskList(ctx context.Context, request *types.ResetStickyTaskListRequest, opts ...yarpc.CallOption) (*types.ResetStickyTaskListResponse, error) { + response, err := t.c.ResetStickyTaskList(ctx, thrift.FromResetStickyTaskListRequest(request), opts...) + return thrift.ToResetStickyTaskListResponse(response), thrift.ToError(err) } -func (t thriftClient) ResetWorkflowExecution(ctx context.Context, request *shared.ResetWorkflowExecutionRequest, opts ...yarpc.CallOption) (*shared.ResetWorkflowExecutionResponse, error) { - return t.c.ResetWorkflowExecution(ctx, request, opts...) +func (t thriftClient) ResetWorkflowExecution(ctx context.Context, request *types.ResetWorkflowExecutionRequest, opts ...yarpc.CallOption) (*types.ResetWorkflowExecutionResponse, error) { + response, err := t.c.ResetWorkflowExecution(ctx, thrift.FromResetWorkflowExecutionRequest(request), opts...) + return thrift.ToResetWorkflowExecutionResponse(response), thrift.ToError(err) } -func (t thriftClient) RespondActivityTaskCanceled(ctx context.Context, request *shared.RespondActivityTaskCanceledRequest, opts ...yarpc.CallOption) error { - return t.c.RespondActivityTaskCanceled(ctx, request, opts...) +func (t thriftClient) RespondActivityTaskCanceled(ctx context.Context, request *types.RespondActivityTaskCanceledRequest, opts ...yarpc.CallOption) error { + err := t.c.RespondActivityTaskCanceled(ctx, thrift.FromRespondActivityTaskCanceledRequest(request), opts...) + return thrift.ToError(err) } -func (t thriftClient) RespondActivityTaskCanceledByID(ctx context.Context, request *shared.RespondActivityTaskCanceledByIDRequest, opts ...yarpc.CallOption) error { - return t.c.RespondActivityTaskCanceledByID(ctx, request, opts...) +func (t thriftClient) RespondActivityTaskCanceledByID(ctx context.Context, request *types.RespondActivityTaskCanceledByIDRequest, opts ...yarpc.CallOption) error { + err := t.c.RespondActivityTaskCanceledByID(ctx, thrift.FromRespondActivityTaskCanceledByIDRequest(request), opts...) + return thrift.ToError(err) } -func (t thriftClient) RespondActivityTaskCompleted(ctx context.Context, request *shared.RespondActivityTaskCompletedRequest, opts ...yarpc.CallOption) error { - return t.c.RespondActivityTaskCompleted(ctx, request, opts...) +func (t thriftClient) RespondActivityTaskCompleted(ctx context.Context, request *types.RespondActivityTaskCompletedRequest, opts ...yarpc.CallOption) error { + err := t.c.RespondActivityTaskCompleted(ctx, thrift.FromRespondActivityTaskCompletedRequest(request), opts...) + return thrift.ToError(err) } -func (t thriftClient) RespondActivityTaskCompletedByID(ctx context.Context, request *shared.RespondActivityTaskCompletedByIDRequest, opts ...yarpc.CallOption) error { - return t.c.RespondActivityTaskCompletedByID(ctx, request, opts...) +func (t thriftClient) RespondActivityTaskCompletedByID(ctx context.Context, request *types.RespondActivityTaskCompletedByIDRequest, opts ...yarpc.CallOption) error { + err := t.c.RespondActivityTaskCompletedByID(ctx, thrift.FromRespondActivityTaskCompletedByIDRequest(request), opts...) + return thrift.ToError(err) } -func (t thriftClient) RespondActivityTaskFailed(ctx context.Context, request *shared.RespondActivityTaskFailedRequest, opts ...yarpc.CallOption) error { - return t.c.RespondActivityTaskFailed(ctx, request, opts...) +func (t thriftClient) RespondActivityTaskFailed(ctx context.Context, request *types.RespondActivityTaskFailedRequest, opts ...yarpc.CallOption) error { + err := t.c.RespondActivityTaskFailed(ctx, thrift.FromRespondActivityTaskFailedRequest(request), opts...) + return thrift.ToError(err) } -func (t thriftClient) RespondActivityTaskFailedByID(ctx context.Context, request *shared.RespondActivityTaskFailedByIDRequest, opts ...yarpc.CallOption) error { - return t.c.RespondActivityTaskFailedByID(ctx, request, opts...) +func (t thriftClient) RespondActivityTaskFailedByID(ctx context.Context, request *types.RespondActivityTaskFailedByIDRequest, opts ...yarpc.CallOption) error { + err := t.c.RespondActivityTaskFailedByID(ctx, thrift.FromRespondActivityTaskFailedByIDRequest(request), opts...) + return thrift.ToError(err) } -func (t thriftClient) RespondDecisionTaskCompleted(ctx context.Context, request *shared.RespondDecisionTaskCompletedRequest, opts ...yarpc.CallOption) (*shared.RespondDecisionTaskCompletedResponse, error) { - return t.c.RespondDecisionTaskCompleted(ctx, request, opts...) +func (t thriftClient) RespondDecisionTaskCompleted(ctx context.Context, request *types.RespondDecisionTaskCompletedRequest, opts ...yarpc.CallOption) (*types.RespondDecisionTaskCompletedResponse, error) { + response, err := t.c.RespondDecisionTaskCompleted(ctx, thrift.FromRespondDecisionTaskCompletedRequest(request), opts...) + return thrift.ToRespondDecisionTaskCompletedResponse(response), thrift.ToError(err) } -func (t thriftClient) RespondDecisionTaskFailed(ctx context.Context, request *shared.RespondDecisionTaskFailedRequest, opts ...yarpc.CallOption) error { - return t.c.RespondDecisionTaskFailed(ctx, request, opts...) +func (t thriftClient) RespondDecisionTaskFailed(ctx context.Context, request *types.RespondDecisionTaskFailedRequest, opts ...yarpc.CallOption) error { + err := t.c.RespondDecisionTaskFailed(ctx, thrift.FromRespondDecisionTaskFailedRequest(request), opts...) + return thrift.ToError(err) } -func (t thriftClient) RespondQueryTaskCompleted(ctx context.Context, request *shared.RespondQueryTaskCompletedRequest, opts ...yarpc.CallOption) error { - return t.c.RespondQueryTaskCompleted(ctx, request, opts...) +func (t thriftClient) RespondQueryTaskCompleted(ctx context.Context, request *types.RespondQueryTaskCompletedRequest, opts ...yarpc.CallOption) error { + err := t.c.RespondQueryTaskCompleted(ctx, thrift.FromRespondQueryTaskCompletedRequest(request), opts...) + return thrift.ToError(err) } -func (t thriftClient) ScanWorkflowExecutions(ctx context.Context, request *shared.ListWorkflowExecutionsRequest, opts ...yarpc.CallOption) (*shared.ListWorkflowExecutionsResponse, error) { - return t.c.ScanWorkflowExecutions(ctx, request, opts...) +func (t thriftClient) ScanWorkflowExecutions(ctx context.Context, request *types.ListWorkflowExecutionsRequest, opts ...yarpc.CallOption) (*types.ListWorkflowExecutionsResponse, error) { + response, err := t.c.ScanWorkflowExecutions(ctx, thrift.FromListWorkflowExecutionsRequest(request), opts...) + return thrift.ToListWorkflowExecutionsResponse(response), thrift.ToError(err) } -func (t thriftClient) SignalWithStartWorkflowExecution(ctx context.Context, request *shared.SignalWithStartWorkflowExecutionRequest, opts ...yarpc.CallOption) (*shared.StartWorkflowExecutionResponse, error) { - return t.c.SignalWithStartWorkflowExecution(ctx, request, opts...) +func (t thriftClient) SignalWithStartWorkflowExecution(ctx context.Context, request *types.SignalWithStartWorkflowExecutionRequest, opts ...yarpc.CallOption) (*types.StartWorkflowExecutionResponse, error) { + response, err := t.c.SignalWithStartWorkflowExecution(ctx, thrift.FromSignalWithStartWorkflowExecutionRequest(request), opts...) + return thrift.ToStartWorkflowExecutionResponse(response), thrift.ToError(err) } -func (t thriftClient) SignalWorkflowExecution(ctx context.Context, request *shared.SignalWorkflowExecutionRequest, opts ...yarpc.CallOption) error { - return t.c.SignalWorkflowExecution(ctx, request, opts...) +func (t thriftClient) SignalWorkflowExecution(ctx context.Context, request *types.SignalWorkflowExecutionRequest, opts ...yarpc.CallOption) error { + err := t.c.SignalWorkflowExecution(ctx, thrift.FromSignalWorkflowExecutionRequest(request), opts...) + return thrift.ToError(err) } -func (t thriftClient) StartWorkflowExecution(ctx context.Context, request *shared.StartWorkflowExecutionRequest, opts ...yarpc.CallOption) (*shared.StartWorkflowExecutionResponse, error) { - return t.c.StartWorkflowExecution(ctx, request, opts...) +func (t thriftClient) StartWorkflowExecution(ctx context.Context, request *types.StartWorkflowExecutionRequest, opts ...yarpc.CallOption) (*types.StartWorkflowExecutionResponse, error) { + response, err := t.c.StartWorkflowExecution(ctx, thrift.FromStartWorkflowExecutionRequest(request), opts...) + return thrift.ToStartWorkflowExecutionResponse(response), thrift.ToError(err) } -func (t thriftClient) TerminateWorkflowExecution(ctx context.Context, request *shared.TerminateWorkflowExecutionRequest, opts ...yarpc.CallOption) error { - return t.c.TerminateWorkflowExecution(ctx, request, opts...) +func (t thriftClient) TerminateWorkflowExecution(ctx context.Context, request *types.TerminateWorkflowExecutionRequest, opts ...yarpc.CallOption) error { + err := t.c.TerminateWorkflowExecution(ctx, thrift.FromTerminateWorkflowExecutionRequest(request), opts...) + return thrift.ToError(err) } -func (t thriftClient) UpdateDomain(ctx context.Context, request *shared.UpdateDomainRequest, opts ...yarpc.CallOption) (*shared.UpdateDomainResponse, error) { - return t.c.UpdateDomain(ctx, request, opts...) +func (t thriftClient) UpdateDomain(ctx context.Context, request *types.UpdateDomainRequest, opts ...yarpc.CallOption) (*types.UpdateDomainResponse, error) { + response, err := t.c.UpdateDomain(ctx, thrift.FromUpdateDomainRequest(request), opts...) + return thrift.ToUpdateDomainResponse(response), thrift.ToError(err) } diff --git a/common/resource/resourceTest.go b/common/resource/resourceTest.go index 5f56e3fb568..46b34c69a3e 100644 --- a/common/resource/resourceTest.go +++ b/common/resource/resourceTest.go @@ -28,7 +28,6 @@ import ( publicservicetest "go.uber.org/cadence/.gen/go/cadence/workflowservicetest" "github.com/uber/cadence/.gen/go/admin/adminservicetest" - "github.com/uber/cadence/.gen/go/cadence/workflowservicetest" "github.com/uber/cadence/.gen/go/history/historyservicetest" "github.com/uber/cadence/client" "github.com/uber/cadence/client/admin" @@ -83,11 +82,11 @@ type ( // internal services clients SDKClient *publicservicetest.MockClient - FrontendClient *workflowservicetest.MockClient + FrontendClient *frontend.MockClient MatchingClient *matching.MockClient HistoryClient *historyservicetest.MockClient RemoteAdminClient *adminservicetest.MockClient - RemoteFrontendClient *workflowservicetest.MockClient + RemoteFrontendClient *frontend.MockClient ClientBean *client.MockBean // persistence clients @@ -127,10 +126,10 @@ func NewTest( } logger := loggerimpl.NewLogger(zapLogger) - frontendClient := workflowservicetest.NewMockClient(controller) + frontendClient := frontend.NewMockClient(controller) matchingClient := matching.NewMockClient(controller) historyClient := historyservicetest.NewMockClient(controller) - remoteFrontendClient := workflowservicetest.NewMockClient(controller) + remoteFrontendClient := frontend.NewMockClient(controller) remoteAdminClient := adminservicetest.NewMockClient(controller) clientBean := client.NewMockBean(controller) clientBean.EXPECT().GetFrontendClient().Return(frontendClient).AnyTimes() diff --git a/service/frontend/dcRedirectionHandler.go b/service/frontend/dcRedirectionHandler.go index ab1efddce67..60ddc686cfc 100644 --- a/service/frontend/dcRedirectionHandler.go +++ b/service/frontend/dcRedirectionHandler.go @@ -31,6 +31,7 @@ import ( "github.com/uber/cadence/common/metrics" "github.com/uber/cadence/common/resource" "github.com/uber/cadence/common/service/config" + "github.com/uber/cadence/common/types/mapper/thrift" ) var _ Handler = (*DCRedirectionHandlerImpl)(nil) @@ -181,7 +182,9 @@ func (handler *DCRedirectionHandlerImpl) DescribeTaskList( resp, err = handler.frontendHandler.DescribeTaskList(ctx, request) default: remoteClient := handler.GetRemoteFrontendClient(targetDC) - resp, err = remoteClient.DescribeTaskList(ctx, request) + response, err := remoteClient.DescribeTaskList(ctx, thrift.ToDescribeTaskListRequest(request)) + resp = thrift.FromDescribeTaskListResponse(response) + err = thrift.FromError(err) } return err }) @@ -211,7 +214,9 @@ func (handler *DCRedirectionHandlerImpl) DescribeWorkflowExecution( resp, err = handler.frontendHandler.DescribeWorkflowExecution(ctx, request) default: remoteClient := handler.GetRemoteFrontendClient(targetDC) - resp, err = remoteClient.DescribeWorkflowExecution(ctx, request) + response, err := remoteClient.DescribeWorkflowExecution(ctx, thrift.ToDescribeWorkflowExecutionRequest(request)) + resp = thrift.FromDescribeWorkflowExecutionResponse(response) + err = thrift.FromError(err) } return err }) @@ -241,7 +246,9 @@ func (handler *DCRedirectionHandlerImpl) GetWorkflowExecutionHistory( resp, err = handler.frontendHandler.GetWorkflowExecutionHistory(ctx, request) default: remoteClient := handler.GetRemoteFrontendClient(targetDC) - resp, err = remoteClient.GetWorkflowExecutionHistory(ctx, request) + response, err := remoteClient.GetWorkflowExecutionHistory(ctx, thrift.ToGetWorkflowExecutionHistoryRequest(request)) + resp = thrift.FromGetWorkflowExecutionHistoryResponse(response) + err = thrift.FromError(err) } return err }) @@ -271,7 +278,9 @@ func (handler *DCRedirectionHandlerImpl) ListArchivedWorkflowExecutions( resp, err = handler.frontendHandler.ListArchivedWorkflowExecutions(ctx, request) default: remoteClient := handler.GetRemoteFrontendClient(targetDC) - resp, err = remoteClient.ListArchivedWorkflowExecutions(ctx, request) + response, err := remoteClient.ListArchivedWorkflowExecutions(ctx, thrift.ToListArchivedWorkflowExecutionsRequest(request)) + resp = thrift.FromListArchivedWorkflowExecutionsResponse(response) + err = thrift.FromError(err) } return err }) @@ -301,7 +310,9 @@ func (handler *DCRedirectionHandlerImpl) ListClosedWorkflowExecutions( resp, err = handler.frontendHandler.ListClosedWorkflowExecutions(ctx, request) default: remoteClient := handler.GetRemoteFrontendClient(targetDC) - resp, err = remoteClient.ListClosedWorkflowExecutions(ctx, request) + response, err := remoteClient.ListClosedWorkflowExecutions(ctx, thrift.ToListClosedWorkflowExecutionsRequest(request)) + resp = thrift.FromListClosedWorkflowExecutionsResponse(response) + err = thrift.FromError(err) } return err }) @@ -331,7 +342,9 @@ func (handler *DCRedirectionHandlerImpl) ListOpenWorkflowExecutions( resp, err = handler.frontendHandler.ListOpenWorkflowExecutions(ctx, request) default: remoteClient := handler.GetRemoteFrontendClient(targetDC) - resp, err = remoteClient.ListOpenWorkflowExecutions(ctx, request) + response, err := remoteClient.ListOpenWorkflowExecutions(ctx, thrift.ToListOpenWorkflowExecutionsRequest(request)) + resp = thrift.FromListOpenWorkflowExecutionsResponse(response) + err = thrift.FromError(err) } return err }) @@ -361,7 +374,9 @@ func (handler *DCRedirectionHandlerImpl) ListWorkflowExecutions( resp, err = handler.frontendHandler.ListWorkflowExecutions(ctx, request) default: remoteClient := handler.GetRemoteFrontendClient(targetDC) - resp, err = remoteClient.ListWorkflowExecutions(ctx, request) + response, err := remoteClient.ListWorkflowExecutions(ctx, thrift.ToListWorkflowExecutionsRequest(request)) + resp = thrift.FromListWorkflowExecutionsResponse(response) + err = thrift.FromError(err) } return err }) @@ -390,7 +405,9 @@ func (handler *DCRedirectionHandlerImpl) ScanWorkflowExecutions( resp, err = handler.frontendHandler.ScanWorkflowExecutions(ctx, request) default: remoteClient := handler.GetRemoteFrontendClient(targetDC) - resp, err = remoteClient.ScanWorkflowExecutions(ctx, request) + response, err := remoteClient.ScanWorkflowExecutions(ctx, thrift.ToListWorkflowExecutionsRequest(request)) + resp = thrift.FromListWorkflowExecutionsResponse(response) + err = thrift.FromError(err) } return err }) @@ -420,7 +437,9 @@ func (handler *DCRedirectionHandlerImpl) CountWorkflowExecutions( resp, err = handler.frontendHandler.CountWorkflowExecutions(ctx, request) default: remoteClient := handler.GetRemoteFrontendClient(targetDC) - resp, err = remoteClient.CountWorkflowExecutions(ctx, request) + response, err := remoteClient.CountWorkflowExecutions(ctx, thrift.ToCountWorkflowExecutionsRequest(request)) + resp = thrift.FromCountWorkflowExecutionsResponse(response) + err = thrift.FromError(err) } return err }) @@ -465,7 +484,9 @@ func (handler *DCRedirectionHandlerImpl) PollForActivityTask( resp, err = handler.frontendHandler.PollForActivityTask(ctx, request) default: remoteClient := handler.GetRemoteFrontendClient(targetDC) - resp, err = remoteClient.PollForActivityTask(ctx, request) + response, err := remoteClient.PollForActivityTask(ctx, thrift.ToPollForActivityTaskRequest(request)) + resp = thrift.FromPollForActivityTaskResponse(response) + err = thrift.FromError(err) } return err }) @@ -495,7 +516,9 @@ func (handler *DCRedirectionHandlerImpl) PollForDecisionTask( resp, err = handler.frontendHandler.PollForDecisionTask(ctx, request) default: remoteClient := handler.GetRemoteFrontendClient(targetDC) - resp, err = remoteClient.PollForDecisionTask(ctx, request) + response, err := remoteClient.PollForDecisionTask(ctx, thrift.ToPollForDecisionTaskRequest(request)) + resp = thrift.FromPollForDecisionTaskResponse(response) + err = thrift.FromError(err) } return err }) @@ -529,7 +552,9 @@ func (handler *DCRedirectionHandlerImpl) QueryWorkflow( // 2. If eventual consistency was requested then the results from running out of local dc will be fine. if request.GetQueryConsistencyLevel() == shared.QueryConsistencyLevelStrong { remoteClient := handler.GetRemoteFrontendClient(targetDC) - resp, err = remoteClient.QueryWorkflow(ctx, request) + response, err := remoteClient.QueryWorkflow(ctx, thrift.ToQueryWorkflowRequest(request)) + resp = thrift.FromQueryWorkflowResponse(response) + err = thrift.FromError(err) } else { resp, err = handler.frontendHandler.QueryWorkflow(ctx, request) } @@ -567,7 +592,9 @@ func (handler *DCRedirectionHandlerImpl) RecordActivityTaskHeartbeat( resp, err = handler.frontendHandler.RecordActivityTaskHeartbeat(ctx, request) default: remoteClient := handler.GetRemoteFrontendClient(targetDC) - resp, err = remoteClient.RecordActivityTaskHeartbeat(ctx, request) + response, err := remoteClient.RecordActivityTaskHeartbeat(ctx, thrift.ToRecordActivityTaskHeartbeatRequest(request)) + resp = thrift.FromRecordActivityTaskHeartbeatResponse(response) + err = thrift.FromError(err) } return err }) @@ -597,7 +624,9 @@ func (handler *DCRedirectionHandlerImpl) RecordActivityTaskHeartbeatByID( resp, err = handler.frontendHandler.RecordActivityTaskHeartbeatByID(ctx, request) default: remoteClient := handler.GetRemoteFrontendClient(targetDC) - resp, err = remoteClient.RecordActivityTaskHeartbeatByID(ctx, request) + response, err := remoteClient.RecordActivityTaskHeartbeatByID(ctx, thrift.ToRecordActivityTaskHeartbeatByIDRequest(request)) + resp = thrift.FromRecordActivityTaskHeartbeatResponse(response) + err = thrift.FromError(err) } return err }) @@ -627,7 +656,8 @@ func (handler *DCRedirectionHandlerImpl) RequestCancelWorkflowExecution( err = handler.frontendHandler.RequestCancelWorkflowExecution(ctx, request) default: remoteClient := handler.GetRemoteFrontendClient(targetDC) - err = remoteClient.RequestCancelWorkflowExecution(ctx, request) + err = remoteClient.RequestCancelWorkflowExecution(ctx, thrift.ToRequestCancelWorkflowExecutionRequest(request)) + err = thrift.FromError(err) } return err }) @@ -657,7 +687,9 @@ func (handler *DCRedirectionHandlerImpl) ResetStickyTaskList( resp, err = handler.frontendHandler.ResetStickyTaskList(ctx, request) default: remoteClient := handler.GetRemoteFrontendClient(targetDC) - resp, err = remoteClient.ResetStickyTaskList(ctx, request) + response, err := remoteClient.ResetStickyTaskList(ctx, thrift.ToResetStickyTaskListRequest(request)) + resp = thrift.FromResetStickyTaskListResponse(response) + err = thrift.FromError(err) } return err }) @@ -687,7 +719,9 @@ func (handler *DCRedirectionHandlerImpl) ResetWorkflowExecution( resp, err = handler.frontendHandler.ResetWorkflowExecution(ctx, request) default: remoteClient := handler.GetRemoteFrontendClient(targetDC) - resp, err = remoteClient.ResetWorkflowExecution(ctx, request) + response, err := remoteClient.ResetWorkflowExecution(ctx, thrift.ToResetWorkflowExecutionRequest(request)) + resp = thrift.FromResetWorkflowExecutionResponse(response) + err = thrift.FromError(err) } return err }) @@ -722,7 +756,8 @@ func (handler *DCRedirectionHandlerImpl) RespondActivityTaskCanceled( err = handler.frontendHandler.RespondActivityTaskCanceled(ctx, request) default: remoteClient := handler.GetRemoteFrontendClient(targetDC) - err = remoteClient.RespondActivityTaskCanceled(ctx, request) + err = remoteClient.RespondActivityTaskCanceled(ctx, thrift.ToRespondActivityTaskCanceledRequest(request)) + err = thrift.FromError(err) } return err }) @@ -752,7 +787,8 @@ func (handler *DCRedirectionHandlerImpl) RespondActivityTaskCanceledByID( err = handler.frontendHandler.RespondActivityTaskCanceledByID(ctx, request) default: remoteClient := handler.GetRemoteFrontendClient(targetDC) - err = remoteClient.RespondActivityTaskCanceledByID(ctx, request) + err = remoteClient.RespondActivityTaskCanceledByID(ctx, thrift.ToRespondActivityTaskCanceledByIDRequest(request)) + err = thrift.FromError(err) } return err }) @@ -787,7 +823,8 @@ func (handler *DCRedirectionHandlerImpl) RespondActivityTaskCompleted( err = handler.frontendHandler.RespondActivityTaskCompleted(ctx, request) default: remoteClient := handler.GetRemoteFrontendClient(targetDC) - err = remoteClient.RespondActivityTaskCompleted(ctx, request) + err = remoteClient.RespondActivityTaskCompleted(ctx, thrift.ToRespondActivityTaskCompletedRequest(request)) + err = thrift.FromError(err) } return err }) @@ -817,7 +854,8 @@ func (handler *DCRedirectionHandlerImpl) RespondActivityTaskCompletedByID( err = handler.frontendHandler.RespondActivityTaskCompletedByID(ctx, request) default: remoteClient := handler.GetRemoteFrontendClient(targetDC) - err = remoteClient.RespondActivityTaskCompletedByID(ctx, request) + err = remoteClient.RespondActivityTaskCompletedByID(ctx, thrift.ToRespondActivityTaskCompletedByIDRequest(request)) + err = thrift.FromError(err) } return err }) @@ -852,7 +890,8 @@ func (handler *DCRedirectionHandlerImpl) RespondActivityTaskFailed( err = handler.frontendHandler.RespondActivityTaskFailed(ctx, request) default: remoteClient := handler.GetRemoteFrontendClient(targetDC) - err = remoteClient.RespondActivityTaskFailed(ctx, request) + err = remoteClient.RespondActivityTaskFailed(ctx, thrift.ToRespondActivityTaskFailedRequest(request)) + err = thrift.FromError(err) } return err }) @@ -882,7 +921,8 @@ func (handler *DCRedirectionHandlerImpl) RespondActivityTaskFailedByID( err = handler.frontendHandler.RespondActivityTaskFailedByID(ctx, request) default: remoteClient := handler.GetRemoteFrontendClient(targetDC) - err = remoteClient.RespondActivityTaskFailedByID(ctx, request) + err = remoteClient.RespondActivityTaskFailedByID(ctx, thrift.ToRespondActivityTaskFailedByIDRequest(request)) + err = thrift.FromError(err) } return err }) @@ -917,7 +957,9 @@ func (handler *DCRedirectionHandlerImpl) RespondDecisionTaskCompleted( resp, err = handler.frontendHandler.RespondDecisionTaskCompleted(ctx, request) default: remoteClient := handler.GetRemoteFrontendClient(targetDC) - resp, err = remoteClient.RespondDecisionTaskCompleted(ctx, request) + response, err := remoteClient.RespondDecisionTaskCompleted(ctx, thrift.ToRespondDecisionTaskCompletedRequest(request)) + resp = thrift.FromRespondDecisionTaskCompletedResponse(response) + err = thrift.FromError(err) } return err }) @@ -952,7 +994,8 @@ func (handler *DCRedirectionHandlerImpl) RespondDecisionTaskFailed( err = handler.frontendHandler.RespondDecisionTaskFailed(ctx, request) default: remoteClient := handler.GetRemoteFrontendClient(targetDC) - err = remoteClient.RespondDecisionTaskFailed(ctx, request) + err = remoteClient.RespondDecisionTaskFailed(ctx, thrift.ToRespondDecisionTaskFailedRequest(request)) + err = thrift.FromError(err) } return err }) @@ -987,7 +1030,8 @@ func (handler *DCRedirectionHandlerImpl) RespondQueryTaskCompleted( err = handler.frontendHandler.RespondQueryTaskCompleted(ctx, request) default: remoteClient := handler.GetRemoteFrontendClient(targetDC) - err = remoteClient.RespondQueryTaskCompleted(ctx, request) + err = remoteClient.RespondQueryTaskCompleted(ctx, thrift.ToRespondQueryTaskCompletedRequest(request)) + err = thrift.FromError(err) } return err }) @@ -1017,7 +1061,9 @@ func (handler *DCRedirectionHandlerImpl) SignalWithStartWorkflowExecution( resp, err = handler.frontendHandler.SignalWithStartWorkflowExecution(ctx, request) default: remoteClient := handler.GetRemoteFrontendClient(targetDC) - resp, err = remoteClient.SignalWithStartWorkflowExecution(ctx, request) + response, err := remoteClient.SignalWithStartWorkflowExecution(ctx, thrift.ToSignalWithStartWorkflowExecutionRequest(request)) + resp = thrift.FromStartWorkflowExecutionResponse(response) + err = thrift.FromError(err) } return err }) @@ -1047,7 +1093,8 @@ func (handler *DCRedirectionHandlerImpl) SignalWorkflowExecution( err = handler.frontendHandler.SignalWorkflowExecution(ctx, request) default: remoteClient := handler.GetRemoteFrontendClient(targetDC) - err = remoteClient.SignalWorkflowExecution(ctx, request) + err = remoteClient.SignalWorkflowExecution(ctx, thrift.ToSignalWorkflowExecutionRequest(request)) + err = thrift.FromError(err) } return err }) @@ -1076,7 +1123,9 @@ func (handler *DCRedirectionHandlerImpl) StartWorkflowExecution( resp, err = handler.frontendHandler.StartWorkflowExecution(ctx, request) default: remoteClient := handler.GetRemoteFrontendClient(targetDC) - resp, err = remoteClient.StartWorkflowExecution(ctx, request) + response, err := remoteClient.StartWorkflowExecution(ctx, thrift.ToStartWorkflowExecutionRequest(request)) + resp = thrift.FromStartWorkflowExecutionResponse(response) + err = thrift.FromError(err) } return err }) @@ -1106,7 +1155,8 @@ func (handler *DCRedirectionHandlerImpl) TerminateWorkflowExecution( err = handler.frontendHandler.TerminateWorkflowExecution(ctx, request) default: remoteClient := handler.GetRemoteFrontendClient(targetDC) - err = remoteClient.TerminateWorkflowExecution(ctx, request) + err = remoteClient.TerminateWorkflowExecution(ctx, thrift.ToTerminateWorkflowExecutionRequest(request)) + err = thrift.FromError(err) } return err }) @@ -1136,7 +1186,9 @@ func (handler *DCRedirectionHandlerImpl) ListTaskListPartitions( resp, err = handler.frontendHandler.ListTaskListPartitions(ctx, request) default: remoteClient := handler.GetRemoteFrontendClient(targetDC) - resp, err = remoteClient.ListTaskListPartitions(ctx, request) + response, err := remoteClient.ListTaskListPartitions(ctx, thrift.ToListTaskListPartitionsRequest(request)) + resp = thrift.FromListTaskListPartitionsResponse(response) + err = thrift.FromError(err) } return err }) diff --git a/service/frontend/dcRedirectionHandler_test.go b/service/frontend/dcRedirectionHandler_test.go index 2249e980388..ff5c9500903 100644 --- a/service/frontend/dcRedirectionHandler_test.go +++ b/service/frontend/dcRedirectionHandler_test.go @@ -29,8 +29,8 @@ import ( "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - "github.com/uber/cadence/.gen/go/cadence/workflowservicetest" "github.com/uber/cadence/.gen/go/shared" + "github.com/uber/cadence/client/frontend" "github.com/uber/cadence/common" "github.com/uber/cadence/common/client" "github.com/uber/cadence/common/cluster" @@ -38,6 +38,8 @@ import ( "github.com/uber/cadence/common/resource" "github.com/uber/cadence/common/service/config" "github.com/uber/cadence/common/service/dynamicconfig" + "github.com/uber/cadence/common/types" + "github.com/uber/cadence/common/types/mapper/thrift" ) type ( @@ -48,7 +50,7 @@ type ( controller *gomock.Controller mockResource *resource.Test mockFrontendHandler *MockHandler - mockRemoteFrontendClient *workflowservicetest.MockClient + mockRemoteFrontendClient *frontend.MockClient mockClusterMetadata *cluster.MockMetadata mockDCRedirectionPolicy *MockDCRedirectionPolicy @@ -133,7 +135,7 @@ func (s *dcRedirectionHandlerSuite) TestDescribeTaskList() { s.mockFrontendHandler.EXPECT().DescribeTaskList(gomock.Any(), req).Return(&shared.DescribeTaskListResponse{}, nil).Times(1) err = callFn(s.currentClusterName) s.Nil(err) - s.mockRemoteFrontendClient.EXPECT().DescribeTaskList(gomock.Any(), req).Return(&shared.DescribeTaskListResponse{}, nil).Times(1) + s.mockRemoteFrontendClient.EXPECT().DescribeTaskList(gomock.Any(), thrift.ToDescribeTaskListRequest(req)).Return(&types.DescribeTaskListResponse{}, nil).Times(1) err = callFn(s.alternativeClusterName) s.Nil(err) } @@ -156,7 +158,7 @@ func (s *dcRedirectionHandlerSuite) TestDescribeWorkflowExecution() { s.mockFrontendHandler.EXPECT().DescribeWorkflowExecution(gomock.Any(), req).Return(&shared.DescribeWorkflowExecutionResponse{}, nil).Times(1) err = callFn(s.currentClusterName) s.Nil(err) - s.mockRemoteFrontendClient.EXPECT().DescribeWorkflowExecution(gomock.Any(), req).Return(&shared.DescribeWorkflowExecutionResponse{}, nil).Times(1) + s.mockRemoteFrontendClient.EXPECT().DescribeWorkflowExecution(gomock.Any(), thrift.ToDescribeWorkflowExecutionRequest(req)).Return(&types.DescribeWorkflowExecutionResponse{}, nil).Times(1) err = callFn(s.alternativeClusterName) s.Nil(err) } @@ -179,7 +181,7 @@ func (s *dcRedirectionHandlerSuite) TestGetWorkflowExecutionHistory() { s.mockFrontendHandler.EXPECT().GetWorkflowExecutionHistory(gomock.Any(), req).Return(&shared.GetWorkflowExecutionHistoryResponse{}, nil).Times(1) err = callFn(s.currentClusterName) s.Nil(err) - s.mockRemoteFrontendClient.EXPECT().GetWorkflowExecutionHistory(gomock.Any(), req).Return(&shared.GetWorkflowExecutionHistoryResponse{}, nil).Times(1) + s.mockRemoteFrontendClient.EXPECT().GetWorkflowExecutionHistory(gomock.Any(), thrift.ToGetWorkflowExecutionHistoryRequest(req)).Return(&types.GetWorkflowExecutionHistoryResponse{}, nil).Times(1) err = callFn(s.alternativeClusterName) s.Nil(err) } @@ -202,7 +204,7 @@ func (s *dcRedirectionHandlerSuite) TestListArchivedWorkflowExecutions() { s.mockFrontendHandler.EXPECT().ListArchivedWorkflowExecutions(gomock.Any(), req).Return(&shared.ListArchivedWorkflowExecutionsResponse{}, nil).Times(1) err = callFn(s.currentClusterName) s.Nil(err) - s.mockRemoteFrontendClient.EXPECT().ListArchivedWorkflowExecutions(gomock.Any(), req).Return(&shared.ListArchivedWorkflowExecutionsResponse{}, nil).Times(1) + s.mockRemoteFrontendClient.EXPECT().ListArchivedWorkflowExecutions(gomock.Any(), thrift.ToListArchivedWorkflowExecutionsRequest(req)).Return(&types.ListArchivedWorkflowExecutionsResponse{}, nil).Times(1) err = callFn(s.alternativeClusterName) s.Nil(err) } @@ -225,7 +227,7 @@ func (s *dcRedirectionHandlerSuite) TestListClosedWorkflowExecutions() { s.mockFrontendHandler.EXPECT().ListClosedWorkflowExecutions(gomock.Any(), req).Return(&shared.ListClosedWorkflowExecutionsResponse{}, nil).Times(1) err = callFn(s.currentClusterName) s.Nil(err) - s.mockRemoteFrontendClient.EXPECT().ListClosedWorkflowExecutions(gomock.Any(), req).Return(&shared.ListClosedWorkflowExecutionsResponse{}, nil).Times(1) + s.mockRemoteFrontendClient.EXPECT().ListClosedWorkflowExecutions(gomock.Any(), thrift.ToListClosedWorkflowExecutionsRequest(req)).Return(&types.ListClosedWorkflowExecutionsResponse{}, nil).Times(1) err = callFn(s.alternativeClusterName) s.Nil(err) } @@ -248,7 +250,7 @@ func (s *dcRedirectionHandlerSuite) TestListOpenWorkflowExecutions() { s.mockFrontendHandler.EXPECT().ListOpenWorkflowExecutions(gomock.Any(), req).Return(&shared.ListOpenWorkflowExecutionsResponse{}, nil).Times(1) err = callFn(s.currentClusterName) s.Nil(err) - s.mockRemoteFrontendClient.EXPECT().ListOpenWorkflowExecutions(gomock.Any(), req).Return(&shared.ListOpenWorkflowExecutionsResponse{}, nil).Times(1) + s.mockRemoteFrontendClient.EXPECT().ListOpenWorkflowExecutions(gomock.Any(), thrift.ToListOpenWorkflowExecutionsRequest(req)).Return(&types.ListOpenWorkflowExecutionsResponse{}, nil).Times(1) err = callFn(s.alternativeClusterName) s.Nil(err) } @@ -271,7 +273,7 @@ func (s *dcRedirectionHandlerSuite) TestListWorkflowExecutions() { s.mockFrontendHandler.EXPECT().ListWorkflowExecutions(gomock.Any(), req).Return(&shared.ListWorkflowExecutionsResponse{}, nil).Times(1) err = callFn(s.currentClusterName) s.Nil(err) - s.mockRemoteFrontendClient.EXPECT().ListWorkflowExecutions(gomock.Any(), req).Return(&shared.ListWorkflowExecutionsResponse{}, nil).Times(1) + s.mockRemoteFrontendClient.EXPECT().ListWorkflowExecutions(gomock.Any(), thrift.ToListWorkflowExecutionsRequest(req)).Return(&types.ListWorkflowExecutionsResponse{}, nil).Times(1) err = callFn(s.alternativeClusterName) s.Nil(err) } @@ -294,7 +296,7 @@ func (s *dcRedirectionHandlerSuite) TestScanWorkflowExecutions() { s.mockFrontendHandler.EXPECT().ScanWorkflowExecutions(gomock.Any(), req).Return(&shared.ListWorkflowExecutionsResponse{}, nil).Times(1) err = callFn(s.currentClusterName) s.Nil(err) - s.mockRemoteFrontendClient.EXPECT().ScanWorkflowExecutions(gomock.Any(), req).Return(&shared.ListWorkflowExecutionsResponse{}, nil).Times(1) + s.mockRemoteFrontendClient.EXPECT().ScanWorkflowExecutions(gomock.Any(), thrift.ToListWorkflowExecutionsRequest(req)).Return(&types.ListWorkflowExecutionsResponse{}, nil).Times(1) err = callFn(s.alternativeClusterName) s.Nil(err) } @@ -317,7 +319,7 @@ func (s *dcRedirectionHandlerSuite) TestCountWorkflowExecutions() { s.mockFrontendHandler.EXPECT().CountWorkflowExecutions(gomock.Any(), req).Return(&shared.CountWorkflowExecutionsResponse{}, nil).Times(1) err = callFn(s.currentClusterName) s.Nil(err) - s.mockRemoteFrontendClient.EXPECT().CountWorkflowExecutions(gomock.Any(), req).Return(&shared.CountWorkflowExecutionsResponse{}, nil).Times(1) + s.mockRemoteFrontendClient.EXPECT().CountWorkflowExecutions(gomock.Any(), thrift.ToCountWorkflowExecutionsRequest(req)).Return(&types.CountWorkflowExecutionsResponse{}, nil).Times(1) err = callFn(s.alternativeClusterName) s.Nil(err) } @@ -340,7 +342,7 @@ func (s *dcRedirectionHandlerSuite) TestPollForActivityTask() { s.mockFrontendHandler.EXPECT().PollForActivityTask(gomock.Any(), req).Return(&shared.PollForActivityTaskResponse{}, nil).Times(1) err = callFn(s.currentClusterName) s.Nil(err) - s.mockRemoteFrontendClient.EXPECT().PollForActivityTask(gomock.Any(), req).Return(&shared.PollForActivityTaskResponse{}, nil).Times(1) + s.mockRemoteFrontendClient.EXPECT().PollForActivityTask(gomock.Any(), thrift.ToPollForActivityTaskRequest(req)).Return(&types.PollForActivityTaskResponse{}, nil).Times(1) err = callFn(s.alternativeClusterName) s.Nil(err) } @@ -363,7 +365,7 @@ func (s *dcRedirectionHandlerSuite) TestPollForDecisionTask() { s.mockFrontendHandler.EXPECT().PollForDecisionTask(gomock.Any(), req).Return(&shared.PollForDecisionTaskResponse{}, nil).Times(1) err = callFn(s.currentClusterName) s.Nil(err) - s.mockRemoteFrontendClient.EXPECT().PollForDecisionTask(gomock.Any(), req).Return(&shared.PollForDecisionTaskResponse{}, nil).Times(1) + s.mockRemoteFrontendClient.EXPECT().PollForDecisionTask(gomock.Any(), thrift.ToPollForDecisionTaskRequest(req)).Return(&types.PollForDecisionTaskResponse{}, nil).Times(1) err = callFn(s.alternativeClusterName) s.Nil(err) } @@ -387,7 +389,7 @@ func (s *dcRedirectionHandlerSuite) TestQueryWorkflow() { s.mockFrontendHandler.EXPECT().QueryWorkflow(gomock.Any(), req).Return(&shared.QueryWorkflowResponse{}, nil).Times(1) err = callFn(s.currentClusterName) s.Nil(err) - s.mockRemoteFrontendClient.EXPECT().QueryWorkflow(gomock.Any(), req).Return(&shared.QueryWorkflowResponse{}, nil).Times(1) + s.mockRemoteFrontendClient.EXPECT().QueryWorkflow(gomock.Any(), thrift.ToQueryWorkflowRequest(req)).Return(&types.QueryWorkflowResponse{}, nil).Times(1) err = callFn(s.alternativeClusterName) s.Nil(err) } @@ -414,7 +416,7 @@ func (s *dcRedirectionHandlerSuite) TestRecordActivityTaskHeartbeat() { s.mockFrontendHandler.EXPECT().RecordActivityTaskHeartbeat(gomock.Any(), req).Return(&shared.RecordActivityTaskHeartbeatResponse{}, nil).Times(1) err = callFn(s.currentClusterName) s.Nil(err) - s.mockRemoteFrontendClient.EXPECT().RecordActivityTaskHeartbeat(gomock.Any(), req).Return(&shared.RecordActivityTaskHeartbeatResponse{}, nil).Times(1) + s.mockRemoteFrontendClient.EXPECT().RecordActivityTaskHeartbeat(gomock.Any(), thrift.ToRecordActivityTaskHeartbeatRequest(req)).Return(&types.RecordActivityTaskHeartbeatResponse{}, nil).Times(1) err = callFn(s.alternativeClusterName) s.Nil(err) } @@ -437,7 +439,7 @@ func (s *dcRedirectionHandlerSuite) TestRecordActivityTaskHeartbeatByID() { s.mockFrontendHandler.EXPECT().RecordActivityTaskHeartbeatByID(gomock.Any(), req).Return(&shared.RecordActivityTaskHeartbeatResponse{}, nil).Times(1) err = callFn(s.currentClusterName) s.Nil(err) - s.mockRemoteFrontendClient.EXPECT().RecordActivityTaskHeartbeatByID(gomock.Any(), req).Return(&shared.RecordActivityTaskHeartbeatResponse{}, nil).Times(1) + s.mockRemoteFrontendClient.EXPECT().RecordActivityTaskHeartbeatByID(gomock.Any(), thrift.ToRecordActivityTaskHeartbeatByIDRequest(req)).Return(&types.RecordActivityTaskHeartbeatResponse{}, nil).Times(1) err = callFn(s.alternativeClusterName) s.Nil(err) } @@ -458,7 +460,7 @@ func (s *dcRedirectionHandlerSuite) TestRequestCancelWorkflowExecution() { s.mockFrontendHandler.EXPECT().RequestCancelWorkflowExecution(gomock.Any(), req).Return(nil).Times(1) err = callFn(s.currentClusterName) s.Nil(err) - s.mockRemoteFrontendClient.EXPECT().RequestCancelWorkflowExecution(gomock.Any(), req).Return(nil).Times(1) + s.mockRemoteFrontendClient.EXPECT().RequestCancelWorkflowExecution(gomock.Any(), thrift.ToRequestCancelWorkflowExecutionRequest(req)).Return(nil).Times(1) err = callFn(s.alternativeClusterName) s.Nil(err) } @@ -481,7 +483,7 @@ func (s *dcRedirectionHandlerSuite) TestResetStickyTaskList() { s.mockFrontendHandler.EXPECT().ResetStickyTaskList(gomock.Any(), req).Return(&shared.ResetStickyTaskListResponse{}, nil).Times(1) err = callFn(s.currentClusterName) s.Nil(err) - s.mockRemoteFrontendClient.EXPECT().ResetStickyTaskList(gomock.Any(), req).Return(&shared.ResetStickyTaskListResponse{}, nil).Times(1) + s.mockRemoteFrontendClient.EXPECT().ResetStickyTaskList(gomock.Any(), thrift.ToResetStickyTaskListRequest(req)).Return(&types.ResetStickyTaskListResponse{}, nil).Times(1) err = callFn(s.alternativeClusterName) s.Nil(err) } @@ -504,7 +506,7 @@ func (s *dcRedirectionHandlerSuite) TestResetWorkflowExecution() { s.mockFrontendHandler.EXPECT().ResetWorkflowExecution(gomock.Any(), req).Return(&shared.ResetWorkflowExecutionResponse{}, nil).Times(1) err = callFn(s.currentClusterName) s.Nil(err) - s.mockRemoteFrontendClient.EXPECT().ResetWorkflowExecution(gomock.Any(), req).Return(&shared.ResetWorkflowExecutionResponse{}, nil).Times(1) + s.mockRemoteFrontendClient.EXPECT().ResetWorkflowExecution(gomock.Any(), thrift.ToResetWorkflowExecutionRequest(req)).Return(&types.ResetWorkflowExecutionResponse{}, nil).Times(1) err = callFn(s.alternativeClusterName) s.Nil(err) } @@ -529,7 +531,7 @@ func (s *dcRedirectionHandlerSuite) TestRespondActivityTaskCanceled() { s.mockFrontendHandler.EXPECT().RespondActivityTaskCanceled(gomock.Any(), req).Return(nil).Times(1) err = callFn(s.currentClusterName) s.Nil(err) - s.mockRemoteFrontendClient.EXPECT().RespondActivityTaskCanceled(gomock.Any(), req).Return(nil).Times(1) + s.mockRemoteFrontendClient.EXPECT().RespondActivityTaskCanceled(gomock.Any(), thrift.ToRespondActivityTaskCanceledRequest(req)).Return(nil).Times(1) err = callFn(s.alternativeClusterName) s.Nil(err) } @@ -550,7 +552,7 @@ func (s *dcRedirectionHandlerSuite) TestRespondActivityTaskCanceledByID() { s.mockFrontendHandler.EXPECT().RespondActivityTaskCanceledByID(gomock.Any(), req).Return(nil).Times(1) err = callFn(s.currentClusterName) s.Nil(err) - s.mockRemoteFrontendClient.EXPECT().RespondActivityTaskCanceledByID(gomock.Any(), req).Return(nil).Times(1) + s.mockRemoteFrontendClient.EXPECT().RespondActivityTaskCanceledByID(gomock.Any(), thrift.ToRespondActivityTaskCanceledByIDRequest(req)).Return(nil).Times(1) err = callFn(s.alternativeClusterName) s.Nil(err) } @@ -575,7 +577,7 @@ func (s *dcRedirectionHandlerSuite) TestRespondActivityTaskCompleted() { s.mockFrontendHandler.EXPECT().RespondActivityTaskCompleted(gomock.Any(), req).Return(nil).Times(1) err = callFn(s.currentClusterName) s.Nil(err) - s.mockRemoteFrontendClient.EXPECT().RespondActivityTaskCompleted(gomock.Any(), req).Return(nil).Times(1) + s.mockRemoteFrontendClient.EXPECT().RespondActivityTaskCompleted(gomock.Any(), thrift.ToRespondActivityTaskCompletedRequest(req)).Return(nil).Times(1) err = callFn(s.alternativeClusterName) s.Nil(err) } @@ -596,7 +598,7 @@ func (s *dcRedirectionHandlerSuite) TestRespondActivityTaskCompletedByID() { s.mockFrontendHandler.EXPECT().RespondActivityTaskCompletedByID(gomock.Any(), req).Return(nil).Times(1) err = callFn(s.currentClusterName) s.Nil(err) - s.mockRemoteFrontendClient.EXPECT().RespondActivityTaskCompletedByID(gomock.Any(), req).Return(nil).Times(1) + s.mockRemoteFrontendClient.EXPECT().RespondActivityTaskCompletedByID(gomock.Any(), thrift.ToRespondActivityTaskCompletedByIDRequest(req)).Return(nil).Times(1) err = callFn(s.alternativeClusterName) s.Nil(err) } @@ -621,7 +623,7 @@ func (s *dcRedirectionHandlerSuite) TestRespondActivityTaskFailed() { s.mockFrontendHandler.EXPECT().RespondActivityTaskFailed(gomock.Any(), req).Return(nil).Times(1) err = callFn(s.currentClusterName) s.Nil(err) - s.mockRemoteFrontendClient.EXPECT().RespondActivityTaskFailed(gomock.Any(), req).Return(nil).Times(1) + s.mockRemoteFrontendClient.EXPECT().RespondActivityTaskFailed(gomock.Any(), thrift.ToRespondActivityTaskFailedRequest(req)).Return(nil).Times(1) err = callFn(s.alternativeClusterName) s.Nil(err) } @@ -642,7 +644,7 @@ func (s *dcRedirectionHandlerSuite) TestRespondActivityTaskFailedByID() { s.mockFrontendHandler.EXPECT().RespondActivityTaskFailedByID(gomock.Any(), req).Return(nil).Times(1) err = callFn(s.currentClusterName) s.Nil(err) - s.mockRemoteFrontendClient.EXPECT().RespondActivityTaskFailedByID(gomock.Any(), req).Return(nil).Times(1) + s.mockRemoteFrontendClient.EXPECT().RespondActivityTaskFailedByID(gomock.Any(), thrift.ToRespondActivityTaskFailedByIDRequest(req)).Return(nil).Times(1) err = callFn(s.alternativeClusterName) s.Nil(err) } @@ -669,7 +671,7 @@ func (s *dcRedirectionHandlerSuite) TestRespondDecisionTaskCompleted() { s.mockFrontendHandler.EXPECT().RespondDecisionTaskCompleted(gomock.Any(), req).Return(&shared.RespondDecisionTaskCompletedResponse{}, nil).Times(1) err = callFn(s.currentClusterName) s.Nil(err) - s.mockRemoteFrontendClient.EXPECT().RespondDecisionTaskCompleted(gomock.Any(), req).Return(&shared.RespondDecisionTaskCompletedResponse{}, nil).Times(1) + s.mockRemoteFrontendClient.EXPECT().RespondDecisionTaskCompleted(gomock.Any(), thrift.ToRespondDecisionTaskCompletedRequest(req)).Return(&types.RespondDecisionTaskCompletedResponse{}, nil).Times(1) err = callFn(s.alternativeClusterName) s.Nil(err) } @@ -694,7 +696,7 @@ func (s *dcRedirectionHandlerSuite) TestRespondDecisionTaskFailed() { s.mockFrontendHandler.EXPECT().RespondDecisionTaskFailed(gomock.Any(), req).Return(nil).Times(1) err = callFn(s.currentClusterName) s.Nil(err) - s.mockRemoteFrontendClient.EXPECT().RespondDecisionTaskFailed(gomock.Any(), req).Return(nil).Times(1) + s.mockRemoteFrontendClient.EXPECT().RespondDecisionTaskFailed(gomock.Any(), thrift.ToRespondDecisionTaskFailedRequest(req)).Return(nil).Times(1) err = callFn(s.alternativeClusterName) s.Nil(err) } @@ -718,7 +720,7 @@ func (s *dcRedirectionHandlerSuite) TestRespondQueryTaskCompleted() { s.mockFrontendHandler.EXPECT().RespondQueryTaskCompleted(gomock.Any(), req).Return(nil).Times(1) err = callFn(s.currentClusterName) s.Nil(err) - s.mockRemoteFrontendClient.EXPECT().RespondQueryTaskCompleted(gomock.Any(), req).Return(nil).Times(1) + s.mockRemoteFrontendClient.EXPECT().RespondQueryTaskCompleted(gomock.Any(), thrift.ToRespondQueryTaskCompletedRequest(req)).Return(nil).Times(1) err = callFn(s.alternativeClusterName) s.Nil(err) } @@ -741,7 +743,7 @@ func (s *dcRedirectionHandlerSuite) TestSignalWithStartWorkflowExecution() { s.mockFrontendHandler.EXPECT().SignalWithStartWorkflowExecution(gomock.Any(), req).Return(&shared.StartWorkflowExecutionResponse{}, nil).Times(1) err = callFn(s.currentClusterName) s.Nil(err) - s.mockRemoteFrontendClient.EXPECT().SignalWithStartWorkflowExecution(gomock.Any(), req).Return(&shared.StartWorkflowExecutionResponse{}, nil).Times(1) + s.mockRemoteFrontendClient.EXPECT().SignalWithStartWorkflowExecution(gomock.Any(), thrift.ToSignalWithStartWorkflowExecutionRequest(req)).Return(&types.StartWorkflowExecutionResponse{}, nil).Times(1) err = callFn(s.alternativeClusterName) s.Nil(err) } @@ -762,7 +764,7 @@ func (s *dcRedirectionHandlerSuite) TestSignalWorkflowExecution() { s.mockFrontendHandler.EXPECT().SignalWorkflowExecution(gomock.Any(), req).Return(nil).Times(1) err = callFn(s.currentClusterName) s.Nil(err) - s.mockRemoteFrontendClient.EXPECT().SignalWorkflowExecution(gomock.Any(), req).Return(nil).Times(1) + s.mockRemoteFrontendClient.EXPECT().SignalWorkflowExecution(gomock.Any(), thrift.ToSignalWorkflowExecutionRequest(req)).Return(nil).Times(1) err = callFn(s.alternativeClusterName) s.Nil(err) } @@ -785,7 +787,7 @@ func (s *dcRedirectionHandlerSuite) TestStartWorkflowExecution() { s.mockFrontendHandler.EXPECT().StartWorkflowExecution(gomock.Any(), req).Return(&shared.StartWorkflowExecutionResponse{}, nil).Times(1) err = callFn(s.currentClusterName) s.Nil(err) - s.mockRemoteFrontendClient.EXPECT().StartWorkflowExecution(gomock.Any(), req).Return(&shared.StartWorkflowExecutionResponse{}, nil).Times(1) + s.mockRemoteFrontendClient.EXPECT().StartWorkflowExecution(gomock.Any(), thrift.ToStartWorkflowExecutionRequest(req)).Return(&types.StartWorkflowExecutionResponse{}, nil).Times(1) err = callFn(s.alternativeClusterName) s.Nil(err) } @@ -806,7 +808,7 @@ func (s *dcRedirectionHandlerSuite) TestTerminateWorkflowExecution() { s.mockFrontendHandler.EXPECT().TerminateWorkflowExecution(gomock.Any(), req).Return(nil).Times(1) err = callFn(s.currentClusterName) s.Nil(err) - s.mockRemoteFrontendClient.EXPECT().TerminateWorkflowExecution(gomock.Any(), req).Return(nil).Times(1) + s.mockRemoteFrontendClient.EXPECT().TerminateWorkflowExecution(gomock.Any(), thrift.ToTerminateWorkflowExecutionRequest(req)).Return(nil).Times(1) err = callFn(s.alternativeClusterName) s.Nil(err) } @@ -833,7 +835,7 @@ func (s *dcRedirectionHandlerSuite) TestListTaskListPartitions() { s.mockFrontendHandler.EXPECT().ListTaskListPartitions(gomock.Any(), req).Return(&shared.ListTaskListPartitionsResponse{}, nil).Times(1) err = callFn(s.currentClusterName) s.Nil(err) - s.mockRemoteFrontendClient.EXPECT().ListTaskListPartitions(gomock.Any(), req).Return(&shared.ListTaskListPartitionsResponse{}, nil).Times(1) + s.mockRemoteFrontendClient.EXPECT().ListTaskListPartitions(gomock.Any(), thrift.ToListTaskListPartitionsRequest(req)).Return(&types.ListTaskListPartitionsResponse{}, nil).Times(1) err = callFn(s.alternativeClusterName) s.Nil(err) } diff --git a/service/frontend/workflowHandler.go b/service/frontend/workflowHandler.go index 638741c7c46..dc091d873d0 100644 --- a/service/frontend/workflowHandler.go +++ b/service/frontend/workflowHandler.go @@ -3784,7 +3784,7 @@ func (wh *WorkflowHandler) checkOngoingFailover( ) error { clusterMetadata := wh.GetClusterMetadata() - respChan := make(chan *gen.DescribeDomainResponse, len(clusterMetadata.GetAllClusterInfo())) + respChan := make(chan *types.DescribeDomainResponse, len(clusterMetadata.GetAllClusterInfo())) wg := &sync.WaitGroup{} describeDomain := func( @@ -3795,7 +3795,7 @@ func (wh *WorkflowHandler) checkOngoingFailover( defer wg.Done() resp, _ := client.DescribeDomain( ctx, - &gen.DescribeDomainRequest{ + &types.DescribeDomainRequest{ Name: domainName, }, ) diff --git a/service/worker/batcher/workflow.go b/service/worker/batcher/workflow.go index 5991e20ab18..512ea514528 100644 --- a/service/worker/batcher/workflow.go +++ b/service/worker/batcher/workflow.go @@ -32,12 +32,12 @@ import ( "go.uber.org/yarpc" "golang.org/x/time/rate" - "github.com/uber/cadence/.gen/go/shared" "github.com/uber/cadence/client/frontend" "github.com/uber/cadence/common" "github.com/uber/cadence/common/log" "github.com/uber/cadence/common/log/tag" "github.com/uber/cadence/common/metrics" + "github.com/uber/cadence/common/types" ) const ( @@ -142,7 +142,7 @@ type ( } taskDetail struct { - execution shared.WorkflowExecution + execution types.WorkflowExecution attempts int // passing along the current heartbeat details to make heartbeat within a task so that it won't timeout hbd HeartBeatDetails @@ -248,7 +248,7 @@ func BatchActivity(ctx context.Context, batchParams BatchParams) (HeartBeatDetai } if startOver { - resp, err := client.CountWorkflowExecutions(ctx, &shared.CountWorkflowExecutionsRequest{ + resp, err := client.CountWorkflowExecutions(ctx, &types.CountWorkflowExecutionsRequest{ Domain: common.StringPtr(batchParams.DomainName), Query: common.StringPtr(batchParams.Query), }) @@ -268,7 +268,7 @@ func BatchActivity(ctx context.Context, batchParams BatchParams) (HeartBeatDetai // TODO https://github.com/uber/cadence/issues/2154 // Need to improve scan concurrency because it will hold an ES resource until the workflow finishes. // And we can't use list API because terminate / reset will mutate the result. - resp, err := client.ScanWorkflowExecutions(ctx, &shared.ListWorkflowExecutionsRequest{ + resp, err := client.ScanWorkflowExecutions(ctx, &types.ListWorkflowExecutionsRequest{ Domain: common.StringPtr(batchParams.DomainName), PageSize: common.Int32Ptr(int32(pageSize)), NextPageToken: hbd.PageToken, @@ -353,11 +353,11 @@ func startTaskProcessor( err = processTask(ctx, limiter, task, batchParams, client, batchParams.TerminateParams.TerminateChildren, func(workflowID, runID string) error { - return client.TerminateWorkflowExecution(ctx, &shared.TerminateWorkflowExecutionRequest{ + return client.TerminateWorkflowExecution(ctx, &types.TerminateWorkflowExecutionRequest{ Domain: common.StringPtr(batchParams.DomainName), - WorkflowExecution: &shared.WorkflowExecution{ - WorkflowId: common.StringPtr(workflowID), - RunId: common.StringPtr(runID), + WorkflowExecution: &types.WorkflowExecution{ + WorkflowID: common.StringPtr(workflowID), + RunID: common.StringPtr(runID), }, Reason: common.StringPtr(batchParams.Reason), Identity: common.StringPtr(BatchWFTypeName), @@ -367,27 +367,27 @@ func startTaskProcessor( err = processTask(ctx, limiter, task, batchParams, client, batchParams.CancelParams.CancelChildren, func(workflowID, runID string) error { - return client.RequestCancelWorkflowExecution(ctx, &shared.RequestCancelWorkflowExecutionRequest{ + return client.RequestCancelWorkflowExecution(ctx, &types.RequestCancelWorkflowExecutionRequest{ Domain: common.StringPtr(batchParams.DomainName), - WorkflowExecution: &shared.WorkflowExecution{ - WorkflowId: common.StringPtr(workflowID), - RunId: common.StringPtr(runID), + WorkflowExecution: &types.WorkflowExecution{ + WorkflowID: common.StringPtr(workflowID), + RunID: common.StringPtr(runID), }, Identity: common.StringPtr(BatchWFTypeName), - RequestId: common.StringPtr(requestID), + RequestID: common.StringPtr(requestID), }, yarpcCallOptions...) }) case BatchTypeSignal: err = processTask(ctx, limiter, task, batchParams, client, common.BoolPtr(false), func(workflowID, runID string) error { - return client.SignalWorkflowExecution(ctx, &shared.SignalWorkflowExecutionRequest{ + return client.SignalWorkflowExecution(ctx, &types.SignalWorkflowExecutionRequest{ Domain: common.StringPtr(batchParams.DomainName), - WorkflowExecution: &shared.WorkflowExecution{ - WorkflowId: common.StringPtr(workflowID), - RunId: common.StringPtr(runID), + WorkflowExecution: &types.WorkflowExecution{ + WorkflowID: common.StringPtr(workflowID), + RunID: common.StringPtr(runID), }, Identity: common.StringPtr(BatchWFTypeName), - RequestId: common.StringPtr(requestID), + RequestID: common.StringPtr(requestID), SignalName: common.StringPtr(batchParams.SignalParams.SignalName), Input: []byte(batchParams.SignalParams.Input), }, yarpcCallOptions...) @@ -422,7 +422,7 @@ func processTask( applyOnChild *bool, procFn func(string, string) error, ) error { - wfs := []shared.WorkflowExecution{task.execution} + wfs := []types.WorkflowExecution{task.execution} for len(wfs) > 0 { wf := wfs[0] wfs = wfs[1:] @@ -433,24 +433,24 @@ func processTask( } activity.RecordHeartbeat(ctx, task.hbd) - err = procFn(wf.GetWorkflowId(), wf.GetRunId()) + err = procFn(wf.GetWorkflowID(), wf.GetRunID()) if err != nil { // EntityNotExistsError means wf is not running or deleted - if _, ok := err.(*shared.EntityNotExistsError); ok { + if _, ok := err.(*types.EntityNotExistsError); ok { continue } return err } - resp, err := client.DescribeWorkflowExecution(ctx, &shared.DescribeWorkflowExecutionRequest{ + resp, err := client.DescribeWorkflowExecution(ctx, &types.DescribeWorkflowExecutionRequest{ Domain: common.StringPtr(batchParams.DomainName), - Execution: &shared.WorkflowExecution{ - WorkflowId: common.StringPtr(wf.GetWorkflowId()), - RunId: common.StringPtr(wf.GetRunId()), + Execution: &types.WorkflowExecution{ + WorkflowID: common.StringPtr(wf.GetWorkflowID()), + RunID: common.StringPtr(wf.GetRunID()), }, }) if err != nil { // EntityNotExistsError means wf is deleted - if _, ok := err.(*shared.EntityNotExistsError); ok { + if _, ok := err.(*types.EntityNotExistsError); ok { continue } return err @@ -461,9 +461,9 @@ func processTask( if applyOnChild != nil && *applyOnChild && len(resp.PendingChildren) > 0 { getActivityLogger(ctx).Info("Found more child workflows to process", tag.Number(int64(len(resp.PendingChildren)))) for _, ch := range resp.PendingChildren { - wfs = append(wfs, shared.WorkflowExecution{ - WorkflowId: ch.WorkflowID, - RunId: ch.RunID, + wfs = append(wfs, types.WorkflowExecution{ + WorkflowID: ch.WorkflowID, + RunID: ch.RunID, }) } } diff --git a/service/worker/failovermanager/workflow.go b/service/worker/failovermanager/workflow.go index a225aae75bb..9e839419a09 100644 --- a/service/worker/failovermanager/workflow.go +++ b/service/worker/failovermanager/workflow.go @@ -31,9 +31,9 @@ import ( "go.uber.org/cadence/activity" "go.uber.org/cadence/workflow" - "github.com/uber/cadence/.gen/go/shared" "github.com/uber/cadence/client/frontend" "github.com/uber/cadence/common" + "github.com/uber/cadence/common/types" ) const ( @@ -318,7 +318,7 @@ func validateTargetAndSourceCluster(targetCluster, sourceCluster string) error { return nil } -func shouldFailover(domain *shared.DescribeDomainResponse, sourceCluster string) bool { +func shouldFailover(domain *types.DescribeDomainResponse, sourceCluster string) bool { if !domain.GetIsGlobalDomain() { return false } @@ -327,7 +327,7 @@ func shouldFailover(domain *shared.DescribeDomainResponse, sourceCluster string) return isDomainTarget && isDomainFailoverManagedByCadence(domain) } -func isDomainFailoverManagedByCadence(domain *shared.DescribeDomainResponse) bool { +func isDomainFailoverManagedByCadence(domain *types.DescribeDomainResponse) bool { domainData := domain.DomainInfo.GetData() return strings.ToLower(strings.TrimSpace(domainData[common.DomainDataKeyForManagedFailover])) == "true" } @@ -338,9 +338,9 @@ func getClient(ctx context.Context) frontend.Client { return feClient } -func getAllDomains(ctx context.Context, targetDomains []string) ([]*shared.DescribeDomainResponse, error) { +func getAllDomains(ctx context.Context, targetDomains []string) ([]*types.DescribeDomainResponse, error) { feClient := getClient(ctx) - var res []*shared.DescribeDomainResponse + var res []*types.DescribeDomainResponse isTargetDomainsProvided := len(targetDomains) > 0 targetDomainsSet := make(map[string]struct{}) @@ -353,7 +353,7 @@ func getAllDomains(ctx context.Context, targetDomains []string) ([]*shared.Descr pagesize := int32(200) var token []byte for more := true; more; more = len(token) > 0 { - listRequest := &shared.ListDomainsRequest{ + listRequest := &types.ListDomainsRequest{ PageSize: common.Int32Ptr(pagesize), NextPageToken: token, } @@ -385,10 +385,10 @@ func FailoverActivity(ctx context.Context, params *FailoverActivityParams) (*Fai var successDomains []string var failedDomains []string for _, domain := range domains { - replicationConfig := &shared.DomainReplicationConfiguration{ + replicationConfig := &types.DomainReplicationConfiguration{ ActiveClusterName: common.StringPtr(params.TargetCluster), } - updateRequest := &shared.UpdateDomainRequest{ + updateRequest := &types.UpdateDomainRequest{ Name: common.StringPtr(domain), ReplicationConfiguration: replicationConfig, } diff --git a/service/worker/failovermanager/workflow_test.go b/service/worker/failovermanager/workflow_test.go index 7444ce2ddc3..93ff2e33990 100644 --- a/service/worker/failovermanager/workflow_test.go +++ b/service/worker/failovermanager/workflow_test.go @@ -29,10 +29,10 @@ import ( "github.com/golang/mock/gomock" "go.uber.org/cadence/worker" - "github.com/uber/cadence/.gen/go/shared" "github.com/uber/cadence/common" "github.com/uber/cadence/common/metrics" "github.com/uber/cadence/common/resource" + "github.com/uber/cadence/common/types" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" @@ -209,7 +209,7 @@ func (s *failoverWorkflowTestSuite) assertQueryState(env *testsuite.TestWorkflow s.Equal(expectedState, res.State) } -var clusters = []*shared.ClusterReplicationConfiguration{ +var clusters = []*types.ClusterReplicationConfiguration{ { ClusterName: common.StringPtr("c1"), }, @@ -221,21 +221,21 @@ var clusters = []*shared.ClusterReplicationConfiguration{ func (s *failoverWorkflowTestSuite) TestShouldFailover() { tests := []struct { - domain *shared.DescribeDomainResponse + domain *types.DescribeDomainResponse sourceCluster string expected bool }{ { - domain: &shared.DescribeDomainResponse{ + domain: &types.DescribeDomainResponse{ IsGlobalDomain: common.BoolPtr(false), }, sourceCluster: "c1", expected: false, }, { - domain: &shared.DescribeDomainResponse{ + domain: &types.DescribeDomainResponse{ IsGlobalDomain: common.BoolPtr(true), - ReplicationConfiguration: &shared.DomainReplicationConfiguration{ + ReplicationConfiguration: &types.DomainReplicationConfiguration{ ActiveClusterName: common.StringPtr("c1"), Clusters: clusters, }, @@ -244,9 +244,9 @@ func (s *failoverWorkflowTestSuite) TestShouldFailover() { expected: false, }, { - domain: &shared.DescribeDomainResponse{ + domain: &types.DescribeDomainResponse{ IsGlobalDomain: common.BoolPtr(true), - ReplicationConfiguration: &shared.DomainReplicationConfiguration{ + ReplicationConfiguration: &types.DomainReplicationConfiguration{ ActiveClusterName: common.StringPtr("c2"), Clusters: clusters, }, @@ -255,13 +255,13 @@ func (s *failoverWorkflowTestSuite) TestShouldFailover() { expected: false, }, { - domain: &shared.DescribeDomainResponse{ + domain: &types.DescribeDomainResponse{ IsGlobalDomain: common.BoolPtr(true), - ReplicationConfiguration: &shared.DomainReplicationConfiguration{ + ReplicationConfiguration: &types.DomainReplicationConfiguration{ ActiveClusterName: common.StringPtr("c2"), Clusters: clusters, }, - DomainInfo: &shared.DomainInfo{ + DomainInfo: &types.DomainInfo{ Data: map[string]string{ common.DomainDataKeyForManagedFailover: "true", }, @@ -296,14 +296,14 @@ func (s *failoverWorkflowTestSuite) TestGetDomainsActivity() { defer controller.Finish() defer mockResource.Finish(s.T()) - domains := &shared.ListDomainsResponse{ - Domains: []*shared.DescribeDomainResponse{ + domains := &types.ListDomainsResponse{ + Domains: []*types.DescribeDomainResponse{ { - DomainInfo: &shared.DomainInfo{ + DomainInfo: &types.DomainInfo{ Name: common.StringPtr("d1"), Data: map[string]string{common.DomainDataKeyForManagedFailover: "true"}, }, - ReplicationConfiguration: &shared.DomainReplicationConfiguration{ + ReplicationConfiguration: &types.DomainReplicationConfiguration{ ActiveClusterName: common.StringPtr("c1"), Clusters: clusters, }, @@ -329,35 +329,35 @@ func (s *failoverWorkflowTestSuite) TestGetDomainsActivity_WithTargetDomains() { defer controller.Finish() defer mockResource.Finish(s.T()) - domains := &shared.ListDomainsResponse{ - Domains: []*shared.DescribeDomainResponse{ + domains := &types.ListDomainsResponse{ + Domains: []*types.DescribeDomainResponse{ { - DomainInfo: &shared.DomainInfo{ + DomainInfo: &types.DomainInfo{ Name: common.StringPtr("d1"), Data: map[string]string{common.DomainDataKeyForManagedFailover: "true"}, }, - ReplicationConfiguration: &shared.DomainReplicationConfiguration{ + ReplicationConfiguration: &types.DomainReplicationConfiguration{ ActiveClusterName: common.StringPtr("c1"), Clusters: clusters, }, IsGlobalDomain: common.BoolPtr(true), }, { - DomainInfo: &shared.DomainInfo{ + DomainInfo: &types.DomainInfo{ Name: common.StringPtr("d2"), Data: map[string]string{common.DomainDataKeyForManagedFailover: "true"}, }, - ReplicationConfiguration: &shared.DomainReplicationConfiguration{ + ReplicationConfiguration: &types.DomainReplicationConfiguration{ ActiveClusterName: common.StringPtr("c1"), Clusters: clusters, }, IsGlobalDomain: common.BoolPtr(true), }, { - DomainInfo: &shared.DomainInfo{ + DomainInfo: &types.DomainInfo{ Name: common.StringPtr("d3"), }, - ReplicationConfiguration: &shared.DomainReplicationConfiguration{ + ReplicationConfiguration: &types.DomainReplicationConfiguration{ ActiveClusterName: common.StringPtr("c1"), Clusters: clusters, }, @@ -406,14 +406,14 @@ func (s *failoverWorkflowTestSuite) TestFailoverActivity_Error() { domains := []string{"d1", "d2"} targetCluster := "c2" - replicationConfig := &shared.DomainReplicationConfiguration{ + replicationConfig := &types.DomainReplicationConfiguration{ ActiveClusterName: common.StringPtr(targetCluster), } - updateRequest1 := &shared.UpdateDomainRequest{ + updateRequest1 := &types.UpdateDomainRequest{ Name: common.StringPtr("d1"), ReplicationConfiguration: replicationConfig, } - updateRequest2 := &shared.UpdateDomainRequest{ + updateRequest2 := &types.UpdateDomainRequest{ Name: common.StringPtr("d2"), ReplicationConfiguration: replicationConfig, }