• 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

63.08
/service/frontend/adminThriftHandler.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 frontend
22

23
import (
24
        "context"
25

26
        "go.uber.org/yarpc"
27

28
        "github.com/uber/cadence/.gen/go/admin"
29
        "github.com/uber/cadence/.gen/go/admin/adminserviceserver"
30
        "github.com/uber/cadence/.gen/go/replicator"
31
        "github.com/uber/cadence/.gen/go/shared"
32
        "github.com/uber/cadence/common/types/mapper/thrift"
33
)
34

35
// AdminThriftHandler wrap underlying handler and handles Thrift related type conversions
36
type AdminThriftHandler struct {
37
        h AdminHandler
38
}
39

40
// NewAdminThriftHandler creates Thrift handler on top of underlying handler
41
func NewAdminThriftHandler(h AdminHandler) AdminThriftHandler {
16✔
42
        return AdminThriftHandler{h}
16✔
43
}
16✔
44

45
func (t AdminThriftHandler) register(dispatcher *yarpc.Dispatcher) {
15✔
46
        dispatcher.Register(adminserviceserver.New(t))
15✔
47
}
15✔
48

49
// AddSearchAttribute forwards request to the underlying handler
50
func (t AdminThriftHandler) AddSearchAttribute(ctx context.Context, request *admin.AddSearchAttributeRequest) error {
1✔
51
        err := t.h.AddSearchAttribute(ctx, thrift.ToAddSearchAttributeRequest(request))
1✔
52
        return thrift.FromError(err)
1✔
53
}
1✔
54

55
// CloseShard forwards request to the underlying handler
56
func (t AdminThriftHandler) CloseShard(ctx context.Context, request *shared.CloseShardRequest) error {
1✔
57
        err := t.h.CloseShard(ctx, thrift.ToCloseShardRequest(request))
1✔
58
        return thrift.FromError(err)
1✔
59
}
1✔
60

61
// DescribeCluster forwards request to the underlying handler
62
func (t AdminThriftHandler) DescribeCluster(ctx context.Context) (*admin.DescribeClusterResponse, error) {
1✔
63
        response, err := t.h.DescribeCluster(ctx)
1✔
64
        return thrift.FromDescribeClusterResponse(response), thrift.FromError(err)
1✔
65
}
1✔
66

67
// DescribeShardDistribution forwards request to the underlying handler
68
func (t AdminThriftHandler) DescribeShardDistribution(ctx context.Context, request *shared.DescribeShardDistributionRequest) (*shared.DescribeShardDistributionResponse, error) {
×
69
        response, err := t.h.DescribeShardDistribution(ctx, thrift.ToDescribeShardDistributionRequest(request))
×
70
        return thrift.FromDescribeShardDistributionResponse(response), thrift.FromError(err)
×
71
}
×
72

73
// DescribeHistoryHost forwards request to the underlying handler
74
func (t AdminThriftHandler) DescribeHistoryHost(ctx context.Context, request *shared.DescribeHistoryHostRequest) (*shared.DescribeHistoryHostResponse, error) {
1✔
75
        response, err := t.h.DescribeHistoryHost(ctx, thrift.ToDescribeHistoryHostRequest(request))
1✔
76
        return thrift.FromDescribeHistoryHostResponse(response), thrift.FromError(err)
1✔
77
}
1✔
78

79
// DescribeQueue forwards request to the underlying handler
80
func (t AdminThriftHandler) DescribeQueue(ctx context.Context, request *shared.DescribeQueueRequest) (*shared.DescribeQueueResponse, error) {
1✔
81
        response, err := t.h.DescribeQueue(ctx, thrift.ToDescribeQueueRequest(request))
1✔
82
        return thrift.FromDescribeQueueResponse(response), thrift.FromError(err)
1✔
83
}
1✔
84

