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

uber / cadence / 0186ed8c-939f-4cc5-9459-fac2c80653f9

17 Mar 2023 03:30AM UTC coverage: 57.113% (-0.005%) from 57.118%
0186ed8c-939f-4cc5-9459-fac2c80653f9

push

buildkite

GitHub
[history] more cautious in deciding domain state to make decisions on dropping queued tasks (#5164)

1 of 1 new or added line in 1 file covered. (100.0%)

85268 of 149297 relevant lines covered (57.11%)

2300.93 hits per line

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

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

73
func (d *thriftDecoder) activityInfoFromBlob(data []byte) (*ActivityInfo, error) {
71✔
74
        result := &sqlblobs.ActivityInfo{}
71✔
75
        if err := thriftRWDecode(data, result); err != nil {
71✔
76
                return nil, err
×
77
        }
×
78
        return activityInfoFromThrift(result), nil
71✔
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) {
1✔
90
        result := &sqlblobs.SignalInfo{}
1✔
91
        if err := thriftRWDecode(data, result); err != nil {
1✔
92
                return nil, err
×
93
        }
×
94
        return signalInfoFromThrift(result), nil
1✔
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) {
641✔
114
        result := &sqlblobs.TaskInfo{}
641✔
115
        if err := thriftRWDecode(data, result); err != nil {
641✔
116
                return nil, err
×
117
        }
×
118
        return taskInfoFromThrift(result), nil
641✔
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,744✔
130
        result := &sqlblobs.TransferTaskInfo{}
3,744✔
131
        if err := thriftRWDecode(data, result); err != nil {
3,744✔
132
                return nil, err
×
133
        }
×
134
        return transferTaskInfoFromThrift(result), nil
3,744✔
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,928✔
146
        result := &sqlblobs.TimerTaskInfo{}
5,928✔
147
        if err := thriftRWDecode(data, result); err != nil {
5,928✔
148
                return nil, err
×
149
        }
×
150
        return timerTaskInfoFromThrift(result), nil
5,928✔
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,898✔
162
        buf := bytes.NewReader(b)
14,898✔
163
        sr := binary.Default.Reader(buf)
14,898✔
164
        return result.Decode(sr)
14,898✔
165
}
14,898✔
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