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

uber / cadence / 01880288-8faa-46fa-8ccf-1762e958b165

09 May 2023 10:21PM UTC coverage: 57.164% (-0.03%) from 57.198%
01880288-8faa-46fa-8ccf-1762e958b165

Pull #5269

buildkite

neil-xie
Make ESClient fields public to use them in monorepo
Pull Request #5269: Make ESClient fields public to use them in monorepo

14 of 14 new or added lines in 2 files covered. (100.0%)

86032 of 150501 relevant lines covered (57.16%)

2430.6 hits per line

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

53.06
/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,102✔
50
        result := &sqlblobs.DomainInfo{}
3,102✔
51
        if err := thriftRWDecode(data, result); err != nil {
3,102✔
52
                return nil, err
×
53
        }
×
54
        return domainInfoFromThrift(result), nil
3,102✔
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) {
493✔
66
        result := &sqlblobs.WorkflowExecutionInfo{}
493✔
67
        if err := thriftRWDecode(data, result); err != nil {
493✔
68
                return nil, err
×
69
        }
×
70
        return workflowExecutionInfoFromThrift(result), nil
493✔
71
}
72

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

81
func (d *thriftDecoder) childExecutionInfoFromBlob(data []byte) (*ChildExecutionInfo, error) {
4✔
82
        result := &sqlblobs.ChildExecutionInfo{}
4✔
83
        if err := thriftRWDecode(data, result); err != nil {
4✔
84
                return nil, err
×
85
        }
×
86
        return childExecutionInfoFromThrift(result), nil
4✔
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) {
×
98
        result := &sqlblobs.RequestCancelInfo{}
×
99
        if err := thriftRWDecode(data, result); err != nil {
×
100
                return nil, err
×
101
        }
×
102
        return requestCancelInfoFromThrift(result), nil
×
103
}
104

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

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

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

129
func (d *thriftDecoder) transferTaskInfoFromBlob(data []byte) (*TransferTaskInfo, error) {
3,763✔
130
        result := &sqlblobs.TransferTaskInfo{}
3,763✔
131
        if err := thriftRWDecode(data, result); err != nil {
3,763✔
132
                return nil, err
×
133
        }
×
134
        return transferTaskInfoFromThrift(result), nil
3,763✔
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,820✔
146
        result := &sqlblobs.TimerTaskInfo{}
5,820✔
147
        if err := thriftRWDecode(data, result); err != nil {
5,820✔
148
                return nil, err
×
149
        }
×
150
        return timerTaskInfoFromThrift(result), nil
5,820✔
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,802✔
162
        buf := bytes.NewReader(b)
14,802✔
163
        sr := binary.Default.Reader(buf)
14,802✔
164
        return result.Decode(sr)
14,802✔
165
}
14,802✔
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