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

uber / cadence / 01896606-c2a7-4c89-817d-e6d1dc3a5a18

17 Jul 2023 10:44PM UTC coverage: 57.021% (-0.2%) from 57.249%
01896606-c2a7-4c89-817d-e6d1dc3a5a18

push

buildkite

web-flow
Merge master (#5351)

* Add Opensearch2 client with bulk API shared between clients (#5241)

* Allow to configure HTTP settings using template (#5329)

* CDNC-3181 Cleanup the unused watchdog code (#5096)

* Removed the Watchdog code and it's service calls

* Removed watchdog occurences and dependencies

---------

Co-authored-by: David Porter <david.porter@uber.com>

* Upgrade yarpc to v1.70.3 (#5341)

* upgrade mysql (#5345)

* upgrade mysql

* upgrade mysql version into 8.0 in docker files

* update all 5.7 to 8.0

* [dynamic config] add Filters method to dynamic config Key (#5346)

What changed?

Add Filters method to Key interface
Add implementations on most keys by parsing the comments on keys (assuming they are correct)
Why?

This is needed to know what dynamic config is domain specific. And this could possible simplify the collection struct by consolidating all GetPropertyFilterBy** methods.

How did you test it?

Potential risks

no risk since the method will be read only in non-critical path

Release notes

Documentation Changes

---------

Co-authored-by: Mantas Šidlauskas <sidlauskas.mantas@gmail.com>
Co-authored-by: agautam478 <72432016+agautam478@users.noreply.github.com>
Co-authored-by: David Porter <david.porter@uber.com>
Co-authored-by: Mantas Šidlauskas <mantass@netapp.com>
Co-authored-by: bowen xiao <xbowen@uber.com>

799 of 799 new or added lines in 17 files covered. (100.0%)

87154 of 152845 relevant lines covered (57.02%)

2484.19 hits per line

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

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

23
package serialization
24

25
import (
26
        "bytes"
27

28
        "go.uber.org/thriftrw/protocol/binary"
29

30
        "github.com/uber/cadence/.gen/go/sqlblobs"
31
)
32

33
type (
34
        thriftDecoder struct{}
35
)
36

37
func newThriftDecoder() decoder {
67✔
38
        return &thriftDecoder{}
67✔
39
}
67✔
40

41
func (d *thriftDecoder) shardInfoFromBlob(data []byte) (*ShardInfo, error) {
24✔
42
        result := &sqlblobs.ShardInfo{}
24✔
43
        if err := thriftRWDecode(data, result); err != nil {
24✔
44
                return nil, err
×
45
        }
×
46
        return shardInfoFromThrift(result), nil
24✔
47
}
48

49
func (d *thriftDecoder) domainInfoFromBlob(data []byte) (*DomainInfo, error) {
3,137✔
50
        result := &sqlblobs.DomainInfo{}
3,137✔
51
        if err := thriftRWDecode(data, result); err != nil {
3,137✔
52
                return nil, err
×
53
        }
×
54
        return domainInfoFromThrift(result), nil
3,137✔
55
}
56

57
func (d *thriftDecoder) historyTreeInfoFromBlob(data []byte) (*HistoryTreeInfo, error) {
37✔
58
        result := &sqlblobs.HistoryTreeInfo{}
37✔
59
        if err := thriftRWDecode(data, result); err != nil {
37✔
60
                return nil, err
×
61
        }
×
62
        return historyTreeInfoFromThrift(result), nil
37✔
63
}
64

65
func (d *thriftDecoder) workflowExecutionInfoFromBlob(data []byte) (*WorkflowExecutionInfo, error) {
494✔
66
        result := &sqlblobs.WorkflowExecutionInfo{}
494✔
67
        if err := thriftRWDecode(data, result); err != nil {
494✔
68
                return nil, err
×
69
        }
×
70
        return workflowExecutionInfoFromThrift(result), nil
494✔
71
}
72

73
func (d *thriftDecoder) activityInfoFromBlob(data []byte) (*ActivityInfo, error) {
78✔
74
        result := &sqlblobs.ActivityInfo{}
78✔
75
        if err := thriftRWDecode(data, result); err != nil {
78✔
76
                return nil, err
×
77
        }
×
78
        return activityInfoFromThrift(result), nil
78✔
79
}
80

81
func (d *thriftDecoder) childExecutionInfoFromBlob(data []byte) (*ChildExecutionInfo, error) {
3✔
82
        result := &sqlblobs.ChildExecutionInfo{}
3✔
83
        if err := thriftRWDecode(data, result); err != nil {
3✔
84
                return nil, err
×
85
        }
×
86
        return childExecutionInfoFromThrift(result), nil
3✔
87
}
88

89
func (d *thriftDecoder) signalInfoFromBlob(data []byte) (*SignalInfo, error) {
×
90
        result := &sqlblobs.SignalInfo{}
×
91
        if err := thriftRWDecode(data, result); err != nil {
×
92
                return nil, err
×
93
        }
×
94
        return signalInfoFromThrift(result), nil
×
95
}
96

97
func (d *thriftDecoder) requestCancelInfoFromBlob(data []byte) (*RequestCancelInfo, error) {
1✔
98
        result := &sqlblobs.RequestCancelInfo{}
1✔
99
        if err := thriftRWDecode(data, result); err != nil {
1✔
100
                return nil, err
×
101
        }
×
102
        return requestCancelInfoFromThrift(result), nil
1✔
103
}
104

105
func (d *thriftDecoder) timerInfoFromBlob(data []byte) (*TimerInfo, error) {
1✔
106
        result := &sqlblobs.TimerInfo{}
1✔
107
        if err := thriftRWDecode(data, result); err != nil {
1✔
108
                return nil, err
×
109
        }
×
110
        return timerInfoFromThrift(result), nil
1✔
111
}
112

113
func (d *thriftDecoder) taskInfoFromBlob(data []byte) (*TaskInfo, error) {
602✔
114
        result := &sqlblobs.TaskInfo{}
602✔
115
        if err := thriftRWDecode(data, result); err != nil {
602✔
116
                return nil, err
×
117
        }
×
118
        return taskInfoFromThrift(result), nil
602✔
119
}
120

121
func (d *thriftDecoder) taskListInfoFromBlob(data []byte) (*TaskListInfo, error) {
889✔
122
        result := &sqlblobs.TaskListInfo{}
889✔
123
        if err := thriftRWDecode(data, result); err != nil {
889✔
124
                return nil, err
×
125
        }
×
126
        return taskListInfoFromThrift(result), nil
889✔
127
}
128

129
func (d *thriftDecoder) transferTaskInfoFromBlob(data []byte) (*TransferTaskInfo, error) {
3,697✔
130
        result := &sqlblobs.TransferTaskInfo{}
3,697✔
131
        if err := thriftRWDecode(data, result); err != nil {
3,697✔
132
                return nil, err
×
133
        }
×
134
        return transferTaskInfoFromThrift(result), nil
3,697✔
135
}
136

137
func (d *thriftDecoder) crossClusterTaskInfoFromBlob(data []byte) (*CrossClusterTaskInfo, error) {
×
138
        result := &sqlblobsCrossClusterTaskInfo{}
×
139
        if err := thriftRWDecode(data, result); err != nil {
×
140
                return nil, err
×
141
        }
×
142
        return crossClusterTaskInfoFromThrift(result), nil
×
143
}
144

145
func (d *thriftDecoder) timerTaskInfoFromBlob(data []byte) (*TimerTaskInfo, error) {
5,732✔
146
        result := &sqlblobs.TimerTaskInfo{}
5,732✔
147
        if err := thriftRWDecode(data, result); err != nil {
5,732✔
148
                return nil, err
×
149
        }
×
150
        return timerTaskInfoFromThrift(result), nil
5,732✔
151
}
152

153
func (d *thriftDecoder) replicationTaskInfoFromBlob(data []byte) (*ReplicationTaskInfo, error) {
2✔
154
        result := &sqlblobs.ReplicationTaskInfo{}
2✔
155
        if err := thriftRWDecode(data, result); err != nil {
2✔
156
                return nil, err
×
157
        }
×
158
        return replicationTaskInfoFromThrift(result), nil
2✔
159
}
160

161
func thriftRWDecode(b []byte, result thriftRWType) error {
14,682✔
162
        buf := bytes.NewReader(b)
14,682✔
163
        sr := binary.Default.Reader(buf)
14,682✔
164
        return result.Decode(sr)
14,682✔
165
}
14,682✔
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