85
// DescribeWorkflowExecution forwards request to the underlying handler
86
func (t AdminThriftHandler) DescribeWorkflowExecution(ctx context.Context, request *admin.DescribeWorkflowExecutionRequest) (*admin.DescribeWorkflowExecutionResponse, error) {
1✔
87
        response, err := t.h.DescribeWorkflowExecution(ctx, thrift.ToAdminDescribeWorkflowExecutionRequest(request))
1✔
88
        return thrift.FromAdminDescribeWorkflowExecutionResponse(response), thrift.FromError(err)
1✔
89
}
1✔
90

91
// GetDLQReplicationMessages forwards request to the underlying handler
92
func (t AdminThriftHandler) GetDLQReplicationMessages(ctx context.Context, request *replicator.GetDLQReplicationMessagesRequest) (*replicator.GetDLQReplicationMessagesResponse, error) {
1✔
93
        response, err := t.h.GetDLQReplicationMessages(ctx, thrift.ToGetDLQReplicationMessagesRequest(request))
1✔
94
        return thrift.FromGetDLQReplicationMessagesResponse(response), thrift.FromError(err)
1✔
95
}
1✔
96

97
// GetDomainReplicationMessages forwards request to the underlying handler
98
func (t AdminThriftHandler) GetDomainReplicationMessages(ctx context.Context, request *replicator.GetDomainReplicationMessagesRequest) (*replicator.GetDomainReplicationMessagesResponse, error) {
1✔
99
        response, err := t.h.GetDomainReplicationMessages(ctx, thrift.ToGetDomainReplicationMessagesRequest(request))
1✔
100
        return thrift.FromGetDomainReplicationMessagesResponse(response), thrift.FromError(err)
1✔
101
}
1✔
102

103
// GetReplicationMessages forwards request to the underlying handler
104
func (t AdminThriftHandler) GetReplicationMessages(ctx context.Context, request *replicator.GetReplicationMessagesRequest) (*replicator.GetReplicationMessagesResponse, error) {
1✔
105
        response, err := t.h.GetReplicationMessages(ctx, thrift.ToGetReplicationMessagesRequest(request))
1✔
106
        return thrift.FromGetReplicationMessagesResponse(response), thrift.FromError(err)
1✔
107
}
1✔
108

109
// GetWorkflowExecutionRawHistoryV2 forwards request to the underlying handler
110
func (t AdminThriftHandler) GetWorkflowExecutionRawHistoryV2(ctx context.Context, request *admin.GetWorkflowExecutionRawHistoryV2Request) (*admin.GetWorkflowExecutionRawHistoryV2Response, error) {
4✔
111
        response, err := t.h.GetWorkflowExecutionRawHistoryV2(ctx, thrift.ToGetWorkflowExecutionRawHistoryV2Request(request))
4✔
112
        return thrift.FromGetWorkflowExecutionRawHistoryV2Response(response), thrift.FromError(err)
4✔
113
}
4✔
114

115
// MergeDLQMessages forwards request to the underlying handler
116
func (t AdminThriftHandler) MergeDLQMessages(ctx context.Context, request *replicator.MergeDLQMessagesRequest) (*replicator.MergeDLQMessagesResponse, error) {
1✔
117
        response, err := t.h.MergeDLQMessages(ctx, thrift.ToMergeDLQMessagesRequest(request))
1✔
118
        return thrift.FromMergeDLQMessagesResponse(response), thrift.FromError(err)
1✔
119
}
1✔
120

121
// PurgeDLQMessages forwards request to the underlying handler
122
func (t AdminThriftHandler) PurgeDLQMessages(ctx context.Context, request *replicator.PurgeDLQMessagesRequest) error {
1✔
123
        err := t.h.PurgeDLQMessages(ctx, thrift.ToPurgeDLQMessagesRequest(request))
1✔
124
        return thrift.FromError(err)
1✔
125
}
1✔
126

127
// ReadDLQMessages forwards request to the underlying handler
128
func (t AdminThriftHandler) ReadDLQMessages(ctx context.Context, request *replicator.ReadDLQMessagesRequest) (*replicator.ReadDLQMessagesResponse, error) {
1✔
129
        response, err := t.h.ReadDLQMessages(ctx, thrift.ToReadDLQMessagesRequest(request))
1✔
130
        return thrift.FromReadDLQMessagesResponse(response), thrift.FromError(err)
1✔
131
}
1✔
132

