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

uber / cadence / 01880bdf-c38c-430f-8249-282c4e9cc3f9

11 May 2023 05:52PM UTC coverage: 57.325% (-0.01%) from 57.339%
01880bdf-c38c-430f-8249-282c4e9cc3f9

push

buildkite

GitHub
Update matching to support tasklist isolation (#5280)

217 of 217 new or added lines in 9 files covered. (100.0%)

86759 of 151345 relevant lines covered (57.33%)

2475.02 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) {
2,987✔
50
        result := &sqlblobs.DomainInfo{}
2,987✔
51
        if err := thriftRWDecode(data, result); err != nil {
2,987✔
52
                return nil, err
×
53
        }
×
54
        return domainInfoFromThrift(result), nil
2,987✔
55
}
56

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

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

73
func (d *thriftDecoder) activityInfoFromBlob(data []byte) (*ActivityInfo, error) {
72✔
74
        result := &sqlblobs.ActivityInfo{}
72✔
75
        if err := thriftRWDecode(data, result); err != nil {
72✔
76
                return nil, err
×
77
        }
×
78
        return activityInfoFromThrift(result), nil
72✔
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) {
×
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) {
631✔
114
        result := &sqlblobs.TaskInfo{}
631✔
115
        if err := thriftRWDecode(data, result); err != nil {
631✔
116
                return nil, err
×
117
        }
×
118
        return taskInfoFromThrift(result), nil
631✔
119
}
120

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

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