• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

uber / cadence / 0187fdd2-f4a4-4c9a-97b4-6604937bf7be

09 May 2023 12:23AM UTC coverage: 57.253% (-0.002%) from 57.255%
0187fdd2-f4a4-4c9a-97b4-6604937bf7be

Pull #5252

buildkite

David Porter
Merge branch 'master' into feature/zonal-partitioning
Pull Request #5252: Feature/zonal partitioning

1460 of 1460 new or added lines in 51 files covered. (100.0%)

86909 of 151799 relevant lines covered (57.25%)

2482.17 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

5.38
/client/admin/thriftClient.go
1
// Copyright (c) 2020 Uber Technologies, Inc.
2
//
3
// Permission is hereby granted, free of charge, to any person obtaining a copy
4
// of this software and associated documentation files (the "Software"), to deal
5
// in the Software without restriction, including without limitation the rights
6
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
// copies of the Software, and to permit persons to whom the Software is
8
// furnished to do so, subject to the following conditions:
9
//
10
// The above copyright notice and this permission notice shall be included in
11
// all copies or substantial portions of the Software.
12
//
13
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
// THE SOFTWARE.
20

21
package admin
22

23
import (
24
        "context"
25

26
        "go.uber.org/yarpc"
27

28
        "github.com/uber/cadence/.gen/go/admin/adminserviceclient"
29
        "github.com/uber/cadence/common/types"
30
        "github.com/uber/cadence/common/types/mapper/thrift"
31
)
32

33
type thriftClient struct {
34
        c adminserviceclient.Interface
35
}
36

37
// NewThriftClient creates a new instance of Client with thrift protocol
38
func NewThriftClient(c adminserviceclient.Interface) Client {
15✔
39
        return thriftClient{c}
15✔
40
}
15✔
41

42
func (t thriftClient) AddSearchAttribute(ctx context.Context, request *types.AddSearchAttributeRequest, opts ...yarpc.CallOption) error {
×
43
        err := t.c.AddSearchAttribute(ctx, thrift.FromAddSearchAttributeRequest(request), opts...)
×
44
        return thrift.ToError(err)
×
45
}
×
46

47
func (t thriftClient) CloseShard(ctx context.Context, request *types.CloseShardRequest, opts ...yarpc.CallOption) error {
×
48
        err := t.c.CloseShard(ctx, thrift.FromCloseShardRequest(request), opts...)
×
49
        return thrift.ToError(err)
×
50
}
×
51

52
func (t thriftClient) DescribeCluster(ctx context.Context, opts ...yarpc.CallOption) (*types.DescribeClusterResponse, error) {
×
53
        response, err := t.c.DescribeCluster(ctx, opts...)
×
54
        return thrift.ToDescribeClusterResponse(response), thrift.ToError(err)
×
55
}
×
56

57
func (t thriftClient) DescribeShardDistribution(ctx context.Context, request *types.DescribeShardDistributionRequest, opts ...yarpc.CallOption) (*types.DescribeShardDistributionResponse, error) {
×
58
        response, err := t.c.DescribeShardDistribution(ctx, thrift.FromDescribeShardDistributionRequest(request), opts...)
×
59
        return thrift.ToDescribeShardDistributionResponse(response), thrift.ToError(err)
×
60
}
×
61

62
func (t thriftClient) DescribeHistoryHost(ctx context.Context, request *types.DescribeHistoryHostRequest, opts ...yarpc.CallOption) (*types.DescribeHistoryHostResponse, error) {
×
63
        response, err := t.c.DescribeHistoryHost(ctx, thrift.FromDescribeHistoryHostRequest(request), opts...)
×
64
        return thrift.ToDescribeHistoryHostResponse(response), thrift.ToError(err)
×
65
}
×
66

67
func (t thriftClient) DescribeQueue(ctx context.Context, request *types.DescribeQueueRequest, opts ...yarpc.CallOption) (*types.DescribeQueueResponse, error) {
×
68
        response, err := t.c.DescribeQueue(ctx, thrift.FromDescribeQueueRequest(request), opts...)
×
69
        return thrift.ToDescribeQueueResponse(response), thrift.ToError(err)
×
70
}
×
71