133
// ReapplyEvents forwards request to the underlying handler
134
func (t AdminThriftHandler) ReapplyEvents(ctx context.Context, request *shared.ReapplyEventsRequest) error {
1✔
135
        err := t.h.ReapplyEvents(ctx, thrift.ToReapplyEventsRequest(request))
1✔
136
        return thrift.FromError(err)
1✔
137
}
1✔
138

139
// RefreshWorkflowTasks forwards request to the underlying handler
140
func (t AdminThriftHandler) RefreshWorkflowTasks(ctx context.Context, request *shared.RefreshWorkflowTasksRequest) error {
1✔
141
        err := t.h.RefreshWorkflowTasks(ctx, thrift.ToRefreshWorkflowTasksRequest(request))
1✔
142
        return thrift.FromError(err)
1✔
143
}
1✔
144

145
// RemoveTask forwards request to the underlying handler
146
func (t AdminThriftHandler) RemoveTask(ctx context.Context, request *shared.RemoveTaskRequest) error {
1✔
147
        err := t.h.RemoveTask(ctx, thrift.ToRemoveTaskRequest(request))
1✔
148
        return thrift.FromError(err)
1✔
149
}
1✔
150

151
// ResendReplicationTasks forwards request to the underlying handler
152
func (t AdminThriftHandler) ResendReplicationTasks(ctx context.Context, request *admin.ResendReplicationTasksRequest) error {
1✔
153
        err := t.h.ResendReplicationTasks(ctx, thrift.ToResendReplicationTasksRequest(request))
1✔
154
        return thrift.FromError(err)
1✔
155
}
1✔
156

157
// ResetQueue forwards request to the underlying handler
158
func (t AdminThriftHandler) ResetQueue(ctx context.Context, request *shared.ResetQueueRequest) error {
1✔
159
        err := t.h.ResetQueue(ctx, thrift.ToResetQueueRequest(request))
1✔
160
        return thrift.FromError(err)
1✔
161
}
1✔
162

163
// GetCrossClusterTasks fetches cross cluster tasks
164
func (t AdminThriftHandler) GetCrossClusterTasks(ctx context.Context, request *shared.GetCrossClusterTasksRequest) (*shared.GetCrossClusterTasksResponse, error) {
1✔
165
        response, err := t.h.GetCrossClusterTasks(ctx, thrift.ToGetCrossClusterTasksRequest(request))
1✔
166
        return thrift.FromGetCrossClusterTasksResponse(response), thrift.FromError(err)
1✔
167
}
1✔
168

169
// RespondCrossClusterTasksCompleted responds the result of processing cross cluster tasks
170
func (t AdminThriftHandler) RespondCrossClusterTasksCompleted(ctx context.Context, request *shared.RespondCrossClusterTasksCompletedRequest) (*shared.RespondCrossClusterTasksCompletedResponse, error) {
×
171
        response, err := t.h.RespondCrossClusterTasksCompleted(ctx, thrift.ToRespondCrossClusterTasksCompletedRequest(request))
×
172
        return thrift.FromRespondCrossClusterTasksCompletedResponse(response), thrift.FromError(err)
×
173
}
×
174

175
// GetDynamicConfig fetches dynamic config value
176
func (t AdminThriftHandler) GetDynamicConfig(ctx context.Context, request *admin.GetDynamicConfigRequest) (*admin.GetDynamicConfigResponse, error) {
×
177
        response, err := t.h.GetDynamicConfig(ctx, thrift.ToGetDynamicConfigRequest(request))
×
178
        return thrift.FromGetDynamicConfigResponse(response), thrift.FromError(err)
×
179
}
×
180

181
// UpdateDynamicConfig updates dynamic config value
182
func (t AdminThriftHandler) UpdateDynamicConfig(ctx context.Context, request *admin.UpdateDynamicConfigRequest) error {
×
183
        err := t.h.UpdateDynamicConfig(ctx, thrift.ToUpdateDynamicConfigRequest(request))
×
184
        return thrift.FromError(err)
×
185
}
×
186

187
// RestoreDynamicConfig deletes dynamic config value from config store based on filter
188
func (t AdminThriftHandler) RestoreDynamicConfig(ctx context.Context, request *admin.RestoreDynamicConfigRequest) error {
×
189
        err := t.h.RestoreDynamicConfig(ctx, thrift.ToRestoreDynamicConfigRequest(request))
×
190
        return thrift.FromError(err)
×
191
}
×
192

193
// DeleteWorkflow deletes dynamic config value from config store based on filter
194
func (t AdminThriftHandler) DeleteWorkflow(ctx context.Context, request *admin.AdminDeleteWorkflowRequest) (*admin.AdminDeleteWorkflowResponse, error) {
×
195
        response, err := t.h.DeleteWorkflow(ctx, thrift.ToAdminDeleteWorkflowRequest(request))
×
196
        return thrift.FromAdminDeleteWorkflowResponse(response), thrift.FromError(err)
×
197
}
×
198

199
// MaintainCorruptWorkflow deletes dynamic config value from config store based on filter
200
func (t AdminThriftHandler) MaintainCorruptWorkflow(ctx context.Context, request *admin.AdminMaintainWorkflowRequest) (*admin.AdminMaintainWorkflowResponse, error) {
×
201
        response, err := t.h.MaintainCorruptWorkflow(ctx, thrift.ToAdminMaintainWorkflowRequest(request))
×
202
        return thrift.FromAdminMaintainWorkflowResponse(response), thrift.FromError(err)
×
203
}
×
204

205
// ListDynamicConfig fetches all values associated to specified dc parameters or all otherwise
206
func (t AdminThriftHandler) ListDynamicConfig(ctx context.Context, request *admin.ListDynamicConfigRequest) (*admin.ListDynamicConfigResponse, error) {
×
207
        response, err := t.h.ListDynamicConfig(ctx, thrift.ToListDynamicConfigRequest(request))
×
208
        return thrift.FromListDynamicConfigResponse(response), thrift.FromError(err)
×
209
}
×
210

211
func (t AdminThriftHandler) GetGlobalIsolationGroups(ctx context.Context, request *admin.GetGlobalIsolationGroupsRequest) (*admin.GetGlobalIsolationGroupsResponse, error) {
×
212
        res, err := t.h.GetGlobalIsolationGroups(ctx, thrift.ToGetGlobalIsolationGroupsRequest(request))
×
213
        return thrift.FromGetGlobalIsolationGroupsResponse(res), thrift.FromError(err)
×
214
}
×
215

216
func (t AdminThriftHandler) UpdateGlobalIsolationGroups(ctx context.Context, request *admin.UpdateGlobalIsolationGroupsRequest) (*admin.UpdateGlobalIsolationGroupsResponse, error) {
×
217
        res, err := t.h.UpdateGlobalIsolationGroups(ctx, thrift.ToUpdateGlobalIsolationGroupsRequest(request))
×
218
        return thrift.FromUpdateGlobalIsolationGroupsResponse(res), thrift.FromError(err)
×
219
}
×
220

221
func (t AdminThriftHandler) GetDomainIsolationGroups(ctx context.Context, request *admin.GetDomainIsolationGroupsRequest) (*admin.GetDomainIsolationGroupsResponse, error) {
×
222
        res, err := t.h.GetDomainIsolationGroups(ctx, thrift.ToGetDomainIsolationGroupsRequest(request))
×
223
        return thrift.FromGetDomainIsolationGroupsResponse(res), thrift.FromError(err)
×
224
}
×
225

226
func (t AdminThriftHandler) UpdateDomainIsolationGroups(ctx context.Context, request *admin.UpdateDomainIsolationGroupsRequest) (*admin.UpdateDomainIsolationGroupsResponse, error) {
×
227
        res, err := t.h.UpdateDomainIsolationGroups(ctx, thrift.ToUpdateDomainIsolationGroupsRequest(request))
×
228
        return thrift.FromUpdateDomainIsolationGroupsResponse(res), thrift.FromError(err)
×
229
}
×
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