72
func (t thriftClient) DescribeWorkflowExecution(ctx context.Context, request *types.AdminDescribeWorkflowExecutionRequest, opts ...yarpc.CallOption) (*types.AdminDescribeWorkflowExecutionResponse, error) {
×
73
        response, err := t.c.DescribeWorkflowExecution(ctx, thrift.FromAdminDescribeWorkflowExecutionRequest(request), opts...)
×
74
        return thrift.ToAdminDescribeWorkflowExecutionResponse(response), thrift.ToError(err)
×
75
}
×
76

77
func (t thriftClient) GetDLQReplicationMessages(ctx context.Context, request *types.GetDLQReplicationMessagesRequest, opts ...yarpc.CallOption) (*types.GetDLQReplicationMessagesResponse, error) {
×
78
        response, err := t.c.GetDLQReplicationMessages(ctx, thrift.FromGetDLQReplicationMessagesRequest(request), opts...)
×
79
        return thrift.ToGetDLQReplicationMessagesResponse(response), thrift.ToError(err)
×
80
}
×
81

82
func (t thriftClient) GetDomainReplicationMessages(ctx context.Context, request *types.GetDomainReplicationMessagesRequest, opts ...yarpc.CallOption) (*types.GetDomainReplicationMessagesResponse, error) {
×
83
        response, err := t.c.GetDomainReplicationMessages(ctx, thrift.FromGetDomainReplicationMessagesRequest(request), opts...)
×
84
        return thrift.ToGetDomainReplicationMessagesResponse(response), thrift.ToError(err)
×
85
}
×
86

87
func (t thriftClient) GetReplicationMessages(ctx context.Context, request *types.GetReplicationMessagesRequest, opts ...yarpc.CallOption) (*types.GetReplicationMessagesResponse, error) {
×
88
        response, err := t.c.GetReplicationMessages(ctx, thrift.FromGetReplicationMessagesRequest(request), opts...)
×
89
        return thrift.ToGetReplicationMessagesResponse(response), thrift.ToError(err)
×
90
}
×
91

92
func (t thriftClient) GetWorkflowExecutionRawHistoryV2(ctx context.Context, request *types.GetWorkflowExecutionRawHistoryV2Request, opts ...yarpc.CallOption) (*types.GetWorkflowExecutionRawHistoryV2Response, error) {
3✔
93
        response, err := t.c.GetWorkflowExecutionRawHistoryV2(ctx, thrift.FromGetWorkflowExecutionRawHistoryV2Request(request), opts...)
3✔
94
        return thrift.ToGetWorkflowExecutionRawHistoryV2Response(response), thrift.ToError(err)
3✔
95
}
3✔
96

97
func (t thriftClient) MergeDLQMessages(ctx context.Context, request *types.MergeDLQMessagesRequest, opts ...yarpc.CallOption) (*types.MergeDLQMessagesResponse, error) {
×
98
        response, err := t.c.MergeDLQMessages(ctx, thrift.FromMergeDLQMessagesRequest(request), opts...)
×
99
        return thrift.ToMergeDLQMessagesResponse(response), thrift.ToError(err)
×
100
}
×
101

102
func (t thriftClient) PurgeDLQMessages(ctx context.Context, request *types.PurgeDLQMessagesRequest, opts ...yarpc.CallOption) error {
×
103
        err := t.c.PurgeDLQMessages(ctx, thrift.FromPurgeDLQMessagesRequest(request), opts...)
×
104
        return thrift.ToError(err)
×
105
}
×
106

107
func (t thriftClient) CountDLQMessages(ctx context.Context, request *types.CountDLQMessagesRequest, opts ...yarpc.CallOption) (*types.CountDLQMessagesResponse, error) {
×
108
        return nil, thrift.ToError(&types.BadRequestError{Message: "Feature not supported on TChannel"})
×
109
}
×
110

111
func (t thriftClient) ReadDLQMessages(ctx context.Context, request *types.ReadDLQMessagesRequest, opts ...yarpc.CallOption) (*types.ReadDLQMessagesResponse, error) {
×
112
        response, err := t.c.ReadDLQMessages(ctx, thrift.FromReadDLQMessagesRequest(request), opts...)
×
113
        return thrift.ToReadDLQMessagesResponse(response), thrift.ToError(err)
×
114
}
×
115

116
func (t thriftClient) ReapplyEvents(ctx context.Context, request *types.ReapplyEventsRequest, opts ...yarpc.CallOption) error {
×
117
        err := t.c.ReapplyEvents(ctx, thrift.FromReapplyEventsRequest(request), opts...)
×
118
        return thrift.ToError(err)
×
119
}
×
120

121
func (t thriftClient) RefreshWorkflowTasks(ctx context.Context, request *types.RefreshWorkflowTasksRequest, opts ...yarpc.CallOption) error {
×
122
        err := t.c.RefreshWorkflowTasks(ctx, thrift.FromRefreshWorkflowTasksRequest(request), opts...)
×
123
        return thrift.ToError(err)
×
124
}
×
125

126
func (t thriftClient) RemoveTask(ctx context.Context, request *types.RemoveTaskRequest, opts ...yarpc.CallOption) error {
×
127
        err := t.c.RemoveTask(ctx, thrift.FromRemoveTaskRequest(request), opts...)
×
128
        return thrift.ToError(err)
×
129
}
×
130

131
func (t thriftClient) ResendReplicationTasks(ctx context.Context, request *types.ResendReplicationTasksRequest, opts ...yarpc.CallOption) error {
×
132
        err := t.c.ResendReplicationTasks(ctx, thrift.FromResendReplicationTasksRequest(request), opts...)
×
133
        return thrift.ToError(err)
×
134
}
×
135

136
func (t thriftClient) ResetQueue(ctx context.Context, request *types.ResetQueueRequest, opts ...yarpc.CallOption) error {
×
137
        err := t.c.ResetQueue(ctx, thrift.FromResetQueueRequest(request), opts...)
×
138
        return thrift.ToError(err)
×
139
}
×
140

141
func (t thriftClient) GetCrossClusterTasks(ctx context.Context, request *types.GetCrossClusterTasksRequest, opts ...yarpc.CallOption) (*types.GetCrossClusterTasksResponse, error) {
×
142
        response, err := t.c.GetCrossClusterTasks(ctx, thrift.FromGetCrossClusterTasksRequest(request), opts...)
×
143
        return thrift.ToGetCrossClusterTasksResponse(response), thrift.ToError(err)
×
144
}
×
145

146
func (t thriftClient) RespondCrossClusterTasksCompleted(ctx context.Context, request *types.RespondCrossClusterTasksCompletedRequest, opts ...yarpc.CallOption) (*types.RespondCrossClusterTasksCompletedResponse, error) {
×
147
        response, err := t.c.RespondCrossClusterTasksCompleted(ctx, thrift.FromRespondCrossClusterTasksCompletedRequest(request), opts...)
×
148
        return thrift.ToRespondCrossClusterTasksCompletedResponse(response), thrift.ToError(err)
×
149
}
×
150

151
func (t thriftClient) GetDynamicConfig(ctx context.Context, request *types.GetDynamicConfigRequest, opts ...yarpc.CallOption) (*types.GetDynamicConfigResponse, error) {
×
152
        response, err := t.c.GetDynamicConfig(ctx, thrift.FromGetDynamicConfigRequest(request), opts...)
×
153
        return thrift.ToGetDynamicConfigResponse(response), thrift.ToError(err)
×
154
}
×
155

156
func (t thriftClient) UpdateDynamicConfig(ctx context.Context, request *types.UpdateDynamicConfigRequest, opts ...yarpc.CallOption) error {
×
157
        err := t.c.UpdateDynamicConfig(ctx, thrift.FromUpdateDynamicConfigRequest(request), opts...)
×
158
        return thrift.ToError(err)
×
159
}
×
160

161
func (t thriftClient) RestoreDynamicConfig(ctx context.Context, request *types.RestoreDynamicConfigRequest, opts ...yarpc.CallOption) error {
×
162
        err := t.c.RestoreDynamicConfig(ctx, thrift.FromRestoreDynamicConfigRequest(request), opts...)
×
163
        return thrift.ToError(err)
×
164
}
×
165

166
func (t thriftClient) DeleteWorkflow(ctx context.Context, request *types.AdminDeleteWorkflowRequest, opts ...yarpc.CallOption) (*types.AdminDeleteWorkflowResponse, error) {
×
167
        response, err := t.c.DeleteWorkflow(ctx, thrift.FromAdminDeleteWorkflowRequest(request), opts...)
×
168
        return thrift.ToAdminDeleteWorkflowResponse(response), thrift.ToError(err)
×
169
}
×
170

171
func (t thriftClient) MaintainCorruptWorkflow(ctx context.Context, request *types.AdminMaintainWorkflowRequest, opts ...yarpc.CallOption) (*types.AdminMaintainWorkflowResponse, error) {
×
172
        response, err := t.c.MaintainCorruptWorkflow(ctx, thrift.FromAdminMaintainWorkflowRequest(request), opts...)
×
173
        return thrift.ToAdminMaintainWorkflowResponse(response), thrift.ToError(err)
×
174
}
×
175

176
func (t thriftClient) ListDynamicConfig(ctx context.Context, request *types.ListDynamicConfigRequest, opts ...yarpc.CallOption) (*types.ListDynamicConfigResponse, error) {
×
177
        response, err := t.c.ListDynamicConfig(ctx, thrift.FromListDynamicConfigRequest(request), opts...)
×
178
        return thrift.ToListDynamicConfigResponse(response), thrift.ToError(err)
×
179
}
×
180

181
func (t thriftClient) GetGlobalIsolationGroups(ctx context.Context, request *types.GetGlobalIsolationGroupsRequest, opts ...yarpc.CallOption) (*types.GetGlobalIsolationGroupsResponse, error) {
×
182
        res, err := t.c.GetGlobalIsolationGroups(ctx, thrift.FromGetGlobalIsolationGroupsRequest(request), opts...)
×
183
        return thrift.ToGetGlobalIsolationGroupsResponse(res), thrift.ToError(err)
×
184
}
×
185

186
func (t thriftClient) UpdateGlobalIsolationGroups(ctx context.Context, request *types.UpdateGlobalIsolationGroupsRequest, opts ...yarpc.CallOption) (*types.UpdateGlobalIsolationGroupsResponse, error) {
×
187
        res, err := t.c.UpdateGlobalIsolationGroups(ctx, thrift.FromUpdateGlobalIsolationGroupsRequest(request), opts...)
×
188
        return thrift.ToUpdateGlobalIsolationGroupsResponse(res), thrift.ToError(err)
×
189
}
×
190

191
func (t thriftClient) GetDomainIsolationGroups(ctx context.Context, request *types.GetDomainIsolationGroupsRequest, opts ...yarpc.CallOption) (*types.GetDomainIsolationGroupsResponse, error) {
×
192
        res, err := t.c.GetDomainIsolationGroups(ctx, thrift.FromGetDomainIsolationGroupsRequest(request), opts...)
×
193
        return thrift.ToGetDomainIsolationGroupsResponse(res), thrift.ToError(err)
×
194
}
×
195

196
func (t thriftClient) UpdateDomainIsolationGroups(ctx context.Context, request *types.UpdateDomainIsolationGroupsRequest, opts ...yarpc.CallOption) (*types.UpdateDomainIsolationGroupsResponse, error) {
×
197
        res, err := t.c.UpdateDomainIsolationGroups(ctx, thrift.FromUpdateDomainIsolationGroupsRequest(request), opts...)
×
198
        return thrift.ToUpdateDomainIsolationGroupsResponse(res), thrift.ToError(err)
×
199
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc